[fpc-devel] Lazarus Apache module crashes during concurrent requests

Michael Van Canneyt michael at freepascal.org
Wed Sep 24 13:02:46 CEST 2008



On Wed, 24 Sep 2008, Jonas Maebe wrote:

> 
> On 24 Sep 2008, at 12:35, Michael Van Canneyt wrote:
> 
> >This is a known problem; the heap manager does not function correctly in a
> >DLL when an external program (apache, in this case) creates new threads.
> 
> The heap manager is simply not thread safe until the FPC threading system has
> been initialised (by starting a thread).

It is not that simple. The heap manager cannot handle situations where
threads have been started by code that is not aware of the FPC threading
mechanisms - such as apache. I have done some changes for this, but they 
are not sufficient. PThreads has no mechanisms for dealing with this
situation. Windows does (using the DLL_THREAD_ATTACH message).

Michael.



More information about the fpc-devel mailing list