[Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Wed Oct 20 05:13:36 EDT 2010


> That looks a lot like a double free [...]

there's definitely something about initializing libcurl:
http://curl.haxx.se/libcurl/c/curl_easy_init.html
uses nice phrases like "may be letal in multi-threading"

the documentation of Haskell curl 
http://hackage.haskell.org/packages/archive/curl/1.3.5/doc/html/Network-
Curl.html
just says "withCurlDo should be called once"
while in fact it should be much stronger: "must be called exactly once"?

anyway I temporarily dropped curl (replaced by   system "wget" )
and the erratic behaviour persists. Now it looks like this:

  Electric Fence 2.1 Copyright (C) 1987-1998 Bruce Perens.
[New Thread 0x7fc37b70f6e0 (LWP 7281)]
[New Thread 0x4122a950 (LWP 7284)]
[New Thread 0x4214a950 (LWP 7285)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fc37b70f6e0 (LWP 7281)]
0x00007fc37b715aae in memalign () from /usr/lib/libefence.so.0
(gdb) where
#0  0x00007fc37b715aae in memalign () from /usr/lib/libefence.so.0
#1  0x00007fc37b715c97 in malloc () from /usr/lib/libefence.so.0
#2  0x00007fc37a492a55 in gethostbyname () from /lib/libc.so.6
#3  0x000000000089cc88 in networkzm2zi2zi1zi7_NetworkziBSD_zdwlvl_info 
()
#4  0x0000000000000000 in ?? ()

and indeed, gethostbyname is famous for being non re-entrant.

(packages I use are HTTP, hxt, happstack-server;
and I can't drop all of them ...)





More information about the Haskell-Cafe mailing list