[Rd] extensions link to libpthread cause R coredumps when dyn.load('xxx.so')

assiss bianshl at gmail.com
Fri Aug 25 15:57:31 CEST 2006


hi,
     I wrote a simplest c extension to test.
xxx.c
     R CMD SHLIB xxx.c
then I run dyn.load('xxx.so'), it worked very well without any question.

but if I compiled it with -lphread,
xxx.c
Makevars with PKG_LIBS=-lpthread
R CMD SHLIB xxx.c
then I run dyn.load('xxx.so'), R crashed.

I run R -d gdb and dyn.load('xxx.so'), gdb showed:
Program received signal SIGABRT, Aborted.
[Switching to LWP 1]
0x0000000200c2d15e in kill () from /usr/lib/libc.so.12

What's wrong with libpthread? I have nothing with pthread in xxx.c. I 
just linked to it.
Linking with other libs didn't cause this problem: -lz, -lglib-2.0 ...

I found this problem when using RGtk2 and cairoDevice. Neither of them 
worked.

My system:
NetBSD amd64 3.0
R-2.3.1(Building from pkgsrc-2006Q2)
Gtk+-2.8.20

Thanks for your attention.



More information about the R-devel mailing list