<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Model crashing at random time in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575172#M74575</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/42551/marcobaccalaro.html" nodeid="42551"&gt;@Marco Baccalaro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You have discovered a couple bugs here.&lt;/P&gt;&lt;P&gt;The first one is being caused by the table value being accessed and cast to a boolean value. This isn't being handled correctly in the implementation of FlexScript. For now, to avoid this issue you can use comparison operators which avoids casting to a boolean.&lt;/P&gt;&lt;P&gt;The second bug that you demonstrated with the switch statement is caused by another trickier bug. In this case the table you are accessing is going out of scope before the value is being accessed. This is causing undefined behavior. For now, to avoid this issue we recommend assigning the table to a local variable before trying to access anything on it.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 29 Oct 2024 21:48:22 GMT</pubDate>
    <dc:creator>Jacob_Gillespie</dc:creator>
    <dc:date>2024-10-29T21:48:22Z</dc:date>
    <item>
      <title>Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575157#M74560</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 24.2.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/86822-crashing-model.fsm" target="_blank"&gt;Crashing model.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;Hello,&lt;/P&gt;
 &lt;P&gt;I have a model that is crashing, and I struggle to debug it because it crashes every time at a different simulated time even if I repeat the random streams and I reopen the same model every time.&lt;/P&gt;
 &lt;P&gt;It can happen after soon or after many simulated days.&lt;/P&gt;
 &lt;P&gt;How can I debug such a model?&lt;/P&gt;
 &lt;P&gt;I tried to look at the event list at the moment of crash and the event log by opening the external file, but every time I see different events.&lt;/P&gt;
 &lt;P&gt;Thank you for any support you can give me.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 Sep 2024 14:35:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575157#M74560</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-09-26T14:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575158#M74561</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;First get it repeating - if you see different events that's great - look at the first difference and figure out why that's happening.&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 08:51:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575158#M74561</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-27T08:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575159#M74562</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 The problem is exactly that. That it doesn't repeat.
 &lt;P&gt;But it's not something that is not correctly reset because it doesn't repeat even by closing and reopening the same model.&lt;/P&gt;
 &lt;P&gt;What can make FlexSim not repeating even by opening and running twice the same model?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 08:55:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575159#M74562</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-09-27T08:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575160#M74563</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Compare two event logs with different events (just run it twice and export each time). Look at the first of those events and try to determine the cause - it will vary per model. You can refer to the documentation on causes of non-repeatability &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/24.2/BestPractices/ModelRepeatability/ModelRepeatability.html" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 09:17:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575160#M74563</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-27T09:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575161#M74564</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 As said, it’s not a normal non repeatability problem because I always restart the same model (not resetting, but opening the model again) so I should normally have the exact same list of events.
 &lt;P&gt;And I tried to save the logs and opened them, the events before the crash are always different.&lt;/P&gt;
 &lt;P&gt;So, my question is: what can make FlexSim crash at different times in a model that should repeat itself at each run?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:12:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575161#M74564</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-09-27T10:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575162#M74565</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;The first step is to make the model repeat - even if it's only for 1 second.  Then go to the next difference eg. 10 seconds until your model is repeating.  Then when the crash happens you can repeat the event at which it occurs.  If you're saying even the events schedule at time zero on reset are in a different order before the model even starts then this is also a clue as to what could be causing the unrepeatability.&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:30:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575162#M74565</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-27T10:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575163#M74566</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;When you open the model, do you reset it before running?&lt;/P&gt;&lt;P&gt;I have loaded the model, set the event log to record to 250,000 seconds, set the end time to 250,000 seconds,  enabled the event log and the reset before running.   I get identical events to that time.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/86857-baccalaro-events1.zip" target="_blank"&gt;Baccalaro_Events1.zip&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:32:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575163#M74566</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-27T10:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575164#M74567</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 But why the model shouldn’t repeat if every time I reopen FlexSim and the model from zero?
&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:46:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575164#M74567</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-09-27T10:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575165#M74568</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 I tried both ways
&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:47:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575165#M74568</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-09-27T10:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575166#M74569</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Even if I do a reset and second run I still get the same events to 250,000.&lt;/P&gt;&lt;P&gt;At what point do you see the events diverge? Please upload your event lists or compare it with the one I sent and give us step by step instructions on how to replicate it.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:55:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575166#M74569</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-27T10:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575167#M74570</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;I think you're saying that the logged events repeat but the crash still occurs at random times - is that correct?&lt;/P&gt;&lt;P&gt;I can confirm the model crashed for me at around 280,000 seconds and in another run at around 500,000 seconds.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:58:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575167#M74570</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-27T10:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575168#M74571</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P id="isPasted"&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/87256-the-crashing-model.fsm" target="_blank"&gt;The crashing model.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;After working a lot on it, I managed to isolate the problem and find where the model crashes (hoping that this is the only reason), but I really don't understand why.&lt;/P&gt;
 &lt;P&gt;If I change this line of code&lt;/P&gt;
 &lt;PRE&gt;if (Table("PO Prod")&lt;I&gt;[POPROD_COL_MDS_6_DOSINGS] || Table("PO Prod")&lt;I&gt;[POPROD_COL_AUTO_C1_DOSINGS])&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
 &lt;P&gt;with this one&lt;/P&gt;
 &lt;PRE&gt;if (Table("PO Prod")&lt;I&gt;[POPROD_COL_MDS_6_DOSINGS] &amp;gt; 0 || Table("PO Prod")&lt;I&gt;[POPROD_COL_AUTO_C1_DOSINGS] &amp;gt; 0)&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
 &lt;P&gt;the model doesn't crash anymore.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Note that:&lt;/P&gt;
 &lt;UL&gt;&lt;LI&gt;the table "PO Prod" is a bundle table, but the crash happens also when I put it back to a normal table&lt;/LI&gt;&lt;LI&gt;values in the table can be 0 or an integer &amp;gt; 1&lt;/LI&gt;&lt;LI&gt;The model crashes when reading the line 340 of the table at the model time 95121.58&lt;/LI&gt;&lt;LI&gt;The numbers on the table are 1 and 2, so the code results in if (1 || 2)&lt;/LI&gt;&lt;LI&gt;if I go step by step, when executing this code, it doesn't crash!&lt;/LI&gt;&lt;/UL&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;This is beyond my capability to understand it.&lt;/P&gt;
 &lt;P&gt;What am I not getting?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 12 Oct 2024 18:35:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575168#M74571</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-10-12T18:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575169#M74572</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Another very weird thing: &lt;/P&gt;
 &lt;P&gt;The following code gives the error:&lt;/P&gt;
 &lt;P&gt;"exception: FlexScript exception: Invalid row number: 1 in Global Table "PO Prod" at MAIN:/project/exec/consolescript c: &amp;lt;no path&amp;gt; i: &amp;lt;no path&amp;gt;"&lt;/P&gt;
 &lt;PRE&gt;switch (Table("PO Prod")[1][POPROD_COL_PO_SEQUENCE]){
case PO_SEQUENCE_C1:
return "C1";
case PO_SEQUENCE_C2:
return "C2";
}&lt;/PRE&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;While this code works&lt;/P&gt;
 &lt;PRE&gt;int value = Table("PO Prod")[1][POPROD_COL_PO_SEQUENCE];
switch (value){
case PO_SEQUENCE_C1:
return "C1";
case PO_SEQUENCE_C2:
return "C2";
}&lt;/PRE&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;What's happening?&lt;/P&gt;
 &lt;P&gt;Is my model corrupted?&lt;/P&gt;
 &lt;P&gt;Did it ever happen to anyone else?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Oct 2024 13:13:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575169#M74572</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-10-17T13:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575170#M74573</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;I finally understood that the problem is the table "PO Prod".&lt;/P&gt;
 &lt;P&gt;Somehow it is corrupted and gives these very strange problems.&lt;/P&gt;
 &lt;P&gt;I now just wonder how this happens and how can we avoid this happening again.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Oct 2024 13:29:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575170#M74573</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-10-17T13:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575171#M74574</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/42551/marcobaccalaro.html" nodeid="42551"&gt;@Marco Baccalaro&lt;/A&gt;,&lt;P&gt;This has been submitted to the Development team for further investigation. &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Oct 2024 16:02:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575171#M74574</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2024-10-21T16:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575172#M74575</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/42551/marcobaccalaro.html" nodeid="42551"&gt;@Marco Baccalaro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You have discovered a couple bugs here.&lt;/P&gt;&lt;P&gt;The first one is being caused by the table value being accessed and cast to a boolean value. This isn't being handled correctly in the implementation of FlexScript. For now, to avoid this issue you can use comparison operators which avoids casting to a boolean.&lt;/P&gt;&lt;P&gt;The second bug that you demonstrated with the switch statement is caused by another trickier bug. In this case the table you are accessing is going out of scope before the value is being accessed. This is causing undefined behavior. For now, to avoid this issue we recommend assigning the table to a local variable before trying to access anything on it.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Oct 2024 21:48:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575172#M74575</guid>
      <dc:creator>Jacob_Gillespie</dc:creator>
      <dc:date>2024-10-29T21:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575173#M74576</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you very much Jacob.
 &lt;P&gt;I'm very happy to know that this is on the list of bugs to be solved and can contribute to make FlexSim even better.&lt;BR /&gt;Good work!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Oct 2024 06:41:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575173#M74576</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-10-30T06:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575174#M74577</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;This issue has been fixed in the latest bug fix releases 24.0.7 and 24.2.3.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Dec 2024 18:21:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575174#M74577</guid>
      <dc:creator>jonah_kendellR47TC</dc:creator>
      <dc:date>2024-12-18T18:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Model crashing at random time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575175#M74578</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Super!
 &lt;P&gt;This was a very worrying bug. It's great to know that it has been solved.&lt;BR /&gt;Great job guys.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Dec 2024 18:22:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/model-crashing-at-random-time/m-p/13575175#M74578</guid>
      <dc:creator>MarcoBaccalaro</dc:creator>
      <dc:date>2024-12-18T18:22:52Z</dc:date>
    </item>
  </channel>
</rss>

