public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/1789] New: assert() corrupts the stack?
@ 2005-11-03  9:57 fluffmail at f-m dot fm
  2005-11-07 17:26 ` [Bug libc/1789] " decimal at us dot ibm dot com
  2005-11-07 17:26 ` decimal at us dot ibm dot com
  0 siblings, 2 replies; 3+ messages in thread
From: fluffmail at f-m dot fm @ 2005-11-03  9:57 UTC (permalink / raw)
  To: glibc-bugs

Here is the sample program:
--------------------------------
#include <assert.h>
int main(void){
   int i = 1;
   assert(i == 0);
   return 0;
}
--------------------------------

It compiles OK (gcc -g t.c); it runs OK, stopping at the assertion like it 
should. But here's the output from running the program under gdb:

--------------------------------
(gdb) run
a.out: t.c:5: main: Assertion `i == 0' failed.

Program received signal SIGABRT, Aborted.
0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7ed6175 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ed77d8 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xbffff4f0 in ?? ()
#4  0x00000000 in ?? ()
#5  0x00000020 in ?? ()
#6  0x00000000 in ?? ()
[... many null pointers...]
#36 0x00000000 in ?? ()
#37 0xb7f19307 in _IO_file_write () from /lib/tls/i686/cmov/libc.so.6
Previous frame inner to this frame (corrupt stack?)
--------------------------------

I don't know if gdb's "corrupt stack?" claim is true, but assert() pretty 
consistently gives me this less-than-useless backtrace. Call me a crappy 
programmer, but without a backtrace I have a lot of trouble fixing my code.

-- 
           Summary: assert() corrupts the stack?
           Product: glibc
           Version: 2.3.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: fluffmail at f-m dot fm
                CC: glibc-bugs at sources dot redhat dot com
  GCC host triplet: Ubuntu Linux 2.6.10-5-686


http://sourceware.org/bugzilla/show_bug.cgi?id=1789

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/1789] assert() corrupts the stack?
  2005-11-03  9:57 [Bug libc/1789] New: assert() corrupts the stack? fluffmail at f-m dot fm
  2005-11-07 17:26 ` [Bug libc/1789] " decimal at us dot ibm dot com
@ 2005-11-07 17:26 ` decimal at us dot ibm dot com
  1 sibling, 0 replies; 3+ messages in thread
From: decimal at us dot ibm dot com @ 2005-11-07 17:26 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |decimal at us dot ibm dot
                   |                            |com


http://sourceware.org/bugzilla/show_bug.cgi?id=1789

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/1789] assert() corrupts the stack?
  2005-11-03  9:57 [Bug libc/1789] New: assert() corrupts the stack? fluffmail at f-m dot fm
@ 2005-11-07 17:26 ` decimal at us dot ibm dot com
  2005-11-07 17:26 ` decimal at us dot ibm dot com
  1 sibling, 0 replies; 3+ messages in thread
From: decimal at us dot ibm dot com @ 2005-11-07 17:26 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From decimal at us dot ibm dot com  2005-11-07 17:25 -------
I tried this testcase on Fedora Core 4 i386 running on a Pentium 4 box and I get

$ gdb a.out
GNU gdb Red Hat Linux (6.3.0.0-1.84rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /home/dwayne/glibc/bug/1789/a.out
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0x49c000
a.out: t.c:4: main: Assertion `i == 0' failed.

Program received signal SIGABRT, Aborted.
0x0049c402 in __kernel_vsyscall ()
(gdb)

It seems to me the problem is likely to either be Ubuntu specific or a problem
with gdb. My advice is to open an Ubuntu bug at http://bugzilla.ubuntu.com/.
When you do that you will want to tell them the version of glibc, gcc, and gdb
that you are using. This information is available from dpkg I believe.

I'm going to mark this bug as INVALID because there is not enough information to
demonstrate that this is a generic glibc bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=1789

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-07 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-03  9:57 [Bug libc/1789] New: assert() corrupts the stack? fluffmail at f-m dot fm
2005-11-07 17:26 ` [Bug libc/1789] " decimal at us dot ibm dot com
2005-11-07 17:26 ` decimal at us dot ibm dot com

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).