Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 86263 - gdb is broken on amd64
Summary: gdb is broken on amd64
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-22 08:15 UTC by Fred Krogh
Modified: 2005-03-25 07:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
The executable for "test" (test,10.77 KB, application/octet-stream)
2005-03-23 22:21 UTC, Fred Krogh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Krogh 2005-03-22 08:15:43 UTC
ddd segfaults on "Hello World"  (Also happens in gdb)

Compile this code in test.c:

#include<stdio.h>
int main(void)
{
  printf("Hello World\n");
  return 0;
}


Reproducible: Always
Steps to Reproduce:
1. gcc -g -c test test.c
2. ddd test
3. Set breakpoint on the printf line, and click run.

Or after step 1

2'. gdb test
3. run

gives segmentation fault.

Actual Results:  
GNU DDD 3.3.8 (x86_64-pc-linux-gnu), by Dorothea L
Comment 1 Fred Krogh 2005-03-22 08:15:43 UTC
ddd segfaults on "Hello World"  (Also happens in gdb)

Compile this code in test.c:

#include<stdio.h>
int main(void)
{
  printf("Hello World\n");
  return 0;
}


Reproducible: Always
Steps to Reproduce:
1. gcc -g -c test test.c
2. ddd test
3. Set breakpoint on the printf line, and click run.

Or after step 1

2'. gdb test
3. run

gives segmentation fault.

Actual Results:  
GNU DDD 3.3.8 (x86_64-pc-linux-gnu), by Dorothea Lütkehaus and Andreas Zeller.
Copyright © 1995-1999 Technische Universität Braunschweig, Germany.
Copyright © 1999-2001 Universität Passau, Germany.
Copyright © 2001 Universität des Saarlandes, Germany.
Copyright © 2003 Free Software Fundation, Inc.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) break test.c:4
Breakpoint 1 at 0x4004bc: file test.c, line 4.
(gdb) run

Program received signal SIGSEGV, Segmentation fault.
0x0000002a95560ea0 in ?? ()
(gdb) 

Expected Results:  
Should have stopped on the printf line.

Note that the exact same Segmentation fault occurs with no breakpoint.
The code of course runs just fine outside of ddd.
Comment 2 Roland Bär 2005-03-22 08:26:38 UTC
Sorry, not reproducible here on amd64.

Also, following (assumed) correction -c => -o
1. gcc -g -o test test.c

Think we need more info, could you also attach the test.c and the binary?

Your application crashes, not gdb. So then this is going to blame gcc 
instead or libc....
Comment 3 Simon Stelling (RETIRED) gentoo-dev 2005-03-22 08:40:21 UTC
as roland said, your program segfaults, not gdb. if you still think gdb is the root of that segfault, please provide emerge sync, the options you compiled test.c with, the gdb-version and gdb output of gdb test. i can't reproduce it here, the testing version of gdb works great here.
Comment 4 Fred Krogh 2005-03-23 22:21:49 UTC
Created attachment 54313 [details]
The executable for "test"

As requested in earlier responses:

As noted below, after doing the emerge of gcc I'm getting a segmentation fault
even though it seems to indicate that all went o.k.  Perhaps this is a clue?

Results from emerges:

1111510217: >>> starting rsync with rsync://130.207.108.135/gentoo-portage
1111511258: === Sync completed with rsync://130.207.108.135/gentoo-portage

....
Various other tries at emerging gcc all of which ended with print on the
my terminal as given after the last emerge.
....

1111527950: Started emerge on: Mar 22, 2005 13:45:50
1111527950:  *** emerge  libtools
1111527950:  *** terminating.
1111527953: Started emerge on: Mar 22, 2005 13:45:53
1111527953:  *** emerge  libtool
1111527953:  >>> emerge (1 of 1) sys-devel/libtool-1.5.10-r4 to /
1111527953:  === (1 of 1) Cleaning
(sys-devel/libtool-1.5.10-r4::/usr/portage/sy
s-devel/libtool/libtool-1.5.10-r4.ebuild)
1111527954:  === (1 of 1) Compiling/Merging
(sys-devel/libtool-1.5.10-r4::/usr/p
ortage/sys-devel/libtool/libtool-1.5.10-r4.ebuild)
1111528009:  === (1 of 1) Post-Build Cleaning
(sys-devel/libtool-1.5.10-r4::/usr
/portage/sys-devel/libtool/libtool-1.5.10-r4.ebuild)
1111528010:  >>> AUTOCLEAN: sys-devel/libtool
1111528010:  --- AUTOCLEAN: Nothing unmerged.
1111528010:  ::: completed emerge (1 of 1) sys-devel/libtool-1.5.10-r4 to /
1111528010:  *** Finished. Cleaning up...
1111528010:  *** exiting successfully.
1111528013:  *** terminating.
1111528053: Started emerge on: Mar 22, 2005 13:47:33
1111528053:  *** emerge  glibc
1111528053:  >>> emerge (1 of 1) sys-libs/glibc-2.3.4.20041102-r1 to /
1111528053:  === (1 of 1) Cleaning
(sys-libs/glibc-2.3.4.20041102-r1::/usr/porta
ge/sys-libs/glibc/glibc-2.3.4.20041102-r1.ebuild)
1111528053:  === (1 of 1) Compiling/Merging
(sys-libs/glibc-2.3.4.20041102-r1::/
usr/portage/sys-libs/glibc/glibc-2.3.4.20041102-r1.ebuild)
1111528277: Started emerge on: Mar 22, 2005 13:51:17
1111528277:  *** emerge  gcc
1111528277:  >>> emerge (1 of 1) sys-devel/gcc-3.4.3-r1 to /
1111528277:  === (1 of 1) Cleaning
(sys-devel/gcc-3.4.3-r1::/usr/portage/sys-dev
el/gcc/gcc-3.4.3-r1.ebuild)
1111528282:  === (1 of 1) Compiling/Merging
(sys-devel/gcc-3.4.3-r1::/usr/portag
e/sys-devel/gcc/gcc-3.4.3-r1.ebuild)
1111529573:  === (1 of 1) Post-Build Cleaning
(sys-libs/glibc-2.3.4.20041102-r1:
:/usr/portage/sys-libs/glibc/glibc-2.3.4.20041102-r1.ebuild)
1111529575:  >>> AUTOCLEAN: sys-libs/glibc
1111529575:  --- AUTOCLEAN: Nothing unmerged.
1111529575:  ::: completed emerge (1 of 1) sys-libs/glibc-2.3.4.20041102-r1 to
/
1111529575:  *** Finished. Cleaning up...
1111529575:  *** exiting successfully.
1111529578:  *** terminating.
1111530249:  === (1 of 1) Post-Build Cleaning
(sys-devel/gcc-3.4.3-r1::/usr/port
age/sys-devel/gcc/gcc-3.4.3-r1.ebuild)
1111530249:  *** terminating.

On my terminal was printed at the conclusion:



* Switching to x86_64-pc-linux-gnu-3.4.3 compiler...			 [ ok ]


* If you intend to use the gcc from the new profile in an already
* running shell, please remember to do:

*   # source /etc/profile


* If you have issues with packages unable to locate libstdc++.la,
* then try running 'fix_libtool_files.sh' on the old gcc versions.

>>> Regenerating /etc/ld.so.cache...
>>> sys-devel/gcc-3.4.3-r1 merged.
Segmentation fault

I suspect the problem is in my copy of gcc, but I don't know how to recover
from this if the bad copy is just being emerged over and over again.
Comment 5 Fred Krogh 2005-03-25 07:37:07 UTC
This is working now for me after an emerge of glibc-2.3.4.20051025-r1 and gdb-6.3.  I have no idea what the root cause of the problem was.  My apologies for the misleading complaint.