[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
_IO_stdin_used and enable-oldest-abi: a bug ?
From: |
Michael Tokarev |
Subject: |
_IO_stdin_used and enable-oldest-abi: a bug ? |
Date: |
Mon, 24 Dec 2001 18:31:55 +0300 |
This is not a bugreport but an RFC instead.
Recently I spent 3 whole days debugging crashes of basic utilities
after glibc upgrade. The problem was with the $SUBJ. Here are
more details.
Some time ago I installed glibc compiled with --enable-oldest-abi=2.1.3,
due to several size constraints. After that, I compiled several
packages against that glibc. And recently, after installation of
glibc compiled without the enable-oldest-abi flag, many packages
stopped working.
There is a symbol, _IO_stdin_used, placed into the executable program,
*only* when a program compiles against glibc that has support for
pre-2.1 libio. Inside a fully-backward-compatible glibc, there is
a routine that "looks into an executable" and determines if that
symbol is present. If not, that routine switches std{in,out,err}
to point to old, pre-2.1 libio structures, assuming that this is
a very old program compiled against old glibc, so that all stdio
routines will work correctly. This is an interesting trick by its
own.
Now, if I compile a program against never glibc that has NO support
for pre-2.1 abi, that symbol is NOT placed into the executable. So,
if that executable will run against complete glibc that has support
for pre-2.1 abi, the glibc will assume it is old program and will
switch std{in,out,err} to older ones, effectively breaking the
program (that was the reasons for various crashes on me).
That symbol definition (_IO_stdin_used) controlled in libio.h by
the following #ifdefs, trimmed:
# include <shlib-compat.h>
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
extern const int _IO_stdin_used;
weak_extern (_IO_stdin_used);
# endif
# endif
The question. Is this a bug? I think so, and think that the above
_IO_stdin_used should be defined regardless on oldest-abi flag. Or
else any executable compiled against never "stripped" glibc will not
work on "non-stripped" one, as I have here.
Comments, anyone?
And btw, is there any way to "subscribe" to bugs-glibc? I have no
access for gnu.* news hierarhy, it is only possible to use archives.
So, please Cc me any replies ;) and sorry for inconvience for this,
I myself consider this to be "bad manners" of me, but can't work
around this for now.
Regards,
Michael.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- _IO_stdin_used and enable-oldest-abi: a bug ?,
Michael Tokarev <=