[6.30 X64 C-Backend] OnErrorCall()

All bugs related to new C backend
GPI
PureBasic Expert
PureBasic Expert
Posts: 1397
Joined: Fri Apr 25, 2003 6:41 pm

[6.30 X64 C-Backend] OnErrorCall()

Post 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.
User_Russian
Addict
Addict
Posts: 1619
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: [6.30 X64 C-Backend] OnErrorCall()

Post by User_Russian »

This bug is many years old viewtopic.php?t=83498
escape75
User
User
Posts: 24
Joined: Fri Jan 09, 2026 7:52 am

Re: [6.30 X64 C-Backend] OnErrorCall()

Post by escape75 »

Seems to work on 6.21 with debugger disabled ...
GPI
PureBasic Expert
PureBasic Expert
Posts: 1397
Joined: Fri Apr 25, 2003 6:41 pm

Re: [6.30 X64 C-Backend] OnErrorCall()

Post by GPI »

It seems, that the Debugger itself can't catch any crashes.
Little John
Addict
Addict
Posts: 4833
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [6.30 X64 C-Backend] OnErrorCall()

Post 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.
User_Russian
Addict
Addict
Posts: 1619
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: [6.30 X64 C-Backend] OnErrorCall()

Post 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.
User avatar
ChrisR
Addict
Addict
Posts: 1551
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: [6.30 X64 C-Backend] OnErrorCall()

Post 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
Little John
Addict
Addict
Posts: 4833
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [6.30 X64 C-Backend] OnErrorCall()

Post 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 :?:
User avatar
ChrisR
Addict
Addict
Posts: 1551
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: [6.30 X64 C-Backend] OnErrorCall()

Post 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!
Post Reply