Comment 6 for bug 1619616

Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Re: mir fails to build with protobuf3

This is during the second dlopen(libmirprotobuf...) and in the initialization code. So it seems similar to the problems discussed in lp:1391976. But the workaround linked there is clearly no longer adequate.

(gdb) bt
#0 google::protobuf::internal::Mutex::Lock (this=this@entry=0x0) at google/protobuf/stubs/common.cc:366
#1 0x00007ffff710c503 in google::protobuf::internal::MutexLock::MutexLock (mu=0x0, this=<synthetic pointer>)
    at ./google/protobuf/stubs/mutex.h:84
#2 google::protobuf::internal::OnShutdown (func=<optimised out>) at google/protobuf/stubs/common.cc:425
#3 0x00007ffff73b5e47 in mir::protobuf::protobuf_AddDesc_mir_5fprotobuf_2eproto ()
    at /home/alan/display_server/mir/build/src/protobuf/mir_protobuf.pb.cc:171
#4 0x00007ffff73b6321 in mir::protobuf::StaticDescriptorInitializer_mir_5fprotobuf_2eproto::StaticDescriptorInitializer_mir_5fprotobuf_2eproto() [clone .lto_priv.1] (this=0x7ffff75ee959 <mir::protobuf::static_descriptor_initializer_mir_5fprotobuf_2eproto_>)
    at /home/alan/display_server/mir/build/src/protobuf/mir_protobuf.pb.cc:184
#5 0x00007ffff736a01d in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535)
    at /home/alan/display_server/mir/build/src/protobuf/mir_protobuf.pb.cc:186
#6 0x00007ffff736bec9 in _GLOBAL__sub_I_mir_protobuf.pb.cc(void) ()
    at /home/alan/display_server/mir/build/src/protobuf/mir_protobuf.pb.cc:25335
#7 0x00007ffff7de87ba in call_init (l=<optimised out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffdef8, env=env@entry=0x7fffffffdf08)
    at dl-init.c:72
#8 0x00007ffff7de88cb in call_init (env=0x7fffffffdf08, argv=0x7fffffffdef8, argc=1, l=<optimised out>) at dl-init.c:30
#9 _dl_init (main_map=main_map@entry=0x5555557564a0, argc=1, argv=0x7fffffffdef8, env=0x7fffffffdf08) at dl-init.c:120
#10 0x00007ffff7ded856 in dl_open_worker (a=a@entry=0x7fffffffdb80) at dl-open.c:575
#11 0x00007ffff7de8664 in _dl_catch_error (objname=objname@entry=0x7fffffffdb70, errstring=errstring@entry=0x7fffffffdb78,
    mallocedp=mallocedp@entry=0x7fffffffdb6f, operate=operate@entry=0x7ffff7ded500 <dl_open_worker>, args=args@entry=0x7fffffffdb80)
    at dl-error.c:187
#12 0x00007ffff7dece39 in _dl_open (file=0x555555554ac4 "libmirprotobuf.so.3", mode=-2147483646,
    caller_dlopen=0x5555555549d9 <main+105>, nsid=-2, argc=<optimised out>, argv=<optimised out>, env=0x7fffffffdf08) at dl-open.c:660
#13 0x00007ffff7bd4ee9 in dlopen_doit (a=a@entry=0x7fffffffddb0) at dlopen.c:66
#14 0x00007ffff7de8664 in _dl_catch_error (objname=0x555555756430, errstring=0x555555756438, mallocedp=0x555555756428,
    operate=0x7ffff7bd4e90 <dlopen_doit>, args=0x7fffffffddb0) at dl-error.c:187
#15 0x00007ffff7bd5571 in _dlerror_run (operate=operate@entry=0x7ffff7bd4e90 <dlopen_doit>, args=args@entry=0x7fffffffddb0)
    at dlerror.c:163
#16 0x00007ffff7bd4f82 in __dlopen (file=<optimised out>, mode=<optimised out>) at dlopen.c:87
#17 0x00005555555549d9 in main (argc=1, argv=0x7fffffffdef8) at /home/alan/display_server/mir/tests/loader-tests/test_reload.c:36
(gdb) f 3
#3 0x00007ffff73b5e47 in mir::protobuf::protobuf_AddDesc_mir_5fprotobuf_2eproto ()
    at /home/alan/display_server/mir/build/src/protobuf/mir_protobuf.pb.cc:171
171 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_mir_5fprotobuf_2eproto);
(gdb) f 17
#17 0x00005555555549d9 in main (argc=1, argv=0x7fffffffdef8) at /home/alan/display_server/mir/tests/loader-tests/test_reload.c:36
36 dl = dlopen(libname, RTLD_NOW);
(gdb) list
31 char const* libname = argc <= 1 ? DEFAULT_LIB_NAME : argv[1];
32 for (i = 0; i < 10; i++)
33 {
34 void* dl = NULL;
35 printf("[%d] dlopen `%s' = ", i, libname);
36 dl = dlopen(libname, RTLD_NOW);
37 if (dl)
38 {
39 printf("%p\n", dl);
40 dlclose(dl);
(gdb) p i