amiga.org
     
iconAll times are GMT -6. The time now is 04:26 AM. | Welcome to Forum, please register to access all of our features.

» Amiga.org » Operating System Specific Discussions » Amiga OS » Amiga OS -- Development » Find what is causing GURU 8000003

Amiga OS -- Development This particular forum deals with issues regarding development for all versions of AmigaOS.

Reply
 
Thread Tools Display Modes
Old 03-06-2012, 11:04 PM   #1
bbond007
Defender of the Faith
Points: 8,812, Level: 63 Points: 8,812, Level: 63 Points: 8,812, Level: 63
Activity: 27% Activity: 27% Activity: 27%
 
bbond007's Avatar
 
Join Date: Mar 2009
Posts: 1,267
Default Find what is causing GURU 8000003

I have been just starting learning the intuition API and amiga software development and I'm using SAS c 6.48.

I have been doing all of my development on my Minimig 1.1 just for fun. Or maybe punishment. I'm not sure which.

I have all the updates to the SAS product I know of except for a Y2K thing I was not sure how to apply, and my Minimig always reverts back to 1994 anyway.

Anyway my application works pretty well for some time but typically I get a guru 80000003 and 8100000F at least once.

The hard part is that the application typically never gurus at the same point and the crashes are not repeatable.

I'm not doing anything super special. I'm just trying (and successfully I might add) to display 3D objects from google's 3D warehouse on my minimig.

I do a bunch of AllocVec initially when I load an object, and eventually FreeVec. but that's not typically when the application crashes. I tried giving the application more stack and that seem to help. I don't think the problem is in the 3D library I'm working on, otherwise it would start to draw erratically I'd think. I got a feeling its some noob thing I'm doing wrong with screens(I'm double buffering) or windows or IDCMP messages. It does the same thing eventually on my A1200 and WunUAE.

What are my options for tracking this down? I know there is Enforcer (and I'll switch to UAE or my A1200/060) but I'm not even sure if that the right tool to use. Or maybe somebody knows of a few common things to check for?

I do like the Amiga API and I think its pretty cool. It really lets you do some cool OS compatible stuff without resorting to taking total control of the machine.

I can show the source if it would help, but I'm asking someone to do my homework for me, but I could use a hint...

Thanks.

Last edited by bbond007; 03-06-2012 at 11:10 PM..
bbond007 is offline   Reply With Quote
Old 03-07-2012, 01:47 AM   #2
Gilloo
Too much caffeine
Points: 5,868, Level: 49 Points: 5,868, Level: 49 Points: 5,868, Level: 49
Activity: 4% Activity: 4% Activity: 4%
 
Gilloo's Avatar
 
Join Date: Apr 2006
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 117
Default Re: Find what is causing GURU 8000003

80000003 not enough beer :-) no, it occurs when the processor access on misalign data (critical on 68000)
8100000f, concerns memory list, bad free address, bad memory header.

You should check your all the structures, especially where BYTE or UBYTE are present and add pads to align data.
Gilloo is offline   Reply With Quote
Old 03-07-2012, 01:20 PM   #3
bbond007
Defender of the Faith
Points: 8,812, Level: 63 Points: 8,812, Level: 63 Points: 8,812, Level: 63
Activity: 27% Activity: 27% Activity: 27%
 
bbond007's Avatar
 
Join Date: Mar 2009
Posts: 1,267
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by Gilloo View Post
80000003 not enough beer :-) no, it occurs when the processor access on misalign data (critical on 68000)
8100000f, concerns memory list, bad free address, bad memory header.

You should check your all the structures, especially where BYTE or UBYTE are present and add pads to align data.
Yesterday(while researching 8000000f noticed that I had a UCHAR * tempBuffer that was as TmpRas for AreaDraw so I changed that PLANEPTR. The dangers of copping code off the internet anyway I did change that. After reading your post I went back and looked at my structs and sure enough I had some UBYTEs.

I also saw the not enough beer refrence. I wonder who put that in there? Bil Herd? He was the beer guy

I was interested to see what the compiler was doing so I made a quick program that just printed out sizeof all my structures. They were all even, so I must have some option on the compiler set to do that. To be safe, I added another UBYTE _filler, and ran the program again and the structures stayed the same size.

Quote:
Originally Posted by billyfish View Post
Enforcer is good. In terms of memory bugs, since you're using SAS, try linking against MemLib which is in its extras folder. I found I had to rebuild MemLib to get it to work ok on my WinUAE but you might be ok. I also seem to recall having similar gurus when I had my PARAMS option in scopts set to "BOTH" rather than "STACK" but that may have been due to specifics in the project I was working on.

Good luck!

billy
I messed with that PARAMS option a while back, I tried register and both but instantly got link errors... I definitely have it on stack now.

Quote:
Originally Posted by 560SL View Post
Usually this means that some local variables that are on the stack are trashed at some point. Like, filling a char- array too long or similar. It can waste the return instructions from a function call, setting the program counter to absolutley weird addresses and causing the behaviour you describe. Adding stack can sometimes help to preserve the return instructions so you dont experience the problem.

Might sound cryptic, but check your stack variables to begin with.
I think I understand.

by stack variable, you mean I'm doing something like this...

int void broken()
{
char temp[3];
for(i=0;i<5;i++)
temp[i] = 0x00;
return 0;

}

I don't have many stack variables, in fact most of my local variables are just USHORTs used as counters. I'm mostly accessing the same global array of structures.

I did see a case where I did have that exact issue. It was only in the HAM mode rendering which I really not even testing. I have a few files with this default sketchup person that is drawn with just a few one polygons with like a zillion points each. That would have blown up the HAM mode, and I'm not sure what happens when you overflow AreaDraw, but that was probably happening too. The area draw buffer was buffer was not located on the stack though if I understand the stack variable thing correctly.

Its been a long time and I have gotten soft because I have been programming in C# and java for the last 10 years

Anyway, thanks for the help, I made a few changes based on these suggestions so hopefully the stability increases.

nate

Last edited by bbond007; 03-07-2012 at 01:23 PM..
bbond007 is offline   Reply With Quote
Old 03-07-2012, 03:12 PM   #4
560SL
Technoid
Points: 6,415, Level: 52 Points: 6,415, Level: 52 Points: 6,415, Level: 52
Activity: 1% Activity: 1% Activity: 1%
 
560SL's Avatar
 
Join Date: Jan 2005
Posts: 197
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by bbond007 View Post
by stack variable, you mean I'm doing something like this...
Yep, exactly. And it might not be so obvious either. I work daily with C- programming, for like 15 years now, and I still do mistakes likes this now and then.

Stack problems can be a challenge to track down since they may appear seemingly at random. Can be due to "litter" in uninitialized variables, and can run fine 9 times out of 10. What they do tend is to generate crashes that seem totally unrelated to what youre trying to do in your program, like alignment problems. Weird out program counter etc.

I never got too used with the debugging tools on the Amiga (Enforcer etc), if I need to track down a bug, I usually end up with just staring at the code, trying to figure out whats wrong.

As in love and war, everything is ok when it comes to debugging. Even printf- debugging.

Yeah, Ive heard people getting soft with Java... they dont even have to null- terminate their strings...
__________________
AmigaOS: Forward Into The Past
560SL is offline   Reply With Quote
Old 03-07-2012, 03:20 PM   #5
TheBilgeRat
Defender of the Faith
Points: 8,533, Level: 62 Points: 8,533, Level: 62 Points: 8,533, Level: 62
Activity: 60% Activity: 60% Activity: 60%
 
TheBilgeRat's Avatar
 
Join Date: May 2010
Location: Dundee, OR
Posts: 1,621
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by 560SL View Post
Yep, exactly. And it might not be so obvious either. I work daily with C- programming, for like 15 years now, and I still do mistakes likes this now and then.

Stack problems can be a challenge to track down since they may appear seemingly at random. Can be due to "litter" in uninitialized variables, and can run fine 9 times out of 10. What they do tend is to generate crashes that seem totally unrelated to what youre trying to do in your program, like alignment problems. Weird out program counter etc.

I never got too used with the debugging tools on the Amiga (Enforcer etc), if I need to track down a bug, I usually end up with just staring at the code, trying to figure out whats wrong.

As in love and war, everything is ok when it comes to debugging. Even printf- debugging.

Yeah, Ive heard people getting soft with Java... they dont even have to null- terminate their strings...
You think those are strings in C?
"string" and "array" are just syntactic sugar.
TheBilgeRat is offline   Reply With Quote
Old 03-07-2012, 05:00 PM   #6
bbond007
Defender of the Faith
Points: 8,812, Level: 63 Points: 8,812, Level: 63 Points: 8,812, Level: 63
Activity: 27% Activity: 27% Activity: 27%
 
bbond007's Avatar
 
Join Date: Mar 2009
Posts: 1,267
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by 560SL View Post
I never got too used with the debugging tools on the Amiga (Enforcer etc), if I need to track down a bug, I usually end up with just staring at the code, trying to figure out whats wrong.

As in love and war, everything is ok when it comes to debugging. Even printf- debugging.

Yeah, Ive heard people getting soft with Java... they dont even have to null- terminate their strings...
I was getting into Android programming, but really overall, I'm not terribly impressed with it. I'm sure saying this is like saying all good programs for the Amiga are created in assembler and not c or basic but all good programs for Android are created using the NDK and not SDK and dalvik. The NDK apparently offers like no support at the API level. Also the emulator sux...

Also, you don't get to write code that looks like this in java

if((*((POLYPTR*)a))->z == (*((POLYPTR*)b))->z)
return 0;
else
if((*((POLYPTR*)a))->z > (*((POLYPTR*)b))->z)
return 1;
else
return -1;


Thanks for the help! Like my new GURU?
Attached Images
File Type: png GURU.png (12.2 KB, 8 views)

Last edited by bbond007; 03-07-2012 at 05:05 PM..
bbond007 is offline   Reply With Quote
Old 03-07-2012, 05:19 PM   #7
bloodline
Master Sock Abuser
Points: 37,161, Level: 100 Points: 37,161, Level: 100 Points: 37,161, Level: 100
Activity: 8% Activity: 8% Activity: 8%
 
bloodline's Avatar
 
Join Date: Mar 2002
Location: London, UK
Posts: 11,657
Blog Entries: 3
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by bbond007 View Post
I was getting into Android programming, but really overall, I'm not terribly impressed with it. I'm sure saying this is like saying all good programs for the Amiga are created in assembler and not c or basic but all good programs for Android are created using the NDK and not SDK and dalvik. The NDK apparently offers like no support at the API level. Also the emulator sux...

Also, you don't get to write code that looks like this in java

if((*((POLYPTR*)a))->z == (*((POLYPTR*)b))->z)
return 0;
else
if((*((POLYPTR*)a))->z > (*((POLYPTR*)b))->z)
return 1;
else
return -1;


Thanks for the help! Like my new GURU?
Hmmm, I hate java... This can't really find a good excuse to bother to learn the Android API... You should try iPhone programming... Then you're back into good old C... With a weird smalltalk style object oriented API on top (it's more fun than it sounds ).
__________________
My iPhone Game: Puny Humans -
http://itunes.apple.com/gb/app/puny-...362230281?mt=8
bloodline is offline   Reply With Quote
Old 03-07-2012, 04:56 AM   #8
billyfish
Beginner
Points: 5,731, Level: 48 Points: 5,731, Level: 48 Points: 5,731, Level: 48
Activity: 1% Activity: 1% Activity: 1%
 
Join Date: Oct 2005
Posts: 49
Default Re: Find what is causing GURU 8000003

Quote:
What are my options for tracking this down? I know there is Enforcer (and I'll switch to UAE or my A1200/060) but I'm not even sure if that the right tool to use. Or maybe somebody knows of a few common things to check for?
Enforcer is good. In terms of memory bugs, since you're using SAS, try linking against MemLib which is in its extras folder. I found I had to rebuild MemLib to get it to work ok on my WinUAE but you might be ok. I also seem to recall having similar gurus when I had my PARAMS option in scopts set to "BOTH" rather than "STACK" but that may have been due to specifics in the project I was working on.

Good luck!

billy
billyfish is offline   Reply With Quote
Old 03-07-2012, 09:08 AM   #9
560SL
Technoid
Points: 6,415, Level: 52 Points: 6,415, Level: 52 Points: 6,415, Level: 52
Activity: 1% Activity: 1% Activity: 1%
 
560SL's Avatar
 
Join Date: Jan 2005
Posts: 197
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by bbond007 View Post
I tried giving the application more stack and that seem to help.
Usually this means that some local variables that are on the stack are trashed at some point. Like, filling a char- array too long or similar. It can waste the return instructions from a function call, setting the program counter to absolutley weird addresses and causing the behaviour you describe. Adding stack can sometimes help to preserve the return instructions so you dont experience the problem.

Might sound cryptic, but check your stack variables to begin with.
__________________
AmigaOS: Forward Into The Past
560SL is offline   Reply With Quote
Old 03-08-2012, 04:04 PM   #10
bbond007
Defender of the Faith
Points: 8,812, Level: 63 Points: 8,812, Level: 63 Points: 8,812, Level: 63
Activity: 27% Activity: 27% Activity: 27%
 
bbond007's Avatar
 
Join Date: Mar 2009
Posts: 1,267
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by billyfish View Post
Enforcer is good. In terms of memory bugs, since you're using SAS, try linking against MemLib which is in its extras folder. I found I had to rebuild MemLib to get it to work ok on my WinUAE but you might be ok. I also seem to recall having similar gurus when I had my PARAMS option in scopts set to "BOTH" rather than "STACK" but that may have been due to specifics in the project I was working on.

Good luck!

billy
MemLib was a good idea. It found one memory leak that I had just recently created when I added an an array of pointers for sorting and apparently neglected to free it in my cleanup function. More interestingly it was able to detect this condition as "trailer trashed". see the "* DisplayBPP" in the AllocVec... I know thats wrong, i just find it strange that it would trash memory. I'd think its simply a waste of memory (MAX_POLY_VERT was already way more than needed) . unless displayBPP was a floating point between 0 and 1... which its not...


if(areaBuffer = AllocVec(MAX_POLY_VERT * DisplayBPP, MEMF_CLEAR))
{
InitArea(&areaInfo, areaBuffer, MAX_POLY_VERT);


thanks for the help.

I'll use Memlib in the future as it beats my previous method of trying to remember what the chip and fast were before I ran the app.

Last edited by bbond007; 03-08-2012 at 04:09 PM..
bbond007 is offline   Reply With Quote
Old 03-08-2012, 04:18 PM   #11
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by bbond007 View Post
More interestingly it was able to detect this condition as "trailer trashed". see the "* DisplayBPP" in the AllocVec... I know thats wrong, i just find it strange that it would trash memory. I'd think its simply a waste of memory (MAX_POLY_VERT was already way more than needed) . unless displayBPP was a floating point between 0 and 1... which its not...


if(areaBuffer = AllocVec(MAX_POLY_VERT * DisplayBPP, MEMF_CLEAR))
{
InitArea(&areaInfo, areaBuffer, MAX_POLY_VERT);
This is what InitArea autodoc says:
Quote:
This function provides initialization for the vector collection matrix
such that it has a size of (max vectors ). The size of the region
pointed to by buffer (short pointer) should be five (5) times as large
as maxvectors. This size is in bytes.
The multiplier must be 5. It has nothing to do with display bits per pixel.
Piru is offline   Reply With Quote
Old 03-08-2012, 05:18 PM   #12
bbond007
Defender of the Faith
Points: 8,812, Level: 63 Points: 8,812, Level: 63 Points: 8,812, Level: 63
Activity: 27% Activity: 27% Activity: 27%
 
bbond007's Avatar
 
Join Date: Mar 2009
Posts: 1,267
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by Piru View Post
This is what InitArea autodoc says:


The multiplier must be 5. It has nothing to do with display bits per pixel.
oh, thanks for clarifying that. I think I'm guilty of not reading the docs. I wonder why 5?

Anyway, the interesting thing was I was getting the corruption on every object, and the vast majority of the objects were comprised of triangles, that 1024 would would have allowed for 170.

I had it set to 1024 so I'm just surprised I had any sort of error detected at all. I'm certainly not complaining.

Thanks!
bbond007 is offline   Reply With Quote
Old 03-08-2012, 05:44 PM   #13
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by bbond007 View Post
I wonder why 5?
The buffer provided to InitArea is split into two arrays 1) flag table and 2) vector table.

Flag table is byte array, while vector table holds SHORTs (x, y). This gives you the multiplier of 5 (2 * sizeof(SHORT) + sizeof(UBYTE)).

Ellipse consumes two entries, move and draw one, except when closing a polygon, in which case extra entry for the final draw is added. There are also some internal optimization where unnecessary moves are removed.
Piru is offline   Reply With Quote
Old 03-08-2012, 04:27 PM   #14
billyfish
Beginner
Points: 5,731, Level: 48 Points: 5,731, Level: 48 Points: 5,731, Level: 48
Activity: 1% Activity: 1% Activity: 1%
 
Join Date: Oct 2005
Posts: 49
Default Re: Find what is causing GURU 8000003

Quote:
Originally Posted by bbond007 View Post
More interestingly it was able to detect this condition as "trailer trashed". see the "* DisplayBPP" in the AllocVec... I know thats wrong, i just find it strange that it would trash memory. I'd think its simply a waste of memory (MAX_POLY_VERT was already way more than needed) . unless displayBPP was a floating point between 0 and 1... which its not...

if(areaBuffer = AllocVec(MAX_POLY_VERT * DisplayBPP, MEMF_CLEAR))
{
InitArea(&areaInfo, areaBuffer, MAX_POLY_VERT);
This one has stung me in the past, areaBuffer needs to be 5 times bigger than the number of max number of points, take a look at

http://amiga.sourceforge.net/amigade...&action=Search

So that could give you the trashed trailer. You can confirm this by looking at the memory directly after the areaBuffer where MemLib will put

"\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB"

If you keep watching that address in CodeProbe, you should see it change.


Quote:
I'll use Memlib in the future as it beats my previous method of trying to remember what the chip and fast were before I ran the app.
It's saved a lot of my hair! :-)

billy
billyfish is offline   Reply With Quote
Reply

Bookmarks

Tags
causing , find , guru

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump