Forum > General

error creating thread.

(1/4) > >>

liewald:
OS Opensuse 15.4, Lazarus version 2.3.0, FPC ver 3.2.2


I'm having problems creating threads and getting this error

"Project SR raised exception class 'External: SIGSEGV'.

 At address 4482BC"

the program has been successfully running for the past 3-4 years but I had to upgrade the machine due to support for the OS (OS 15.1) being discontinued. On recompiling the program the program crashes on the thread creation call. there's nothing special in the thread constructor and the original code that worked hasn't changed.

here's the constructor that fails :

constructor TScriptThread.Create(processorid:integer;script:string;CreateSuspended:boolean);
  begin
    scriptprocessor := processorID;
    Scriptname := script;
    FreeOnTerminate := True;
   inherited Create(CreateSuspended);
end;

Any ideas anyone?

Dave

alpine:
You should provide more information about.

How it was constructed (source) at the first place? 
What are scriptprocessor and Scriptname ? Fields? Simple properties or they have setters? inherited Create was called last - is TScriptThread a direct descendant of TThread?

liewald:
I may have mentioned this has actually been working for 3-4 years prior to the system rebuild without an issue but to answer your queries:

scriptprocessor is an integer to keep track of the cpu that the thread is attached to in the control array
scriptname  is a string holding the executable in this case a batch file

tscriptthread is a tthread descendant

 TScriptThread = class(TThread)
    private
    scriptprocessor:integer;
    scriptname:string;
    fStatusText : string;
    scriptstart: boolean;
    procedure ShowStatus;
    protected
      procedure Execute override;
    public
      Constructor Create(processorID:integer;script:string;Createsuspended:boolean);
    end;       

the crash is immediately on the create call

Dave

tetrastes:
Check if uses cthreads in .lpr lost somehow.

liewald:
yup uses cthreads, cmem and heaptrace

Navigation

[0] Message Index

[#] Next page

Go to full version