This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: wrong (?) order of initialization of so.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Andrea <mariofutire at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Tue, 7 Jan 2014 12:45:08 +0100
- Subject: Re: wrong (?) order of initialization of so.
- Authentication-results: sourceware.org; auth=none
- References: <52CB2386 dot 1000002 at gmail dot com> <20140106223942 dot GA6024 at domone dot podge> <52CBE21A dot 3010400 at gmail dot com>
On Tue, Jan 07, 2014 at 11:16:42AM +0000, Andrea wrote:
> On 06/01/14 22:39, OndÅej BÃlka wrote:
>
> > The ld decides order and it should be A B C D. Simplest explanation would be cyclic dependecy,
> > is there E that D depend on C and E depends on A?
>
> I have been unable to find it so far.
> How do I detect a cyclic dependency?
>
> If I get all the .so loaded, extract the DT_NEEDED for each and check if there is a loop, would that
> be enough?
>
If there is a loop then yes.
If that does not help then you can try use audit to print more
information.
http://man7.org/linux/man-pages/man7/rtld-audit.7.html
> It is possible that some .so calls dlopen() in the init phase. Would that be relevant in this context?
>
Could be, dlopens in constructors are generaly bad idea, you could try
to print backtraces with audit interface.