All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Crash with longer dlopen/dlcose sequence
@ 2018-04-26  7:02 Edouard Tisserant
  2018-04-26  7:39 ` Edouard Tisserant
  0 siblings, 1 reply; 15+ messages in thread
From: Edouard Tisserant @ 2018-04-26  7:02 UTC (permalink / raw)
  To: Xenomai (xenomai@xenomai.org)

Good Morning !

I'm chasing the origins of a random segfault when porting Beremiz to
Xenomai 3.

Beremiz PLC runtime loads PLC logic as a shared object. Loading is
performed as dlopen call from python interpreter. Each time PLC
programmer tries a new program, previous shared object is dlcosed and
the new program is dlopened.

Of course, there is in depth checks to ensure that all
dlopen/dlclose/dlsym operations are done from main thread only, and it
is ensured that all real time tasks and resources have been closed
before dlclose.

Also, I did check that implicit call to xenomai_init_dso() really
happens, when linking shared object with bootstrap-pic.o . I also tried
explicit call to xenomai_init (once at first load or after every
dlopen), no change.

I tried last commit about this topic : "boilerplate/setup: introduce
destructors for __setup_call"
(5511e76040444af875ae1bb099c13a25b16336fc). It didn't help,
unfortunately, but did remove Xenomai "Bad syscall" warning sometimes
after dlclose.

Segfault never happen at first reload. i.e. dlopen/dlcose/dlopen never
fails. You have to at least extend the sequence to
dlopen/dlcose/dlopen/dlcose/dlopen to see the crash. In other words,
smokey/dlopen test doesn't try hard enough to catch the problem. I have
to reload about 6 times to have a crash. Also, it seems that crash has
higher probability to occur if no symbol was called from shared object
in between dlopen and dlclose (dlsym was called).

Enabling full Xenomai debug didn't display more details on the crash.
Post-mortem debug (gdb -c core) works, but gdb can't give me any
backtrace :

(gdb) bt
#0  0x00007fb8 in ?? ()
#1  0xb520c098 in ?? ()

Is there a way to have gdb telling a bit more about what happens in
boilerplate/copperplate ? How can I find where it crashes ?

Cheers,

Edouard




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-05-18  7:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26  7:02 [Xenomai] Crash with longer dlopen/dlcose sequence Edouard Tisserant
2018-04-26  7:39 ` Edouard Tisserant
2018-04-26  9:24   ` Edouard Tisserant
2018-04-26 11:07     ` Henning Schild
2018-04-26 15:30     ` Philippe Gerum
2018-04-26 17:16       ` Edouard Tisserant
2018-04-27 10:31         ` Edouard Tisserant
2018-04-27 14:43           ` Edouard Tisserant
2018-04-27 15:43             ` Philippe Gerum
2018-05-09  7:45               ` Edouard Tisserant
2018-05-09  8:57                 ` Edouard Tisserant
2018-05-09 10:27                   ` Edouard Tisserant
2018-05-12 17:08                     ` Philippe Gerum
2018-05-16  9:20                       ` Edouard Tisserant
2018-05-18  7:08                         ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.