Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,080
    • Issues 2,080
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 7
    • Merge requests 7
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • Lazarus
  • LazarusLazarus
  • Issues
  • #9597
Closed
Open
Created Sep 04, 2007 by FPC Admin account@fpc_adminOwner

Application crash when creating a thread in FreeBSD

Original Reporter info from Mantis: papelhigienico
  • Reporter name: Fabio Luis Girardi

Description:

In my application, i'm creating a thread (using TThread class). When my application call the thread constructor, it crash!

Steps to reproduce:

Create a simple thread in freebsd, source are in additional information

Additional information:

Error when creating thread on FreeBSD 6.1 with Lazarus 0.9.23 and FPC 2.0.4

Error Description: "Project raised exception class 'RunError(232)'"

Dialog: Execution Paused
        Address : $0806cd80
        Procedure: SYSTEM_NOTHREADERROR
        File:

Dialog: Execution Stopped

---------------------------------------------------------------------
---------------------------------------------------------------------
Unit1.pas - Form1
---------------------------------------------------------------------
---------------------------------------------------------------------

unit unit1;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, unit2;

type

{ TForm1 }

  TForm1 = class(TForm)
    HMICheckBox1: THMICheckBox;
    HMIEdit1: THMIEdit;
    HMIEdit2: THMIEdit;
    HMILabel1: THMILabel;
    HMIRadioButton1: THMIRadioButton;
    procedure FormCreate(Sender: TObject);
  private
    teste:TMyTestThread;
  public

  end; 

var
  Form1: TForm1; 

implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  teste:=TMyTestThread.Create(false);
end;

initialization
  {$I unit1.lrs}

end.
---------------------------------------------------------------------
---------------------------------------------------------------------
Unit2.pas - Thread
---------------------------------------------------------------------
---------------------------------------------------------------------
unit Unit2; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

type
  TMyTestThread = class(TThread)
  private
    x:Integer;
    procedure ChangeCaption;
  protected
    procedure Execute; override;
  end;

implementation

uses unit1;

procedure TMyTestThread.ChangeCaption;
begin
  Form1.Caption := IntToStr(x);
end;

procedure TMyTestThread.Execute;
begin
  while not Terminated do begin
    inc(x);
    Synchronize(@ChangeCaption);
  end;
end;

end.

Mantis conversion info:

  • Mantis ID: 9597
  • OS: FreeBSD
  • OS Build: 6.1
  • Platform: i386
  • Monitored by: » thierrybo (thierrybo), » lucky62 (lucky62)
Assignee
Assign to
Time tracking