Unhandled Memory Exception Error

BlitzMax Forums/BlitzMax Beginners Area/Unhandled Memory Exception Error

xlsior(Posted 2007) [#1]
One of the programs I'm working on is having an issue:

Under blitzmax 1.24, it worked OK.
Under 1.26 (and 1.28) everything functions, but only in debug mode. In release mode it blows up with an "Unhandled Memory Exception Error"

I've recompiled all modules and am trying to reduce the program to the bare bones that still generate the error, but so far without any luck.

(There's several 3rd party modules involved as well as a bunch of windows system calls and events triggers)

Does anyone have any brilliant tips in how to try to track down such an error, especially since everything works just peachy in debug mode?


Jesse(Posted 2007) [#2]
it sounds like the problem I am having.
http://www.blitzmax.com/Community/posts.php?topic=74337
I am going to revert back to 1.24 and see what happens.
I can't get it out of my head its a bug in bmax.


EOF(Posted 2007) [#3]
I had pretty much the same problem as you. It turned out to be an API call with incorrect parameter types. Ints being used instead of Shorts for example.

I only found the problem by:

1) commenting out individual API calls
2) Comparing the API functions to the Pub.Win32 ones
3) Using Win32.HLP


Koriolis(Posted 2007) [#4]
I have the very same problem with one MaxGUI application since 1.26 (same in 1.28). It worked, too, with 1.24. I couldn't nail down exactly where it blows up yet, as debugging WITHOUT debugging support is pretty painfull.
I can't say yet if my code is faulty, but seeing how similar to my problem it is, maybe there is a serious problem with the latest BlitzMax.


Koriolis(Posted 2007) [#5]
Also, could this thread be moved to "BlitzMax bug report"? Even if's not clear yet if it's a BlitzMax bug or not, it really ought to be in this forum (or else it will certainly be ignored).
Not to say this is at the very least a behaviour change, as the same code used to work.


iprice(Posted 2007) [#6]
Strangely enough I had this earlier today, but it was down to a silly mistake made by me, not BMax.

I discovered that I had missed out one colon (:) when I wanted to load an Incbin image



instead of -



So easy to do; so easy to miss.

Of course, that was my silly mistake and your error may be completely unrelated...


xlsior(Posted 2007) [#7]
Unfortunately that's not it, I'm not reading in any media at all.


Grey Alien(Posted 2007) [#8]
If you are getting different behaviour in DEbug and non-debug, I'd suggest checking out this thread: http://www.blitzbasic.com/Community/posts.php?topic=74333

As I had the same problem recently (MAV in non-debug). My thread was deleted and Mark made the one above.


xlsior(Posted 2007) [#9]
Interesting... That could be related, of course.


Grey Alien(Posted 2007) [#10]
That's what I was thinking. Check if you were doing what I was doing i.e. filling an array by using a Function which incremented the array slot counter.


xlsior(Posted 2007) [#11]
I don't think I am, but there is at least one charbuffer[255] that gets populated by an API call somewhere.


Grey Alien(Posted 2007) [#12]
Oh well it was worth a shot. The next step is to make a reduced version of the code to isolate the crash of course. Always a pain but if it helps BRL fix it, it's worth it.