[fpc-pascal] writeln: FPC runtime race conditions in external C threads

Alexander Grau alex at grauonline.de
Mon Jul 12 22:46:24 CEST 2010


Am 12.07.2010 um 22:31 schrieb Jonas Maebe:

> Alexander Grau wrote on Mon, 12 Jul 2010:
>
>> Am 12.07.2010 um 18:17 schrieb Jonas Maebe:
>>
>>> On 12 Jul 2010, at 13:24, Michael Van Canneyt wrote:
>>>
>>>> Basically, any heap memory access and standard pascal I/O are  
>>>> forbidden in
>>>> threads started outside FPC, because the necessary thread  
>>>> structures are not
>>>> initialized correctly.
>>>
>>> I think that I've finally found a way to resolve this properly in  
>>> r15557.
>>
>> This doesn't seem to work fully yet-  let me try to create a simple  
>> test for reproducing my crash ;-) ...
>
> I forgot to mention: before this works, you have to create at least  
> one thread using the FPC RTL in order to initialise the threading  
> subsystem. It can be terminated/freed immediately, see the test  
> program that was committed together with the fix for an example.
>

That did the trick!  Seems to work -  I'm really curious how this  
works, since I assume there's probably no control over how the  
external C thread is created and so no chance to initialize something  
for the FPC runtime ...



More information about the fpc-pascal mailing list