Page 1 of 1
[6.30 X64 C-Backend] OnErrorCall()
Posted: Thu Jan 15, 2026 7:16 pm
by GPI
Code: Select all
Procedure ErrorHandler()
MessageRequester("OnError Test", "Der folgende Fehler trat auf: " + ErrorMessage())
EndProcedure
MessageRequester("OnError Test", "Test starten")
OnErrorCall(@ErrorHandler())
PokeS(10, "Hello World") ; verursacht einen #PB_OnError_InvalidMemory Fehler
MessageRequester("OnError Test", "Dies sollte niemals angezeigt werden")
Simple Example from the Manual.
it crashes before ErrorHandle ist called on X64-C-Backend without any message.
Works without problems with X86-C-Backend.
Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Thu Jan 15, 2026 8:05 pm
by User_Russian
This bug is many years old
viewtopic.php?t=83498
Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Sun Jan 25, 2026 7:07 am
by escape75
Seems to work on 6.21 with debugger disabled ...
Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Sun Jan 25, 2026 9:47 am
by GPI
It seems, that the Debugger itself can't catch any crashes.
Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Sun Jan 25, 2026 9:55 am
by Little John
GPI wrote: Thu Jan 15, 2026 7:16 pm
it crashes before ErrorHandle ist called on X64-C-Backend without any message.
Confirmed (with Debugger disabled).
Works also without problems when using the x64 ASM-backend.
Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Mon Jan 26, 2026 11:46 am
by User_Russian
Little John wrote: Sun Jan 25, 2026 9:55 amWorks also without problems when using the x64 ASM-backend.
Doesn't work with
C backend.
Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Mon Jan 26, 2026 11:51 am
by ChrisR
It seems to work well here on Win11 x64, without the debugger and with both x86/x64 ASM and C compilers (optimized or not).
Code: Select all
CompilerIf #PB_Compiler_Debugger = #False
OnErrorCall(@ErrorHandler())
CompilerEndIf
Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Mon Jan 26, 2026 12:05 pm
by Little John
User_Russian wrote: Mon Jan 26, 2026 11:46 am
Little John wrote: Sun Jan 25, 2026 9:55 amWorks also without problems when using the x64 ASM-backend.
Doesn't work with
C backend.
That was was written here before. With C backend x64, to be precise.
So what

Re: [6.30 X64 C-Backend] OnErrorCall()
Posted: Mon Jan 26, 2026 12:30 pm
by ChrisR
ChrisR wrote: Mon Jan 26, 2026 11:51 am
It seems to work well here on Win11 x64, without the debugger and with both x86/x64 ASM and C compilers (optimized or not).
Code: Select all
CompilerIf #PB_Compiler_Debugger = #False
OnErrorCall(@ErrorHandler())
CompilerEndIf
Hmm, strange!, it seems to depend on the error, I get it
here.
But using GPI's example, or with a division by 0, ErrorHandler() is not called with the C Backend and it does not crash, it should. No issues with the ASM compiler!