Recent

Author Topic: Undefined error 8?  (Read 1037 times)

HotShoe

  • New Member
  • *
  • Posts: 36
Undefined error 8?
« on: May 25, 2024, 08:42:44 pm »
I decided to port an editor over from windows to linux. It has run on windows for years, and it compiles fine in linux lazarus. When run though, I get this:

Project ted raised exception class 'External: Unknown exception code 8'.

 In file 'laztracer.pas' at line 58

and here is line 58:

Code: Pascal  [Select][+][-]
  1. {$ifndef HASAMIGA} // On Amiga Division by 0 is not catchable, just crash
  2.   if (length(Msg) div (length(Msg) div 10000))=0 then ;
  3.   {$endif}

google is no help and stepping through the code has yet to point to the problem. I don't know where a division by 0 is coming from and this is no help. Is there a way to get the routine that sent the message to laztracer?

Can anyone give me a clue as to what error 8 is so I have some idea where I might look for the problem, or is error 8 a division by zero?

This is on a laptop system running Kubuntu 24.04, a rysen 7 processor with 32G memory, and the latest version of stable lazarus and fpc installed via fpcupdeluxe.

The program is a multi file text editor that was originally based on a demo I found years ago and adapted to my needs over time. It is attached to this post.

I put this in General simply because I didn't know where to stick it. Feel free to move it if needed.

Thanks,
Jem

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10665
  • Debugger - SynEdit - and more
    • wiki
Re: Undefined error 8?
« Reply #1 on: May 25, 2024, 09:04:36 pm »
This line is an intentional crash. Lines like this where used for exiting the program with an exception, when gdb (which was used as debugger) was not able to catch Pascal exceptions.

So basically it is meant to be called if code detects an error it can't handle, and then the debugger stops there, and you can look at the callstack (in the debugger), and see which code called this line.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10665
  • Debugger - SynEdit - and more
    • wiki
Re: Undefined error 8?
« Reply #2 on: May 25, 2024, 09:15:00 pm »
On my Linux
Code: Text  [Select][+][-]
  1. errno 8
  2. ENOEXEC 8 Exec format error
  3.  

And googling suggests it refers to trying to execute a malformed shell script.

HotShoe

  • New Member
  • *
  • Posts: 36
Re: Undefined error 8?
« Reply #3 on: May 25, 2024, 11:10:42 pm »
Thanks Martin. Well it wasn't a script or shell error, but I am a bit embarrassed. I had changed a couple of fields in the saved preferences file prefs.cfg, and that was causing it to choke. It's fixed and running as expected now. All I had to do was to delete the file on disk and let ted create a new one... simple, but tough to find.

Thanks for your help.

--- Jem

 

TinyPortal © 2005-2018