I have 'On error goto __' also tried with TRY CATCH Implementation from Cherry but my app crashes whenever it violates memory access.
Actually nothing to hide about, I am making a Library in FB which contains many exported functions one of which is an attempt to port 'C' language's VMDetect to FB and that's where the problem occurs it violates memory access and results in the app being crashed. Is there anyway to prevent the crash or do I have to abandon this attempt ?
Thanks....
How to survive / prevent a memory access violation crash ?
Hey K128, check out GDB which is a debugger. Perhaps you'll be able to gain some insight by crashing the program inside the debugger.
http://www.freebasic.net/wiki/wikka.php ... gerRunning
http://www.freebasic.net/wiki/wikka.php ... gerRunning
Why not try Fbdebugger ;-)
There is a possibility to change some values on fly in case of crash.
http://www.freebasic.net/forum/viewtopic.php?t=13935
There is a possibility to change some values on fly in case of crash.
http://www.freebasic.net/forum/viewtopic.php?t=13935
Thanks @cha0s And @SARG for your reply.
I will surely try the debuggers too but I have a deep feeling that debugging wont help, because VMDetect makes an intentional memory access violation and Exception Handling is intentionally used to catch any exception that may occur if it is not a Virtual Machine. So, I think debugging wont help me much in this. Is there any method in FB to catch memory access violation error(s) and continue the program excution?
Thanks...
I will surely try the debuggers too but I have a deep feeling that debugging wont help, because VMDetect makes an intentional memory access violation and Exception Handling is intentionally used to catch any exception that may occur if it is not a Virtual Machine. So, I think debugging wont help me much in this. Is there any method in FB to catch memory access violation error(s) and continue the program excution?
Thanks...
IPC - inter process comunication - "modularize" your program(s) ...K128 wrote:Thanks @cha0s And @SARG for your reply.
I will surely try the debuggers too but I have a deep feeling that debugging wont help, because VMDetect makes an intentional memory access violation and Exception Handling is intentionally used to catch any exception that may occur if it is not a Virtual Machine. So, I think debugging wont help me much in this. Is there any method in FB to catch memory access violation error(s) and continue the program excution?
Thanks...
(Make from one exe more exes each inter-commed with each other ...)
when one app crashes ... the main module is still alive and it can re-load that module ...
You can try to see how [airport/train/life support] control applications are made ...
(in dos you can hook a cwsdpmi error handler ... if you have enough knowledge of PM mode apps ... there's got to be a way too for win32 if you just want to catch the error)
Please show me the code you used to catch the memory access violations with my try...catch implementation, because it simply can't crash this way, unless the exception handler gets messed up (which is unlikely).
You have to use it like this:
You have to use it like this:
Code: Select all
#include "windows.bi"
#include "exceptions.bi"
Try(MyHandler) ' you can use *any* name instead of "MyHandler"
' put the code here which might crash
Catch(MyHandler, Else) ' "Else" will catch all exceptions. If you want to catch access violations only, use "EXCEPTION_ACCESS_VIOLATION" instead.
' if you want, put some code here which gets executed when the other code crashed, otherwise put no code here - but you still have to use a "Catch" block!
EndTry(MyHandler)