Intermittent error

BlitzMax Forums/MaxGUI Module/Intermittent error

Oddball(Posted 2011) [#1]
I am getting this fault when using MaxGUI with Framework on a Mac.
objc[14793]: FREED(id): message _recursiveBreakKeyViewLoop sent to freed object=0x21eb80
The error does not happen every time and also does not happen if I don't use Framework. It occurs in debug and release mode, and also doesn't go to the debugger when using debug, it just crashes and prints that error in the output tab. I can't seem to recreate the error outside of my app so it must be something specific to the way I'm doing things. It happens when I press the 'Enter' key to activate an OK button, which then closes the window. I'm really stumped and it's made more infuriating by only happening 50% of the time. Any insight or thoughts would be greatly appreciated.


Oddball(Posted 2011) [#2]
I think this may not be MaxGUI related now. Originally it was happening at one specific point but now I get it at random moments.


jsp(Posted 2011) [#3]
Originally it was happening at one specific point but now I get it at random moments.

So maybe it is a garbage collector problem, when the problem occurs it takes some time until the next collection cycle and then crashes, thus it appears quite random.


Oddball(Posted 2011) [#4]
Maybe. It's frustrating as the debugger doesn't step in when it happens, so I'm finding it really hard to pinpoint exactly what is triggering it. All that happens is the error is printed in the output tab and the app quits.


col(Posted 2011) [#5]
could you find out if any of your 'objects' have the address relating to the error ? it may further point you in the right direction to the true cause.....

For eg if you have added in any external resources or created some types, do any of them have an address of 0x21eb80 in the debugger ? ( you could make a keypress to invoke the debugger, or setup a little function to debuglog any objects and their addresses when they created )

Dave

Last edited 2011


d-bug(Posted 2011) [#6]
The error is posted by the Objective-C part of MaxGUI.

There is a pointer to a released NSView stored in a TGadget instance of BlitzMax. BlitzMax is posting a method to that pointer, which will lead into that error. Maybe a wrong placed autorelease or release in the Objective-C part of MaxGUI.

Why should a BlitzMax debugger step into any Objective-C errors?

Last edited 2011


Oddball(Posted 2011) [#7]
I'm sorry d-bug, but I can't answer your question as I have no idea what any of what you just said means. Are you saying there is an error in the library that BlitzMax uses? Or that the error is still part of BlitzMax but in a part that the debugger can't test? Or am I just using it wrong? All I know is I have an app that works fine in Windows but crashes on the Mac, which really confused me as it's usually the other way round.


d-bug(Posted 2011) [#8]
I'm saying, that there must be an error in the part that BlitzMax imports to the MaxGUI-Module which you import to your code. It is written in a language called Objective-C which is the main language used by Apple to code their frameworks.

The BlitzMax-Debugger can't test all those errors provided by that language (Objective-C), because it's not written to test them properly.

Typically this "objc[14793]: FREED(id)" kind of error is posted, when your code tries to do something with a gadget whose pointer is stored in a BlitzMax-variable but was already freed by Objective-C. While Objective-C deletes the pointer, it is still stored in the BM-variable.

In your case, MaxGUI forced Objective-C to send the "_recursiveBreakKeyViewLoop" to a NSView gadget (which is an Objective-C gadget) that was freed before. Maybe there is a wrong placed "release" or "autorelease", or a missing "retain" method in Objective-C.