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

Bug#20606: marked as done ([Fix in {gcc,egcc}-2.91.x] gcc: register variable corruption)



Your message dated Thu, 12 Apr 2001 23:52:39 +0200 (MEST)
with message-id <15062.8940.590633.88211@bolero>
and subject line closing gcc272 bugs
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 3 Apr 1998 15:12:05 +0000
Received: (qmail 31406 invoked from network); 3 Apr 1998 15:11:55 -0000
Received: from ppp-42.a2points.com (HELO ppp37.a2points.com) (root@195.10.6.42)
  by debian.novare.net with SMTP; 3 Apr 1998 15:11:55 -0000
Received: (from dwitch@localhost)
	by ppp37.a2points.com (8.8.8/8.8.8/Debian/GNU) id QAA13760;
	Fri, 3 Apr 1998 16:35:01 +0200
Date: Fri, 3 Apr 1998 16:35:01 +0200
Message-Id: <199804031435.QAA13760@ppp37.a2points.com>
From: Yann Dirson <ydirson@a2points.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Debian bug-system submission <submit@bugs.debian.org>
Subject: gcc: register variable corruption
X-Mailer: VM 6.42 under Emacs 19.34.1

Package: gcc
Version: 2.7.2.3-3

[ARCH is i386]
libc: 2.0.6-3
binutils: 2.8.1.0.19-1

It seems gcc (I guess it's the one responsible here, either for
compiling my program, or libc) does strange things.  It may well be
that it has been fixed in more recent versions, but as it may not, and
some new side-effects may hide it, I report anyway.

I'll upgrade libc+binutils to the latest from hamm or incoming, and
will try egcs too.

[note: there may be a bug it use of getline(), but that should not be
relevant to the bug I report here ;]

Here's the relevant code:

====
int sfm_fallback_read (FILE* f, unicode** *sfmf, unsigned *size)
{
  char* buf = NULL;
  ssize_t buf_size = 0;
  ssize_t buf_read;
[...]
  while (!feof(f))
    {
[...]
      if ((buf_read = getline (&buf, &buf_size, f)) == -1)
	{
	  if (feof(f))				  /* should not modify errno */
	    break;
	  else if (errno == EINTR)
[...]
        }
[...]
    }
====

Here's gdb output:
====
GNU gdb 4.16.86
[...]
61            if ((buf_read = getline (&buf, &buf_size, f)) == -1)
(gdb) 
63                if (feof(f))
(gdb) p buf_read 
$1 = -1
(gdb) n
65                else if (errno == EINTR)
(gdb) p buf_read 
$2 = 0
(gdb) p &buf_read 
Address requested for identifier "buf_read" which is in a register.
(gdb) p &f
$3 = (_IO_FILE **) 0xbfffef34
(gdb) p &buf_size
$4 = (int *) 0xbfffef24
====

For some getline() reason, the *register* buf_read is set to -1.  Let's
accept this.  Then the call to eof() seems to alter this register.

FWIW, let's have a closer look:

* from "info registers", I see that buf_read is stored in EAX
* from <idem>, line 63 <-> EIP=0x4001f7d8 ; line 65 <-> EIP=0x4001f7e9

====
(gdb) disassemble 0x4001f7d8 0x4001f7e9
Dump of assembler code from 0x4001f7d8 to 0x4001f7e9:
0x4001f7d8 <sfm_fallback_read+328>:     pushl  %edi
0x4001f7d9 <sfm_fallback_read+329>:     call   0x4001de2c <_init+172>
0x4001f7de <sfm_fallback_read+334>:     addl   $0x4,%esp
0x4001f7e1 <sfm_fallback_read+337>:     testl  %eax,%eax
0x4001f7e3 <sfm_fallback_read+339>:     jne    0x4001f9c0 <sfm_fallback_read+816>
====

* using "nexti", it appears the value gets modified in the call() -
which does not seem to call eof() ?

====
(gdb) display buf_read 
1: buf_read = -1
(gdb) nexti
0x4001f7d9      63                if (feof(f))                            /* should not modify errno */
1: buf_read = -1
(gdb) 
0x4001f7de      63                if (feof(f))                            /* should not modify errno */
1: buf_read = 0
(gdb) p &feof
$8 = (<text variable, no debug info> *) 0x4005fe00 <feof>
====
-- 
Yann Dirson  <ydirson@a2points.com>      | Stop making M$-Bill richer & richer,
alt-email:     <dirson@univ-mlv.fr>      |     support Debian GNU/Linux:
debian-email:   <dirson@debian.org>      |         more powerful, more stable !
http://www.a2points.com/homepage/3475232 | Check <http://www.debian.org/>
---------------------------------------
Received: (at 20606-done) by bugs.debian.org; 12 Apr 2001 21:58:24 +0000
>From doko@cs.tu-berlin.de Thu Apr 12 16:58:24 2001
Return-path: <doko@cs.tu-berlin.de>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 14np6d-0003Xr-00; Thu, 12 Apr 2001 16:58:24 -0500
Received: from bolero.cs.tu-berlin.de (bolero.cs.tu-berlin.de [130.149.19.1])
	by mail.cs.tu-berlin.de (8.9.3/8.9.3) with ESMTP id XAA08192;
	Thu, 12 Apr 2001 23:53:09 +0200 (MET DST)
Received: (from doko@localhost)
	by bolero.cs.tu-berlin.de (8.9.3+Sun/8.9.3) id XAA19323;
	Thu, 12 Apr 2001 23:52:39 +0200 (MEST)
From: Matthias Klose <doko@cs.tu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Date: Thu, 12 Apr 2001 23:52:39 +0200 (MEST)
To: 4429-done@bugs.debian.org, 4430-done@bugs.debian.org,
        4954-done@bugs.debian.org, 5367-done@bugs.debian.org,
        6047-done@bugs.debian.org, 12375-done@bugs.debian.org,
        20606-done@bugs.debian.org, 20889-done@bugs.debian.org,
        24788-done@bugs.debian.org, 26100-done@bugs.debian.org,
        34322-done@bugs.debian.org, 48726-done@bugs.debian.org,
        54544-done@bugs.debian.org, 63154-done@bugs.debian.org
Subject: closing gcc272 bugs
X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs  Lucid
Message-ID: <15062.8940.590633.88211@bolero>
Delivered-To: 20606-done@bugs.debian.org

gcc272 (2.7.2.3-18) unstable; urgency=low

  * Close all gcc272 in the Debian bug tracking archive. The use of
    gcc272 is deprecated. The only reason it exists is to have a
    compiler for the linux kernel 2.0.x.
    The bug reports for gcc272 are still available on
    http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=gcc272&archive=yes
    Closes: #4429, #4430, 4954, #5367, #6047, #12375, #20606, #20889,
    #24788, #26100, #34322, #48726, #54544, #63154.



Reply to: