This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix vDSO l_name for GDB's: Can't read pathname for loadmap: Input/output error.


On Tue, 06 Oct 2009 08:30:53 +0200, Roland McGrath wrote:
[...]
> > GDB currently always prints on loading a core file:
> > 	warning: Can't read pathname for load map: Input/output error.
[...]
> When that's the situation, it would sure more helpful to a GDB user if GDB
> said so clearly, because it certainly knows perfectly well.

Yes, the GDB specific error message text could be better.


> You seem to be concerned only with the cases where the information that
> might be in the core file but doesn't happen to be is not actually
> informative, i.e. the string you'd find is empty and so you'd just ignore
> it anyway.

The GDB-only solution would/will be to ignore any unreadable strings and after
mapping in the DSOs with readable names to do a second r_map scanning pass.

This time ld-linux.so's readonly segments will be mapped in and the vDSO's
name (const char *) "" will be readable.


> You should have the very same situation in the common case of DT_NEEDED
> objects where l_name is an address in someone's .dynstr (text), which won't
> likely be dumped either.

ld.so coincidentally uses r/w memory for the later loaded DSOs, open_path()'s
REALNAME is malloc()ated or in _dl_map_object it is local_strdup()ped etc.

Not considering now a way to locate DSO by its build-id (which would work).
The only other public location to be found in link_map is l_name.


If l_name would really be omitted from the core file it is a chicken-and-egg
problem how to find the DSO file where the DSO's filename is stored, isn't it?


GDB does not load DSOs according to the main executable's DT_NEEDED tags, it
loads them just according to the r_map (which is right, isn't it?).


Thanks,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]