* Fwd: The APT problem
@ 1999-09-22 20:27 Joel Klecker
1999-09-22 20:34 ` Ulrich Drepper
1999-09-22 21:47 ` Geoff Keating
0 siblings, 2 replies; 4+ messages in thread
From: Joel Klecker @ 1999-09-22 20:27 UTC (permalink / raw)
To: libc-hacker
[ I have been sitting on this for a while because I wasn't sure about
reporting it. ]
Should this be considered a glibc bug? or even a bug at all?
libstdc++2.9 on Debian systems is linked with glibc 2.0;
libstdc++2.9-glibc2.1 is linked with glibc 2.1.
>-- begin forwarded message --
>Subject: The APT problem
>To: egcs@packages.debian.org
>Date: Wed, 23 Jun 1999 14:23:29 +0200 (CEST)
>CC: debian-glibc@lists.debian.org, jgg@debian.org
>From: Richard Braakman <dark@xs4all.nl>
>
>When glibc 2.1 was introduced in potato, apt stopped working. Recompiling
>fixed it, but I figured this indicated a bug in the compat code, so today
>I found time to investigate it. Jason Gunthorpe had provided me with
>a test case:
>
>#include <iostream>
>#include <fstream>
>
>void die(const char *S)
>{
> cerr << S << endl;
> exit(1);
>}
>
>int main(int argc,const char *argv[])
>{
> ifstream F(argv[1],ios::in | ios::nocreate);
>
> if (!F != 0)
> die("!F #1");
>
> streampos Off = F.tellg();
> if (!F != 0)
> die("!F #2");
>
> return 0;
>}
>
>(This has to be run with the name of an existing file as argument.)
>
>When run on a glibc2.1 system, a version compiled with libstdc++2.9
>will die with "!F #2". A version compiled with libstdc++2.9-glibc2.1
>will exit successfully.
>
>The problem turns out to be rather simple. istream:tellg() contains
>this code:
>
>streampos istream::tellg()
>{
>#if 0
> streampos pos = _strbuf->pubseekoff(0, ios::cur, ios::in);
>#else
> streampos pos = _IO_seekoff (_strbuf, 0, _IO_seek_cur, _IOS_INPUT);
>#endif
> if (pos == streampos(EOF))
> set(ios::badbit);
> return pos;
>}
>
>(This is taken from egcs 1.1.2/libio, a different version than what
>generated libstdc++2.9, but I can tell from the disassembly that the
>significant part didn't change.)
>
>This code calls _IO_seekoff directly, expecting that it takes a 32-bit
>offset. But _IO_seekoff in glibc2.1 takes a 64-bit offset, and ends
>up trying to seek to 0x100000000 and failing.
>
>egcs's libio appears to be full of references to glibc's libio.
>I checked some others at random (_IO_proc_open, _IO_file_close,
>_IO_adjust_column), and found that filebuf::seekoff probably
>has the same problem when it calls _IO_file_seekoff, because both
>_IO_old_file_seekoff and _IO_new_file_seekoff now take a 64-bit offset.
>
>Richard Braakman
>-- end forwarded message --
--
Joel Klecker (aka Espy) Debian GNU/Linux Developer
<URL: mailto:jk@espy.org > <URL: mailto:espy@debian.org >
<URL: http://web.espy.org/ > <URL: http://www.debian.org/ >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: The APT problem
1999-09-22 20:27 Fwd: The APT problem Joel Klecker
@ 1999-09-22 20:34 ` Ulrich Drepper
1999-09-22 21:47 ` Geoff Keating
1 sibling, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 1999-09-22 20:34 UTC (permalink / raw)
To: Joel Klecker; +Cc: libc-hacker
Joel Klecker <jk@espy.org> writes:
> libstdc++2.9-glibc2.1 is linked with glibc 2.1.
2.1 is far too old. Use 2.1.2.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: The APT problem
1999-09-22 20:27 Fwd: The APT problem Joel Klecker
1999-09-22 20:34 ` Ulrich Drepper
@ 1999-09-22 21:47 ` Geoff Keating
1999-09-23 11:31 ` Joel Klecker
1 sibling, 1 reply; 4+ messages in thread
From: Geoff Keating @ 1999-09-22 21:47 UTC (permalink / raw)
To: jk; +Cc: libc-hacker
> Mailing-List: contact libc-hacker-help@sourceware.cygnus.com; run by ezmlm
> List-Unsubscribe: < mailto:libc-hacker-unsubscribe-geoffk=cygnus.com@sourceware.cygnus.com >
> List-Subscribe: < mailto:libc-hacker-subscribe@sourceware.cygnus.com >
> List-Archive: < http://sourceware.cygnus.com/ml/libc-hacker/ >
> List-Post: < mailto:libc-hacker@sourceware.cygnus.com >
> List-Help: < mailto:libc-hacker-help@sourceware.cygnus.com >, < http://sourceware.cygnus.com/ml/#faqs >
> Date: Wed, 22 Sep 1999 20:08:02 -0700
> From: Joel Klecker <jk@espy.org>
>
> [ I have been sitting on this for a while because I wasn't sure about
> reporting it. ]
>
> Should this be considered a glibc bug? or even a bug at all?
It's only a glibc bug if you linked your program with libstdc++2.9 _and
glibc 2.0_, and it stopped working on 2.1.
...
> >When run on a glibc2.1 system, a version compiled with libstdc++2.9
> >will die with "!F #2". A version compiled with libstdc++2.9-glibc2.1
> >will exit successfully.
--
Geoffrey Keating <geoffk@cygnus.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: The APT problem
1999-09-22 21:47 ` Geoff Keating
@ 1999-09-23 11:31 ` Joel Klecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Klecker @ 1999-09-23 11:31 UTC (permalink / raw)
To: libc-hacker
At 14:41 +1000 1999-09-23, Geoff Keating wrote:
>It's only a glibc bug if you linked your program with libstdc++2.9 _and
>glibc 2.0_, and it stopped working on 2.1.
That's exactly the problem.
--
Joel Klecker (aka Espy) Debian GNU/Linux Developer
<URL: mailto:jk@espy.org > <URL: mailto:espy@debian.org >
<URL: http://web.espy.org/ > <URL: http://www.debian.org/ >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-09-23 11:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-22 20:27 Fwd: The APT problem Joel Klecker
1999-09-22 20:34 ` Ulrich Drepper
1999-09-22 21:47 ` Geoff Keating
1999-09-23 11:31 ` Joel Klecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).