Forum > General

error creating thread.

<< < (2/4) > >>

alpine:

--- Quote from: liewald on February 01, 2023, 12:13:30 pm ---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:
*snip*

--- End quote ---
You didn't provide the source line where the constructor was invoked.
Is it looks as a trivial instance construction, e.g.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  T := TScriptThread.Create(id, script, susp); Or it is something different?

I don't see other reason for SIGSEGV except a bad Self pointer at this point.

liewald:
OK it's invoked in an array of tscriptthread like this

 processarray := tscriptthread.Create(i,scommand,false); 

but the same error happened when I used a simple call

testthread := tscriptthread.Create(i,scommand,false); 

liewald:
the full thing looks like this

procedure tsrmain.launchprocess(i:integer) ;

  var scriptname : string;
      scommand,sresult : ansistring;
      res : boolean;
      scriptprocess : tasyncprocess;

begin
  if nextpointer < scriptlist.count then
  begin
  scriptname := scriptlist.items[nextpointer];
  scommand := scriptdirectory.Directory + '/' + scriptname;
  try
  processarray := tscriptthread.Create(i,scommand,false);
  if assigned(processarray.fatalexception) then
  raise processarray.fatalexception;
  nextpointer := nextpointer + 1;
 //  testthread := tscriptthread.Create(i,scommand,false);
 except
  On E: Exception do
  srmain.Memo1.lines.Append('Thread Failure');
  end;
  end;   

alpine:
Could you please put the source into code tags, otherwise the array subscriptions are lost and everything is italicized.

Zvoni:

--- Quote from: liewald on February 01, 2023, 12:27:47 pm ---yup uses cthreads, cmem and heaptrace

--- End quote ---
OUCH!!
Never ever add HeapTrc to uses-clause! --> https://wiki.freepascal.org/heaptrc

and there is also some issue with using heaptrc and cmem at the same time, since heaptrc has/it's its own memory-manager, but for the life of me i can't find the Wiki-Entry

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version