"Bad refs" error in output screen, MaxGUI

BlitzMax Forums/BlitzMax Programming/"Bad refs" error in output screen, MaxGUI

Fry Crayola(Posted 2005) [#1]
When I run my program, I get the following error in my output:

bad refs:obj=$cc2b10 refs=$7fffffff


I don't know what it means, nor where it would possibly occur. Any help is greatly appreciated.


Perturbatio(Posted 2005) [#2]
Any source would also be greatly appreciated.


Fry Crayola(Posted 2005) [#3]
Ah.

I'd post it but it's incredibly lengthy, so I reckon it'd be futile. It's basically a massive list of commands that are creating various GUI gadgets that I need. The annoying thing is that despite the error, the program still works, so it's hard to pinpoint it.

I'm currently looking through the debugger for the object corresponding to $cc2b10 if it's one I've created. I'll post code shortly afterwards.


Fry Crayola(Posted 2005) [#4]
Ok, I've isolated a smaller chunk of the code. It's to do with Tabbers or panels, really.




Fry Crayola(Posted 2005) [#5]
Ok, through lengthy use of DebugStop, I've found that the error is generated when at the line of code that says

ShowGadget MainTabberPanel[0]

Can't seem to find out why, though.


Fry Crayola(Posted 2005) [#6]
I'm now pretty sure this is a strange bug in MaxGUI, or somewhere other than my code.



In this code excerpt, the error is output whenever it reaches ShowGadget.

If, however, I remove ONE of the AddGadgetItem lines (any one), it works perfectly fine. If I add another one and make the necessary tweaks to the MainTabberPanel array to accomodate it, although it does work without (but crashes later when you try to select the tab, as there's no corresponding panel), it works fine.

It works with 12. It works with 14 items. It works with 26 items. 13? Nope.

Is Mark superstitious??


Hotcakes(Posted 2005) [#7]
Wait for BlitzMax v1.13 to find out.


skidracer(Posted 2005) [#8]
I got one of these yesterday, thanks for the hard work Fry, will have a look on Monday for this one.

I think that message only happens during garbage collection and usually has to do with some native c function thinking it has a copy of a string that it can retain (usually from a bytr ptr) rather than a string it must forget about when it returns at the end of the function (from a $z parameter).

The problem locating these problem functions is that the function at fault may have been called many instructions in the past and only when garbage collection occurs (insert mysterious 13 rumour here) does the problem / warning appear.


GW(Posted 2005) [#9]
I posted this bug 4 days ago!
http://www.blitzbasic.com/Community/posts.php?topic=53075
The worst part is that it happens at a level below anything the programmer can trap. I hope this gets fixed soon.
btw: I dont have maxGui, so its a bmax issue.


Jay Kyburz(Posted 2005) [#10]
i posted in the other thread, i'm quite sure that in 1.10 my games crashed at the point I know get this error.