std.net.curl and ldc v1.0.0+

Suliman via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Sep 27 23:23:48 PDT 2016


On Monday, 26 September 2016 at 18:52:04 UTC, Joseph Rushton 
Wakeling wrote:
> Hello all,
>
> I've run into a nasty little issue with `std.net.curl` and ldc 
> v1.0.0.  If I build v1.0.0 freshly from source, and then use it 
> to compile the following tiny program:
>
> ////////////////////////////////////////////////
>
> void main ()
> {
>     import std.net.curl : get;
>     auto website = "http://dlang.org/".get;
> }
>
> ////////////////////////////////////////////////
>
> ... the program compiles correctly, but when I run it, I get a 
> segfault.  A stacktrace is given here:
> https://forum.dlang.org/post/cxfrbiwccxdnmrkuufwe@forum.dlang.org
>
> This doesn't however occur if I build my program with the 
> pre-built ldc v1.0.0 downloadable from GitHub.
>
> I'm guessing this is in some way related to the fact that as of 
> ldc v1.0.0, libcurl.so is dynamically loaded at runtime rather 
> than being linked to phobos at build time.  So this makes me 
> wonder: is there something extra required when building LDC 
> that I might be missing?  I note that dmd now automatically 
> links against libdl in order to support dynamic loading of 
> libraries:
> https://github.com/dlang/dmd/commit/541d9b61cd1792535cd4c99c418b42273bb9baa5
>
> ... so could I be missing something similar when building LDC?
>
> I note that if I manually link in -ldl when compiling my 
> program above, it makes no difference to the segfault.
>
> Can anyone advise what could be wrong?
>
> Thanks & best wishes,
>
>     -- Joe

I suggest you to try https://github.com/ikod/dlang-requests it's 
much better than curl


More information about the digitalmars-d-ldc mailing list