Software Failure/Guru "8000 0020" on program exit
I'm getting this error on program exit and I am not completely sure what it is or how it happened.
I am taking a wild guess here that it has something to do with me not doing what I supposedly should do on exit: "cleaning" the memory. If I hit "suspend" on the error, the memory I used is visibly gone from the system. I have loaded one bank of info into memory, and after I started doing that, this error began to occur, hence my suspicion. I tried to do FreeBank #BANK before "End", it says it cannot free memory. I tried to do FreeMem Bank(#BANK), BankSize(#BANK), also fail. Is this error related to this and if so, how exactly am I supposed to cleanly exit the program? Is there even any functions in Blitz to see how much RAM I have free? While we're talking this stuff, can you see the size of a file before you load it? |
Is the program actually exiting? Or crashing just prior to exiting? Try using NPrints before and after any commands at the end of the program to see what might be snagging it. If it's just the End statement, it's possible that something's buggy with the Bank library, but I've used Bank before and left it to be freed by the End statement with no issues.
There are some commands for checking free RAM in some 3rd party libraries - ChipFree, FastFree and LargestFree will return the size of the largest free block in the relevant categories, and that's a library that's included with most Blitz setups (RISystemLib). But it's also possible to check whether a bank has been successfully allocated or not before using it - if there's not enough RAM, it will have the address set to 0 so using the Bank() function to check it before you will tell you if it's been allocated successfully or not. You can get the filesize using the LOF function (Length of File) after you've opened a file with ReadFile. There are 3rd party libraries that also contain file size commands, but IIRC they're used to examine a file as part of a directory listing so you'd need to traverse the directory to get the filesize that way. It's doable, but opening the file, getting the size and closing it is probably the most straightforward method without using the dos.library Examine calls directly. |
Quote:
Quote:
I have that UBB2.1 Plus pack from http://ubb.plus , if that helps Quote:
Quote:
Quote:
Thanks for your help, as usual, Daedalus! |
Quote:
Quote:
Quote:
Quote:
Quote:
You probably don't really need to worry about adding libraries - the Ultimate Blitz setup should already include all the standard ones. Adding custom libraries is fiddly and can result in your source being unreadable by another installation of Blitz so it's best not to do that unless you need to. It was different back in the day when you started off with the core libs and added as new ones were released... |
Quote:
this is weird though, now, it is not giving me the error when I run it from Blitz, the Debugger just seems to "end" but the CLI window remains open and it never returns to SuperTED, no error, machine locked there :confused:confused It definitely has to do with the file loaded, because if I skip the file loading, I get no errors. Also is there a way for the debugger not to autoquit? Quote:
Quote:
I'm gonna try to see if I have those libraries because I'd like to display how much free RAM I have. But I am still clueless as to why I am getting the 8000 0020 error. Is there really nothing I should do before end to exit cleanly? |
I get EXACTLY the same issue after creating an exe in AmiBlitz 3 - runs fine through Blitz but as soon as I hit an end command to end the software while running independantly - instant Guru
|
Do you ever get stack related issues in blitz?
|
Hi!
I don't know Blitz Basic but you could try using StackAttack or StackWatch or similar programs to see if the stack is really involved in these problems? Good luck! :) |
All times are GMT +2. The time now is 06:05. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.