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