Segmenation fault in rt_finalize2 when using std.stdio with shared libraries

Harm via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sun Oct 19 04:55:26 PDT 2014


On Saturday, 18 October 2014 at 22:36:07 UTC, David Nadlinger 
wrote:
> On Saturday, 18 October 2014 at 19:24:23 UTC, Harm wrote:
>> I've build ldc from the master branch in github using 
>> -DBUILD_SHARED_LIBS=on using Xubuntu 14.04. Am I missing some 
>> flags or is the shared library support not complete yet?
>
> This use case should actually be covered by the druntime shared 
> library tests: 
> https://github.com/ldc-developers/druntime/tree/e383a9bbdcd05cc6c315554df25658d6487c7176/test/shared/src
>
> Thus this aspect of runtime loading should generally work on 
> Linux x86_64, unless of course there is some kind of build 
> system regression causing the tests not to be run on Travis CI.
>
> Maybe you could try experimenting with the druntime tests to 
> see what might cause the issue? Use "ctest -R 
> druntime-test-shared --verbose" to get the initial build 
> command.
>
> David

The tests run fine without problems. Somehow when I want to use 
libphobos2-ldc things start to crash. Just adding a 
-L/path/to/libphobos2-ldc.so to DFLAGS in the test makefile 
doesn't affect the test result. Using std.stdio does though 
(getting the segmentation fault again). I've been trying (kind of 
recklessly) trying several mutations to the wiki code and the 
tests without success.


More information about the digitalmars-d-ldc mailing list