tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fixing libpthread noload, another approach

On Tue, Feb 05, 2013 at 11:32:06AM +0100, Joerg Sonnenberger wrote:
> There won't be a generic solution, since any approach requires at the
> very least an audit of the code to see whether it really requires
> threading. Just overriding it would otherwise just move from an explicit
> early error to much harder to diagnose problems later.

There is no such thing like an explicit early error for now.  dlopen
fails and the process survives, most of the time without reporting the
dlerror() string. On the two time I have hit that problem, I was only
able to get a diagnostic with ktrace.

Using abort() is better IMO, at least you cannot miss that you crash, 
and gdb quickly tells you where it happens if you did not had an error

On the early or late error, if RTLD_LAZY is used and something uses
dlsym() to call pthread_create(), then your approach will cause a
late error. This is exactly the situation I get by modifying ld.elf_so, 
so if it is acceptable for your solution, it is also for mine.

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index