Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / (application name) has encountered a problem and needs to close.

Author
Message
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Jun 2010 21:46
These errors are really annoying, and almost impossible to track down since they don't give a line number to work with, or any clue why it's crashing.

Does anyone have a recommendation how to get a DBPro error and line number out of this?

AppName: worldsapartonline.exe AppVer: 1.0.0.0 ModName: unknown
ModVer: 0.0.0.0 Offset: 000003e8

I even went so far as to put a Text line just after the program returns from where I think it's crashing, and it prints that, but the next line is a return, and when I put a Text line there it never makes it. So how does a program have a hard crash on a Return statement?

Can't post the code, it's just over 12,500 lines. Been trying everything in my bag of tricks for a day and a half now.

thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 16th Jun 2010 22:03
it's hard to track bugs like that, usually the modname is the dll but in this case there isn't one... have you tried it on another computer, sometimes things just don't work for me, but when I run it on a different machine, it works...

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Jun 2010 22:13
Still crashes on my Vista laptop, but gives a module name of StackHash_1703.

Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 16th Jun 2010 23:02
the best way to find that kind of bug is commenting everything in the main loop..
then compile, uncomment something, test again..
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Jun 2010 23:30
A quick Google search reveals lots of links for that particular error, but they all have to do with Video Codecs or Data Execution Prevention. I added my game exe to the DEP bypass list, but it still crashes.

Quote: "he best way to find that kind of bug is commenting everything in the main loop..
then compile, uncomment something, test again."


Something like that. I think I'll reverse it though and start commenting the things in the new part of the program. That might narrow it down a little quicker. (possibly not though.. You never can tell..)

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 17th Jun 2010 00:46 Edited at: 17th Jun 2010 00:49
Maybe stack leak if crashing on return statement, possibly plugin? I thought return addresses for gosubs are stored on the stack?

I have had strange problems and crashes before with arrangement of the source code. ie. Have a perfectly working program and then rearrange some code without changing any functionality, and it causes problems. It seems you can have working code and something in the compiler does not like the order of it.
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 17th Jun 2010 01:10 Edited at: 17th Jun 2010 01:11
I'm forced to ask if you have eXtends installed? This is the same kinda crash it caused for me all the time, often randomly and in different places.

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 01:22
Nope. No extends. Sparky's, Matrix1Utils, EZRotate, and DarkNet are I think the only ones I'm putting to use in this.

Quote: "I have had strange problems and crashes before with arrangement of the source code"


I've seen that in other languages too. Very strange stuff.

GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 17th Jun 2010 07:57 Edited at: 17th Jun 2010 07:59
I had soo many problems with this same error. Inserting 500+ debug messages just to narrow it down to an endfunction statement. Usually the problem had something to do with variables in the function having the same name as variables outside, even though both were declared with "local". Sometimes it had nothing to do with variables. One time I fixed it by cutting an entire function to the clipboard, then compiling (and getting an error that the function was missing), pasting the function back and recompiling.

If you track this down to exactly what the problem is, you can make a fortune selling the secret.

Edit: I remember a DLL causing this error too. D3DFunc is currently on version 3.7.1.1 or something, and my compiler HATES it. I reverted to 3.7.1.0 and it fixed some of these problems too.

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 17th Jun 2010 13:28
Quote: "variables in the function having the same name as variables outside"


I have had similar problems with local/globals in gosub. I usually put a `gosub initialize` at the top of programs so that all the setup & defining globals is at the end of the source. (The ONLY gosub before anyone starts! ) Occasionally a global just will not work and it has to go at the top of the source. Took me ages to find and eventually tracking the right variable showed it was never taking any value.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Jun 2010 17:57
@Sladeiw:
I don't see the point in this. Why not just put the globals at the top of your main code?

My signature is NOT a moderator plaything! Stop changing it!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 18:11
I do the same thing actually, only all the variables are in a separate source file, and I use a gosub at the top of the main to run through them.

Mobilus, it just keeps them out of the way, for some reason it looks neater.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Jun 2010 18:17
I separate all my functions by type into source files anyway, with all variables in the main source, and the main loop in its own file.

IMO, THAT looks neater, and makes code reuse simpler! lol

My signature is NOT a moderator plaything! Stop changing it!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 18:43
Fair enough.

It's all a matter of what works for you. As long as the compiler doesn't care..

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Jun 2010 18:51
Indeed. It's all about treating the compiler like a high class call girl! lol

My signature is NOT a moderator plaything! Stop changing it!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 20:16
FOUND IT!

Unbelievable.

I replaced,

dec Players(r).credits, 1000
inc Factories(factory).credits, 1000

with

Players(r).credits = Players(r).credits - 1000
Factories(factory).credits = Factories(factory).credits + 1000

and no more crashes.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Jun 2010 20:21
Can't see why that'd be such a problem

Rawwrr. Sig Fail.
Newcastle is awesome
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 20:24
Me neither. But that's what I tracked it down to.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Jun 2010 20:31
Oh i'm not doubting you I just think it's pretty stupid.

Rawwrr. Sig Fail.
Newcastle is awesome
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 20:44
No argument from me there. Through this process I also upgraded from U7.4 to the current U7.5 beta, so the bug has been there a while. (if it is one)

Either way, I can move along now having wasted 2 days of work on the likes of that..

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 17th Jun 2010 21:31
N1 tracking it down! Guess there could be some issue with inc/dec on typed variables or arrays.

Quote: "I don't see the point in this. Why not just put the globals at the top of your main code?"


It's not just globals, its all the init stuff loading, setting up etc. I just prefer it tucked away at the bottom. If includes worked as other languages I would use them much more heavily, because I do reuse code a lot from previous projects.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 21:51
Quote: "Guess there could be some issue with inc/dec on typed variables or arrays."


There doesn't appear to be an issue...



This runs just fine. It probably has more to do with the size of my app (just over 12,500 lines) and something in those commands caused the stack to have an issue.

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 17th Jun 2010 21:57
Yea I tried it too which worked, but assumed it was due to the size of the source. I should have been a bit clearer As you said I think you start running into some limitations when getting to a certain memory usage, like stack or some other dbpro internal structures. Maybe you should put it in bug reports (if you havent already)
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 22:09
Since I can't duplicate the issue in a small demo, I wasn't going to bother. Especially for such a silly little command that can be easily worked around.

GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 18th Jun 2010 01:26
I think DBPro should keep a larger stack....

Login to post a reply

Server time is: 2026-07-25 08:13:39
Your offset time is: 2026-07-25 08:13:39