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
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 :protobuf: :internal: :Mutex: :Lock (this=this@ entry=0x0) at google/ protobuf/ stubs/common. cc:366 :protobuf: :internal: :MutexLock: :MutexLock (mu=0x0, this=<synthetic pointer>) protobuf/ stubs/mutex. h:84 :protobuf: :internal: :OnShutdown (func=<optimised out>) at google/ protobuf/ stubs/common. cc:425 :protobuf_ AddDesc_ mir_5fprotobuf_ 2eproto () display_ server/ mir/build/ src/protobuf/ mir_protobuf. pb.cc:171 :StaticDescript orInitializer_ mir_5fprotobuf_ 2eproto: :StaticDescript orInitializer_ mir_5fprotobuf_ 2eproto( ) [clone .lto_priv.1] (this=0x7ffff75 ee959 <mir::protobuf: :static_ descriptor_ initializer_ mir_5fprotobuf_ 2eproto_ >) display_ server/ mir/build/ src/protobuf/ mir_protobuf. pb.cc:184 initialization_ and_destruction _0 (__initialize_p=1, __priority=65535) display_ server/ mir/build/ src/protobuf/ mir_protobuf. pb.cc:186 _sub_I_ mir_protobuf. pb.cc(void) () display_ server/ mir/build/ src/protobuf/ mir_protobuf. pb.cc:25335 entry=0x7ffffff fdef8, env=env@ entry=0x7ffffff fdf08) df08, argv=0x7fffffff def8, argc=1, l=<optimised out>) at dl-init.c:30 main_map@ entry=0x5555557 564a0, argc=1, argv=0x7fffffff def8, env=0x7fffffffdf08) at dl-init.c:120 0x7fffffffdb80) at dl-open.c:575 objname@ entry=0x7ffffff fdb70, errstring= errstring@ entry=0x7ffffff fdb78, mallocedp@ entry=0x7ffffff fdb6f, operate= operate@ entry=0x7ffff7d ed500 <dl_open_worker>, args=args@ entry=0x7ffffff fdb80) 54ac4 "libmirprotobuf .so.3", mode=-2147483646, dlopen= 0x5555555549d9 <main+105>, nsid=-2, argc=<optimised out>, argv=<optimised out>, env=0x7fffffffdf08) at dl-open.c:660 0x7fffffffddb0) at dlopen.c:66 0x555555756430, errstring= 0x555555756438, mallocedp= 0x555555756428, 0x7ffff7bd4e90 <dlopen_doit>, args=0x7fffffff ddb0) at dl-error.c:187 operate@ entry=0x7ffff7b d4e90 <dlopen_doit>, args=args@ entry=0x7ffffff fddb0) def8) at /home/alan/ display_ server/ mir/tests/ loader- tests/test_ reload. c:36 :protobuf_ AddDesc_ mir_5fprotobuf_ 2eproto () display_ server/ mir/build/ src/protobuf/ mir_protobuf. pb.cc:171 :protobuf: :internal: :OnShutdown( &protobuf_ ShutdownFile_ mir_5fprotobuf_ 2eproto) ; def8) at /home/alan/ display_ server/ mir/tests/ loader- tests/test_ reload. c:36
#0 google:
#1 0x00007ffff710c503 in google:
at ./google/
#2 google:
#3 0x00007ffff73b5e47 in mir::protobuf:
at /home/alan/
#4 0x00007ffff73b6321 in mir::protobuf:
at /home/alan/
#5 0x00007ffff736a01d in __static_
at /home/alan/
#6 0x00007ffff736bec9 in _GLOBAL_
at /home/alan/
#7 0x00007ffff7de87ba in call_init (l=<optimised out>, argc=argc@entry=1, argv=argv@
at dl-init.c:72
#8 0x00007ffff7de88cb in call_init (env=0x7fffffff
#9 _dl_init (main_map=
#10 0x00007ffff7ded856 in dl_open_worker (a=a@entry=
#11 0x00007ffff7de8664 in _dl_catch_error (objname=
mallocedp=
at dl-error.c:187
#12 0x00007ffff7dece39 in _dl_open (file=0x5555555
caller_
#13 0x00007ffff7bd4ee9 in dlopen_doit (a=a@entry=
#14 0x00007ffff7de8664 in _dl_catch_error (objname=
operate=
#15 0x00007ffff7bd5571 in _dlerror_run (operate=
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=0x7fffffff
(gdb) f 3
#3 0x00007ffff73b5e47 in mir::protobuf:
at /home/alan/
171 ::google:
(gdb) f 17
#17 0x00005555555549d9 in main (argc=1, argv=0x7fffffff
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