|
From: Tom H. <th...@cy...> - 2004-03-18 09:35:42
|
In message <Pin...@ye...>
Nicholas Nethercote <nj...@ca...> wrote:
> I only partly understand this thread, but reading it I'm thinking: this
> all sounds very complicated for something that only(?) affects FC2... can
> we avoid doing anything, or do something simple? It makes me
> uncomfortable every time we have to build in some special handling for a
> particular version of a library or whatever. Just an observation.
This isn't about FC2 although it will affect it. It is currently
affecting my FC builds and one of Julian's SuSE builds I think. It
will likely affect most future distributions as well.
The visible effect is that any system call errors are reported as
being in _dl_sysinfo_int80 instead of whichever system call was being
called at the time.
Newer kernels and glibcs support a system whereby the kernel provides a
routine which glibc uses to make system calls. That allows the kernel
to replace the use of int80 for system calls with sysenter/syscall or
whatever depending on the CPU you have.
The address of that routine was originally provided by the AT_SYSINFO
entry in the auxv given to the program, and if it wasn't present then
glibc would use it's internal _dl_sysinfo_int80 routine instead which
just does things the old way.
At some point the system was changed so that rather than just
injecting code into the process the kernel actually maps a small
shared object and sets AT_SYSINFO_EHDR to point to the ELF header
for that object. It also sets AT_SYSINFO still for backwards
compatibility. Newer glibcs effectively ignore AT_SYSINFO however
unless AT_SYSINFO_EHDR is also set.
So on FC1 the kernel doesn't provide a sysinfo page anyway, so all the
stack traces appear to be in _dl_sysinfo_int80 which is why Jeremy
suggested always mapping our own sysinfo page even if the kernel
didn't supply one - currently we only replace any kernel supplied value.
That didn't work however as valgrind only provides an old style
sysinfo page rather than an ELF object so glibc ignored it. Hence
the reason that we are trying to work our how to provide a new style
sysinfo page.
As far as I know 2.6 has sysinfo support by default so this will be an
issue going forward - it isn't clear to me if 2.4 ever had it or
whether RedHat et al have been adding it. RH9 seemed to have it but
then it went away again in FC1 which is a bit odd.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|