[Libguestfs] Ocaml and pthread_atfork()

Richard W.M. Jones rjones at redhat.com
Thu May 3 07:52:25 UTC 2012


On Thu, May 03, 2012 at 02:00:27PM +1000, Tony Breeds wrote:
> Hi All,
> 	Firstly I apologize if this is noise.  I elected to not file a
> bugzilla as the problem seems to be powerpc specific and with the limited
> resources for Fedora developers it would seem unfair.
> 
> I was recently trying to build a "current" libguestfs from the f16
> branch[1].  During the build I hit:
> 
> (extracted from rpmbuild)
> 
> [tony at sneetch ~]$ bash -x  tmp/ocaml-test.sh 
> + cd rpmbuild/BUILD/libguestfs-1.16.9/ocaml/
> + LD_LIBRARY_PATH=../src/.libs
> + ocamlfind ocamlc -g -warn-error CDEFLMPSUVYZX -I . -package unix,threads -thread -linkpkg mlguestfs.cma t/guestfs_070_threads.cmo -o t/guestfs_070_threads.bc
> File "_none_", line 1, characters 0-1:
> Error: Error on dynamically loaded library: /usr/lib64/ocaml/stublibs/dllthreads.so: /usr/lib64/ocaml/stublibs/dllthreads.so: undefined symbol: pthread_atfork
> 
> I did a quick bit of googling and found:
> http://ryanarn.blogspot.com.au/2011/07/curious-case-of-pthreadatfork-on.html
> 
> which seems to explain what's going on to my naive eye anyway.
> 
> I've tried a few different CFLAGS/patches to
> otherlibs/systhreads/Makefile to try and induce pthreads_atfork() to be
> resolved and linked during the ocaml build.  Nothing I try works.
> 
> Does anyone have any ideas on how to solve this?
> 
> I'm happy to do the heavy lifting I just don't have the background in
> ocaml to solve this by myself.
> 
> Yours Tony
> 
> [1] I suspects that as a result of the demotion to secondary and things
>     languishing there we skipped a few builds.

It looks like the PPC64 OCaml package is buggy.  Can you compile any
threaded program at all, eg:

  echo 'print_endline "hello"' > test.ml
  ocamlfind c -package threads -thread test.ml -linkpkg -o test
  ./test

Unfortunately I don't have access to ppc64, so there's no way I can
even look at bugs in this area, let alone fix them.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list