Access violation problem

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
neutral
Posts: 6
Joined: Thursday 09 June, 2011 - 13:59

Access violation problem

Post by neutral »

Hi,

So last week when I finished up for the week I was happy that I got my model working the way I wanted it to. However, today when I got back to it, I always get an "Access violation in module 'ED.exe'". This is the EXACTLY same model that worked just fine last week.

To make things worse, the access violation does not happen when I run the model in debug mode and only use step into. The model just works ok when I do this.

So how really am I supposed to debug this? All I get is an access violation popup (that I'm unable to close unless I'm running the debugger, spam enter key and spam-click the stop-button of the debugger, but that's a whole another matter) that tells me nothing about the problem. And how is it even possible that while nothing has changed, the model goes from fully working to completely broken?
neutral
Posts: 6
Joined: Thursday 09 June, 2011 - 13:59

Re: Access violation problem

Post by neutral »

So it turned out that the problem was that an icon was not saved into the model which the model then attempted to make use of. I have no idea why it simply disappeared from the model though. I have added two icons, both at the same time. One of them was there, the other one was not. Adding it back fixed the problem.

What makes no sense is that I did not get the access violation when running with the debugger on. How can I debug using the debugger if the model behaves differently when the debugger is on? Also, the help message was really of no use at all.

Either way, I got it fixed.
User avatar
Fred
Posts: 22
Joined: Wednesday 17 November, 2010 - 12:06

Re: Access violation problem

Post by Fred »

Hi,

I am sorry to see that you ran into this problem.

Based on your description ED should not have given an Access violation to begin with due to missing an icon. We will certainly look into this issue and come up with a better warning.

Secondly the difference in behavior between normal run and debugging run. Normally we try to execute the simulation code as fast as possible. Sometimes, like in your case with an unexpected icon missing, this can lead to an access violation (because we really optimize on speed). It shouldn't, but it does. During a debugging session however, the compiled code is decompiled to allow you to step through. My guess is that this error is captured nicely and disregarded (as maybe it should) and does not lead to an access violation, but just an icon not being displayed because it is missing.

I will have a look how we can improve our warnings in situations like this.

Gr. Fred...
Post Reply