[fpc-devel] FPC shared lib called from C shared lib called from C main program crashes

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Sep 17 18:15:16 CEST 2009


On 17 Sep 2009, at 17:28, Lukas Zeller wrote:

> Now Snow Leopard 10.6.1, but we have a parallel installation on  
> Leopard 10.5.latest that also shows the problem.

Note that on Mac OS X 10.6.x (or rather with Xcode 3.2, which ships  
with Mac OS X 10.6) there is a known linker bug that messes up FPC  
libraries. See http://bugs.freepascal.org/view.php?id=14471 for the  
details.

> Ok. I assume the RTL initialisation and the library initialisation  
> block are BOTH run as part of the system level shared lib  
> initialisation (DLL main entry point), in that order, correct?

It depends on the OS:
* on Mac OS X, the shared library entry point is called, which then  
calls the RTL initialisation routine before executing any code you may  
have added
* on Linux, some assembler RTL code is called that sets up various  
things, which in turn calls the library entry point and things proceed  
as on Mac OS X.

> I could. Actually it also happens without the in-between C shlib. A  
> C main with a FPC shlib is sufficient.
>
> I have a 10 lines sample program that shows the effect nicely. As a  
> FPC community newbie - where should I post the sample and the bug  
> report to? Not to this list, I assume...

The bug reporting form is at http://bugs.freepascal.org. You can post  
things to the mailing list, but if not immediately acted upon they  
tend to be forgotten. So using the website is always better.


Jonas



More information about the fpc-devel mailing list