Structured Exception Handling in FBSL

(Vital Data and New Beta Release Info)

Structured Exception Handling in FBSL

Unread postby Mike Lobanovsky » Tue May 13, 2014 2:08 am

Hello friends,

FBSL v3.5RC2 now features genuine Structured Exception Handling to intercept integer division by zero and invalid memory pointers. These are run-time errors that couldn't be intercepted in FBSL and used to cause unhandled exceptions in the past. They would cause severe crashes in your programs with system notifications like "memory can't be read/written" or "division by zero".

Now these run-time errors are intercepted and reported by FBSL in an ordinary crashless manner. The error code for division by zero is &H60 ("integer division by zero"), and for an invalid memory pointer, &H7B ("access violation"). These errors can also be trapped and processed at run time by FBSL's On Error GoTo err_trap or On Error Resume Next error handlers.

Access violation trapping covers direct memory access with such functions as Peek(), Poke(), and ReallocPtr() (the other FBSL memory access functions safely ignore invalid memory addresses). It also covers FBSL functions that call memory pointers for execution such as CallWindowProc(), CallAbsolute(), FunCall(), and ApiCall() and all sorts of its derivatives.

Attached below please find an archive with a SEH-protected Fbsl.exe v3.5RC2. Test it with your scripts and report here any specific code that would still cause FBSL to crash so that I could add more SEH handlers to eliminate unhadled exceptions in FBSL completely.

[EDIT] I'm sorry for having uploaded a 7-zip archive initially instead of a zip (the former compresses much much better). Here follows its more usual counterpart. I would still recommend you to download and install 7-zip if you haven't yet done so. 7-zip also supports zip compression as well as a lot of archive formats widely used in the open-source domain.

Thank you in advance,

FbslSEH.7z
(236.81 KiB) Downloaded 175 times

FbslSEH.zip
(291.73 KiB) Downloaded 181 times
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1823
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Structured Exception Handling in FBSL

Unread postby bugmagnet » Thu May 15, 2014 10:30 am

Wonderful idea, Mike! As soon as I have some time, I'll have a look.

Thanks very much,
Bruce.
User avatar
bugmagnet
FBSL geek
FBSL geek
 
Posts: 174
Joined: Sat Apr 06, 2013 5:58 am
Location: Fremantle WA, Australia


Return to FBSL v3 News

Who is online

Users browsing this forum: No registered users and 1 guest

cron