[fpc-pascal]executing different gtk applications from FPC

Thomas Schatzl tom_at_work at yline.com
Fri Jul 20 10:43:33 CEST 2001

From: "Marco van de Voort" <marcov at stack.nl>
Subject: Re: [fpc-pascal]executing different gtk applications from FPC

> > [FPC and thread safety]
> Threadsafeness of FPC is being worked on by Florian in the development
> branch.
> I have the same problem with the Delphi network suite ICS. It compiles,
> but doesn't work properly, probably due to threading issues.
> Did you perform those tests with a recent 1.1 snapshot?

I tried with today's snapshot again.

What is so strange about my problem is that it only screws up the exit code
of the program. While multiple threads are running it works fine due to some
precautions (e.g. no use of ansistrings, classes). But during the program
exit (care was taken that no thread is active at that time) after the last
instruction of the pascal main program it hogs the cpu for a few seconds and
then exits without executing the used units' finalization procedures.
According to gdb the program triggers a SIGSEGV somewhere - but no error /
exception message is written to the console (e.g. the error handlers are not
called; no messagebox from Windoze popping up), the program simply exits at
the point the segfault occurs.
Both threads have been tested to work fine when run seperate. All access to
shared global variables is protected by critical sections (using Win32
native calls of course). Likely still some ansistring stuff is used since it
requires parts of the sysutils unit.

FYI, it's a simple telnet client w/o terminal emulation (otoh it's only 7k
in source) for demonstration purposes.


More information about the fpc-pascal mailing list