Archived

This topic is now archived and is closed to further replies.

the F. errors are solved, sorry for the last name :)

This topic is 5380 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've got a program that runs fine on debugging, but when I run the executable it gives and error and wants to send an error report. This report is full of bullshit exept it tells me the bug is in NTDLL.DLL How do I remove this bug, does it have something to do with the way I compile/link it, the way I use OpenGL or is it some MS bug? Marty [edited by - Marty666 on March 24, 2003 5:39:14 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Marty666
I''ve got a program that runs fine on debugging, but when I run the executable it gives and error and wants to send an error report. This report is full of bullshit exept it tells me the bug is in NTDLL.DLL
How do I remove this bug, does it have something to do with the way I compile/link it, the way I use OpenGL or is it some MS bug?

Marty


There are many people on this forum. Some of them great. Some not so great.

None of them are telepaths, however.

More info please.


--
Sean Timarco Baggaley

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I experienced this same problem, but it was because when I ran the executable, I didn''t have my sound files directory in the same directory as my executable, so the game failed to load the sound files and when it tried to play one, I got an access violation because I tried to reference the NULL pointer I was using for the sound interface (all the pointers were initialized to NULL).

Bottom line, check to make sure your executable and all files it depends on are in the right directories.

Share this post


Link to post
Share on other sites
Hi, sorry for the lack of info...

Here's the story.

I've got a program that loads an object file, calculates the normals and loads a texture. Then it shows a grid (just lines) and the .obj model lighted and textured in the middle.

It takes relitavely a lot of time (about 2/3 sec) to load the program when I hit F5 in MSVC++ 6.0 (I've got visual studio, but I allways just start MSVC++, dunno if it makes a difference). And then it all works fine.

When I start the program with CTRL-F5 or 'execute program' or the ! icon (all the same) or when I start it from my windows explorer, the program wants to send an error report immediately (that means probably when loading the model and texture or when calculating the normals).

If I add breakpoints (F9) the debugger only stops when I debug using F5 and logically not when running the executable, that is CTRL-F5...

I don't know anything about the error because WINXP doesn't show me much. I think it's because I should tell c++ (which i'm pretty new to) to put in my program, to tell windows to reserve more memory for my program. Maybe it's something completely different. It seems to be the compiling that's going wrong if it works while debugging in c++ and doesn't works as .exe.

Hope you can tell me more now, it's all I know myself.

PS: it just loads 'texture.bmp' and 'model.obj' so that should work fine if it's in the same dir, right?

[edited by - Marty666 on March 24, 2003 3:18:29 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
When the error pops up click on DEBUG. VS.net will actually go to the place in code where the error occurs, but earlier versions just give you a memory dumb and the error code. It''s the error code that you need to look at. If it''s an access violation, and you are using ANY kind of pointer at all, be sure that one of these pointers isn''t NULL when it''s trying to be dereferenced.

Other than that I have no clue. Maybe you could post some code.....

Share this post


Link to post
Share on other sites
I think I may know your problem, but I may not. Here is my suggestion:

When MSVC++ makes a program it will send the executable to the debug folder (that is where I am guessing you are running it from). If you data files are not in the same folder as your executable, the program will freak out. What I do is have my program spit out to a ''Output'' folder instead of the ''debug'' folder. Then I put program''s data files in a folder called ''data'' in the ''Output'' folder and write in the file path when i load them (i.e. somefunc.load("data/file.dat"). The problem may be that your data files need to be in the sam directory as your executable, and when you double click the executable in the debug folder, it obviously can''t find the files.

Hope that helps.

-------------------
Realm Games Company

Share this post


Link to post
Share on other sites
quote:
Original post by Marty666
Hi, sorry for the lack of info...

Here''s the story.

I''ve got a program that loads an object file, calculates the normals and loads a texture. Then it shows a grid (just lines) and the .obj model lighted and textured in the middle.

It takes relitavely a lot of time (about 2/3 sec) to load the program when I hit F5 in MSVC++ 6.0 (I''ve got visual studio, but I allways just start MSVC++, dunno if it makes a difference). And then it all works fine.

When I start the program with CTRL-F5 or ''execute program'' or the ! icon (all the same) or when I start it from my windows explorer, the program wants to send an error report immediately (that means probably when loading the model and texture or when calculating the normals).

If I add breakpoints (F9) the debugger only stops when I debug using F5 and logically not when running the executable, that is CTRL-F5...

I don''t know anything about the error because WINXP doesn''t show me much. I think it''s because I should tell c++ (which i''m pretty new to) to put in my program, to tell windows to reserve more memory for my program. Maybe it''s something completely different. It seems to be the compiling that''s going wrong if it works while debugging in c++ and doesn''t works as .exe.

Hope you can tell me more now, it''s all I know myself.

If you''re using VisualStudio, the debugger is your friend. Put in some break points (F9 key), and then step through (F10/F11/Shift+F11) your code, and try to narrow down what it''s puking on. That will help you infinitely more than any error WinXP (and it better be Pro) will give you.

Sometimes VisualStudio sets your paths for you when it launches things. If you then try to launch them from Windows you get weird errors, that''s because your program is confused about it''s path.

If you can find that your code is barfing on a line where you''re loading something, then it''s probably the messed up paths. If it''s something else (random), it could be an error caused by the optimizer in VC++.

You should also try to have it so your program doesn''t crash if it can''t find something, and instead lets the user know (via a dialog/message/log/etc) what exactly happened, and then exit gracefully.

Good luck...debugging can be a b*tch.

- sighuh?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
memory dumb ???

fruedian slip

I meant memory dump.

-AP

Share this post


Link to post
Share on other sites
The compilation is not the problem because the program is compiled even when in debug mode. This is not BASIC; the code is not interpreted.

Anyway what I do is insert code like this:

FILE* File = fopen( "Debug.txt", "ab" );
fprintf( File, "Step 13 done. Trying Step 14...\n\r" );
fclose( File );

...at various parts of the program. Then I check the log. When I find the last line printed, I know the error occured between that print statement and the one that was supposed to be printed next. So then I insert new print statements inbetween, narrowing down the source of the error.

~CGameProgrammer( );
DevImg.net - Post screenshots, comment on others.
Town 3D Engine - A city-rendering 3D engine. Download the demo.

Share this post


Link to post
Share on other sites
I had the same problem, and I think I can tell you where it is.... Check anywhere where you are accesing arrays of any kind, to see if you''re not overstepping the bounds of them... I did this error once, and it ran fine when hitting F5, but running the executable just screwed it up! It seems that MSVC allocates extra memory around these arrays to prevent nasty crashes like those from happening. It''s about the most stupid thing I''ve ever heard

Hope I''ve helped!

Oh, and plz, choose a proper title for your thread the next time, there are many younger people on these forums which should not really be exposed to this kind of language...

Share this post


Link to post
Share on other sites
Hi all,

I don''t use directory names, just "model.obj" so if I put them in the same dir it works, right? also I didn''t even start the executable myself (yes I did, but that isn''t the problem) but I used the ! button that runs the executable for me.
It might be arrays or pointers, but shouldn''t the debugger see if I''m reading out of bound?
When I debug (the .exe) I get an ASM code dump, doesn''t tell me much. The normal debugger doesn''t detect any errors...

thanx anyways... i''ll try to make a log file

Marty

Share this post


Link to post
Share on other sites
sounds like your not initializing a critical variable. In debug these have a bit pattern assigned, in release it''s up to the OS what bit pattern the memory gets, if any, it''s usually all zeros. Hence you get problems with values that are huge in debug build but zero in release. Or, say, for a boolean, true in debug and false in release.

It won''t be an out of bounds array error, a debug build will get heap corruption errors if this is the case.

| - Project-X - my mega project.. getting warmer - | - adDeath - an ad blocker I made - | - email me - |

Share this post


Link to post
Share on other sites
On a side note, please realize that there are children that read these message boards, and thus shouldn''t have to see vulgar words in people''s posts. Once in highschool I was majorly ticked off when our system administrator removed our access to these forums the last time someone decided to curse in their topics. Be considerate, and understand that people are here to help you with programming, but not always your language problems.

Thankyou.

PS: if possible, could you ''edit'' your original post to see if you could change your topic to a more suitable one?

Share this post


Link to post
Share on other sites
It works!

I initialized some pointers and found out that I was using a -1 (for starting counting at 0) in a new command. I removed the -1''s. stupid me, and stupid debugger Normally it tells me in c++ now I had to find out the hard way...

Anyways thanx all!

Marty

PS: Again sorry for the thread name. I got pretty angry after hours of debugging.

Share this post


Link to post
Share on other sites