[fpc-devel] threads vs widestringmanager / crash

Michael Van Canneyt michael at freepascal.org
Mon Dec 19 09:51:29 CET 2022



On Mon, 19 Dec 2022, Ondrej Pokorny via fpc-devel wrote:

> On 19.12.2022 07:42, Sven Barth via fpc-devel wrote:
>> The RTL assumes that it does not have to deal with threads during the 
>> initialization of the System unit. So even if the symptom of the crash 
>> is fixed in that location it isn't said that something else might 
>> crash or that in the future code might be added that crashes...
>
> Is it possible to acknowledge that the current RTLs assumption is wrong 
> and it has to deal with threads during the System initialization? 
> (Because obviously the assumption is wrong, otherwise there was no crash.)

I think the assumption is definitely correct:
some subsystems needs to be initialized.

Since there are multiple systems to initialize, there will always be moments
in code where one system is initialized and the other is not 
All code should be prepared to deal with that.

This counts double for systems where initialization is delegated to other
units: strings/threads on unix, for example

If you can prepare a simple sample program that shows the problem, I can try
to look into it. Maybe a fresh pair of eyes sees more than one pair of eyes?

Michael.


More information about the fpc-devel mailing list