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 / Code once working causes crash

Author
Message
mindsclay
14
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jul 2013 17:44
This was working fine ealier this morning then suddenly it started crashing.


The bit after "rem Empty CHECKLIST" is the culprit. I remove it, no crash. Put it back in crash. I do not understand how it could woprk one moment then start crashing.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
mindsclay
14
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jul 2013 18:00
But this is working okay:



www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 5th Jul 2013 18:01 Edited at: 5th Jul 2013 18:01
Are you using Windows 7 ? If so you have to make sure you run in admin mode. Why ? Because the root of the drive.. namely c:\ .. is a folder you have to have permissions to write too.

That would be my first guess.

EDIT UPDATE : Sorry, I didn't see your second message until after I finished mine.

https://soundcloud.com/toraktu
pdq
19
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 5th Jul 2013 18:46
Both codes are working fine for me including the EMPTY CHECKLIST. Using Win7

I know what you mean about code working fine at first and then crashes next time without even changing it. I had a similar issue using some of the dark extends plugin file commands a while back.
mindsclay
14
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jul 2013 23:23
The first snippet works for me if I get rid of the CLOSE FILE and the IF statement. That doesn't make sense. So this code works but I am not closing the file nor do I check for the existing file, so basically not working how I need it to work.


www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 5th Jul 2013 23:39
Do you get an error message? Or does it simply crash without telling you anything?

One thing I used to run into every now and then is that write string has problems with long strings which resulted in crashes. But I'm not sure if that problem still exists with more current versions of the DBP compiler. Which version are you using?

Just to make sure that's not the problem you could quickly exchange write string 1, ... with a call of this function:



I haven't tested it, but I think it should do just what write string does minus the hypothetical crash.

mindsclay
14
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jul 2013 23:42
I changed the variable SaveList$ to SaveIT$ and it works on my development computer. I have no reason why. But it still won't work on the test computer.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
mindsclay
14
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jul 2013 23:45 Edited at: 5th Jul 2013 23:47
This is too bizarre! I tried the exe on the second computer again... and this time it worked. No changes but merely copied the exe from one computer to the other. Maybe I didn't actually replace the exe the first time.

I hope I don't see any more of these anomalies...

When I say "worked" I mean it didn't crash. However it didn't write the file.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Jul 2013 00:11
Quote: "When I say "worked" I mean it didn't crash. However it didn't write the file."


That's what happens when I run your original snippet. I'm using W7. Works fine if I use a location in My Documents. Sounds like a W7 security issue to me - but then it should fail or work consistently all the time.

Did you compile the program using different DBPro updates on the different machines?
mindsclay
14
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 6th Jul 2013 00:41 Edited at: 6th Jul 2013 00:47
I am compile on the development computer then copied the .exe to the second computer.

It is intermittent. The file was written once(I kept running the .exe over and over). But it crashes most of the time, some of the time it doesn't crash but also doesn't write the file. 1 out of 30 not too bad.

BTW, Windows 7 Pro here. I hear people mention "administrator" often, but I am always the administrator on my computers. There is merely something weird about that particular string of characters. Because I am using the exact same code elsewhere but with a different filename. And yes, I tried change variable names and filenames.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 6th Jul 2013 02:00 Edited at: 6th Jul 2013 02:05
Quote: "BTW, Windows 7 Pro here. I hear people mention "administrator" often, but I am always the administrator on my computers."


That is not what I was referring too when I said Run in Admin Mode. Even if your in Administrator session, you STILL must right click the EXE and CHOOSE Run as Administrator. This sets the permissions. You do this to DarkBasic Pro and it will override ANY permission systems in place, and thus, you will not get errors, most of the time.

I run Win 7 Ultimate, and I'm running as admin, but if I didn't CHOOSE "Run as Administrator" then DBPro would give me permission errors. To fix this, you open your DarkBasic Pro ICON properties and then choose compatibility and check mark "Run This Program As Administrator". 9 times out of 10, this fixes ALL problems with DarkBasic Pro. The cool part is, since I set it to ALWAYS run as admin, I don't have to right click and choose "Run as Admin" anymore.

I just tried your code on your very first post. It works fine on my Windows 7 machine.

https://soundcloud.com/toraktu
mindsclay
14
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 6th Jul 2013 02:12 Edited at: 6th Jul 2013 02:13
I have many times used the "right-click and Choose Run as Administrator" and I never see a difference in operation of any program. I am not saying it doesn't help for some software, I merely never experienced any difference. (And I tried that)

The residual issue is that the same code (from my original submission) works in other areas of my project without doing anything special except change the filename and variable names (as I mentioned earlier). My second code snippet above has been working this whole time without any crash or lack of file writing to the exact same drive location as the code that crashes. So I cannot see how file permissions is the culprit unless Windows decides to pick on certain filenames.

I guess we could chalk this up to code gremlins or code gnomes?

I am not going to use the problem code anyway as all my other code works. I don't need any unecessary stress.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 6th Jul 2013 04:13
I recently installed some windows updates on windows 8 and my game would just crash at launch. I wasn't writing to any weird location like this. The game code just started to crash on launch without changes. My windows 7 laptop would run the same executable without issue. I skirted the problem by setting the game to run in Windows 7 compatibility mode on the Windows 8 computer. Suddenly the problem was gone.

Login to post a reply

Server time is: 2026-07-07 06:22:53
Your offset time is: 2026-07-07 06:22:53