Like clockwork, my FlexSim model crashes abruptly and predictably at about simulation time 7800 seconds.
Unfortunately I cannot attach the model file.
Do you have any tips for debugging a crashing model? Any help is appreciated.
Like clockwork, my FlexSim model crashes abruptly and predictably at about simulation time 7800 seconds.
Unfortunately I cannot attach the model file.
Do you have any tips for debugging a crashing model? Any help is appreciated.
Here is what our standard procedure would be if we had access to the model:
1) clean up known issues/errors. Are there ever any warnings or exceptions in the system console? If so, we track down the source of the problems and get them fixed. The Event Log may help in fixing these issues. Even though these warnings or exceptions may occur well before the time of the crash, they could still be related, and it's good practice to clean up any issues even if they are not related.
2) make the model repeatable. From FlexSim's main menu, turn on Statistics > Repeat Random Streams. Save the model with it turned on. With Repeat Random Streams turned on, make sure that the model crashes at a consistent time and note the time of the crash. If your model doesn't crash every time at the same time, your model is not repeatable. Follow the suggestions in the User Manual under Simulation Best Practices > Model Repeatability to make your model repeatable. Save the model with whatever changes were necessary to make the model repeatable.
3) find the simulation time of the crash. Open the model again, and set a stop time for some small amount of time before the crash. Run up to that point, slow the run speed, and run again, noting how far you can get before the crash. You may need to do this several times to get closer and closer to narrowing in on the exact crash time.
4) run up to the moment of the crash. Once you have pinpointed the moment of the crash, and you have run the model to some small amount of time just prior to the crash (ie. if your model crashes at time 7800.00, then set the stop time to 7799.99) - once you've run to that time just prior to the crash, open Debug > Event List to see a list of the upcoming events.
5) step to the event of the crash. Step through each scheduled event using the run controls' Step button, carefully noting which event is at the top of the list about to execute.
6) note the crash event. On one of the events, FlexSim should crash. Hopefully you took careful note of which event that was.
7) find and debug the event. Repeat steps 4-5, up until the very next step will crash FlexSim. What is the crashing event? Is there any custom code that fires as a result of that event? If so, put a breakpoint at the top of that code and then hit step to execute the next event, then debug the code.
8) track down a hiding issue. If there is no code that fires on that specific event, does that event spawn other events that happen simultaneously where there may be custom code? For instance, if the event is entry to a queue, the exit to the queue and entry to the next object down stream can all happen on the same event. Mentally follow the execution path of the event known to crash FlexSim - what else does it cause to happen immediately? Is there any custom logic along any step of that execution trail?
After you go through these steps, if you still haven't found the bug, you will at least be much closer and have a good idea of the origination of the problem. It may be that you could create a smaller sample model to send in that exhibits the same problem. Or it may be a good foundation in starting a web meeting with a member of our team to find the issue. Please contact us if you get to that point and are ready to schedule something.
@Ben Wilson, please convert your answer into an article. It is so fundamentally that it belongs to themes that I‘d like to read when I start with FlexSim and I want to know more about this program.
Hello, is there anyway to debug this code, it appears on time 0, when I click into the Run model, the code appears on the System Console as Follows:
time: 0.000000 exception: Exception caught in Executive::processeventinlist(). Throwing. time: 0.000000 exception: Exception caught in Executive::steptotime(). Throwing. time: 0.000000 exception: Exception caught in Executive::tick(). Throwing. time: 0.000000 exception: int runthemessageloop() #4 exception: Executive::instance.tick(); time: 0.000000 exception: int runthemessageloop() #6
Any idea what is this error related to? @Ben Wilson
To debug an exception at time zero: In the script window write a for loop that prints the loop counter to the system console using mpt, mpd, mpr commands and include in the loop the step() command. You will then see at which step the exception occurs and can rerun changing the loop limit to be before that step. Then look at the event list to see what is the next time zero step.
Hi @Luis T5,
Please ask a new question as per the Answers Best Practices and reference this question. This question has already been answered and is very old, so your comment likely won't be seen.
There appears to be an infinite loop in your model. If you post a new question and attach your model, we can take a look at it. Without a model, it is impossible to debug, unfortunately.
8 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved