This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Probes in shared libs going missing


I'm having problems building firefox with static user probes. I
attempted to reproduce this with the heapsort example, but failed (as
in, it works with heapsort just fine).

I have a file generated by dtrace named mozjs-trace.o. If I explicitly
link that into my final binary, it works. But if I bundle that up with
all of my other .o's into a libmozjs.so and then link with the .so,
the link fails. It complains about undefined references to
*_semaphore.

mozjs-dtrace.o contains a .probes section with a bunch of zeroes in
it. That's the same as probes.o from the heapsort example, which is
good.

mozjs-dtrace.o also contains a bunch of exported data symbols for
blah_semaphore. Again, this matches probes.o.

libmozjs-dtrace.so contains a .probes section with a bunch of probes
in it. So does libheapsort.so, constructed by using the same link
flags as used for libmozjs-dtrace.so but linking together heapsort.o
and probes.o. (heapsort.o is a -fPIC compile of a version of
heapsort.cxx missing the main() function.)

libmozjs-dtrace.so contains a bunch of local, hidden-visibility data
symbols for blah_semaphore in the .probes section, but nothing else.
This is not true of a test libheapsort.so that I created out of the
heapsort example, using the exact compiler flags for the partial link
that I did with my problematic code. libheapsort.so has those symbols
as visible and exported.

I haven't figure out a way to strip it down to a minimal test case.
I'm linking together 30 or so .o files to produce my libmozjs.so.

If I create libmozjs.so using *only* mozjs-dtrace.o and not all of my
other libs, then it looks good -- as in, it contains exported
*_semaphore symbols. I can't easily whittle down the other 30
libraries to see what introduces the problem because they're all
interdependent. Some of them require the *_semaphore symbols, though.
(So each of those *_semaphore symbols has at least two .o files with
the symbol undefined.)

This is on x86_64.

% rpm -q systemtap
systemtap-1.2-1.fc13.x86_64

% uname -r
2.6.33.5-124.fc13.x86_64

% nm libheapsort.so  | fgrep semaphore
00000000002015ea D buffer_resize_done_semaphore
00000000002015e8 D buffer_resize_start_semaphore
00000000002015f4 D heap_build_done_semaphore
00000000002015f2 D heap_build_start_semaphore
00000000002015f0 D heap_place_semaphore
00000000002015e6 D input_done_semaphore
00000000002015e4 D input_start_semaphore
00000000002015ee D output_done_semaphore
00000000002015ec D output_start_semaphore

% nm libmozjs.so| fgrep semaphore
00000000004f8298 d execute__done_semaphore
00000000004f8296 d execute__start_semaphore
00000000004f8288 d function__args_semaphore
00000000004f8284 d function__entry_semaphore
00000000004f8286 d function__info_semaphore
00000000004f828c d function__return_semaphore
00000000004f828a d function__rval_semaphore
00000000004f8290 d object__create__done_semaphore
00000000004f828e d object__create__start_semaphore
00000000004f8292 d object__create_semaphore
00000000004f8294 d object__finalize_semaphore

% nm mozjs-dtrace.o| fgrep semaphore
0000000000000014 D execute__done_semaphore
0000000000000012 D execute__start_semaphore
0000000000000004 D function__args_semaphore
0000000000000000 D function__entry_semaphore
0000000000000002 D function__info_semaphore
0000000000000008 D function__return_semaphore
0000000000000006 D function__rval_semaphore
000000000000000c D object__create__done_semaphore
000000000000000a D object__create__start_semaphore
000000000000000e D object__create_semaphore
0000000000000010 D object__finalize_semaphore

% objdump -t libmozjs.so | fgrep semap
00000000004f8286 l O .probes 0000000000000002 .hidden
function__info_semaphore
00000000004f8296 l O .probes 0000000000000002 .hidden
execute__start_semaphore
00000000004f8292 l O .probes 0000000000000002 .hidden
object__create_semaphore
00000000004f828c l O .probes 0000000000000002 .hidden
function__return_semaphore
00000000004f8294 l O .probes 0000000000000002 .hidden
object__finalize_semaphore
00000000004f828a l O .probes 0000000000000002 .hidden
function__rval_semaphore
00000000004f8288 l O .probes 0000000000000002 .hidden
function__args_semaphore
00000000004f8284 l O .probes 0000000000000002 .hidden
function__entry_semaphore
00000000004f828e l O .probes 0000000000000002 .hidden
object__create__start_semaphore
00000000004f8298 l O .probes 0000000000000002 .hidden
execute__done_semaphore
00000000004f8290 l O .probes 0000000000000002 .hidden
object__create__done_semaphore


% objdump -t libheapsort.so  | fgrep semaphore
00000000002015e6 g     O .probes        0000000000000002
input_done_semaphore
00000000002015e4 g     O .probes        0000000000000002
input_start_semaphore
00000000002015f2 g     O .probes        0000000000000002
heap_build_start_semaphore
00000000002015ea g     O .probes        0000000000000002
buffer_resize_done_semaphore
00000000002015ee g     O .probes        0000000000000002
output_done_semaphore
00000000002015f0 g     O .probes        0000000000000002
heap_place_semaphore
00000000002015e8 g     O .probes        0000000000000002
buffer_resize_start_semaphore
00000000002015f4 g     O .probes        0000000000000002
heap_build_done_semaphore
00000000002015ec g     O .probes        0000000000000002
output_start_semaphore

% ld --no-add-needed --eh-frame-hdr --build-id -m elf_x86_64
--hash-style=gnu -shared -o libmozjs.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/crtbeginS.o
-L/home/sfink/moz-central/obj-dtrace/dist/lib
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.4
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.4
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../.. -z defs -h
libmozjs.so jsapi.o jsarena.o jsarray.o jsatom.o jsbool.o jscntxt.o
jsdate.o jsdbgapi.o jsdhash.o jsdtoa.o jsemit.o jsexn.o jsfun.o jsgc.o
jsgcchunk.o jshash.o jsinterp.o jsinvoke.o jsiter.o jslock.o jslog2.o
jsmath.o jsnativestack.o jsnum.o jsobj.o json.o jsopcode.o jsparse.o
jsproxy.o jsprf.o jspropertycache.o jspropertytree.o jsregexp.o
jsscan.o jsscope.o jsscript.o jsstr.o jstask.o jstypedarray.o jsutil.o
jswrapper.o jsxdrapi.o jsxml.o prmjtime.o jsdtracef.o jstracer.o
Assembler.o Allocator.o CodeAlloc.o Containers.o Fragmento.o LIR.o
njconfig.o RegAlloc.o avmplus.o NativeX64.o jsbuiltins.o VMPI.o
CTypes.o Library.o mozjs-dtrace.o -lpthread -rpath-link /bin
-rpath-link /lib --whole-archive ctypes/libffi/.libs/libffi.a
--no-whole-archive -lplds4 -lplc4 -lnspr4 -lpthread -ldl -ldl -lm -ldl
-lstdc++ -lm -lgcc_s -lpthread -lc -lgcc_s
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crtn.o -y
execute__done_semaphore
jsinvoke.o: reference to execute__done_semaphore
jsdtracef.o: reference to execute__done_semaphore
mozjs-dtrace.o: definition of execute__done_semaphore


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]