Scott tmp # cat test.c #include <stdio.h> int main() { fprintf(stdout, "ehlo\n"); exit(0); } Scott tmp # gcc -g test.c -o t Scott tmp # gdb ./t GNU gdb 6.3 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 "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) b main Breakpoint 1 at 0xac0: file test.c, line 3. (gdb) r Starting program: /tmp/t Warning: Cannot insert breakpoint 1. Error accessing memory address 0xac0: Input/output error. (gdb) q The program is running. Exit anyway? (y or n) y Scott tmp # strace -s 512 -o ./gdb.out -f gdb ./t GNU gdb 6.3 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 "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) list 1 #include <stdio.h> 2 3 int main() { 4 fprintf(stdout, "ehlo\n"); 5 exit(0); 6 } (gdb) b main Breakpoint 1 at 0xac0: file test.c, line 3. (gdb) r Starting program: /tmp/t ehlo Program exited normally. You can't do that without a process to debug. (gdb) q strace output to follow
Created attachment 57890 [details] strace output Scott tmp # emerge info Portage 2.0.51.20-r5 (default-linux/amd64/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-r0, 2.6.12-rc2 x86_64) ================================================================= System uname: 2.6.12-rc2 x86_64 AMD Opteron(tm) Processor 148 Gentoo Base System version 1.6.11 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.3 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r8 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.11 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=opteron -O2 -g -pipe " CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=opteron -O2 -g -pipe " DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks keeptemp keepwork sandbox strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 GAPING_SECURITY_HOLE X X509 a52 aac aalib acpi acpi4linux aim alsa aotuv apache2 arts artswrappersuid artworkextra asterisk atm audiofile avantgo avi bash-completion bluetooth bonobo bzip2 bzlib c++ cairo caps cdda cddb cdf cdio cdparanoia cdr chipcard chroot clearcase codecs crypt css cups curl curlwrappers dar64 dba dbx devfs26 dga dio distcache djbfft dlloader dnd dpms dts dv dvb dvd dvdr dvdread dxr3 edl eds elf emoticon emul-linux encode erandom escreen ethereal exif extensions faac faad fam fame fax ffmpeg fftw flac flash flexresp fmod font-server foomaticdb fpx freetts freetype ftp ftruncate gd gdbm geoip gif gimp gimpprint glade glgd glitz glut gmail gmp gnokii gphoto2 gpm gps graphviz gs gsl gsm gstreamer gtk gtk2 gtkhtml guile hal hardened hardenedphp hbci hdf hdf5 high-ints howl icq ide idea idled ieee1394 imagemagick imap imlib imlib2 inline ipv6 irda irmc j2ee jabber jack jack-tmpfs java javacomm javamail javascript jbig jp2 jpeg jpeg2k junit kadu-modules kadu-voice kcal kde kdepim kdexdeltas koffice-plugin lcms ldap libgd libgda libsamplerate libwww lirc live lm_sensors logrotate ltsp lzo lzw lzw-tiff mad mbox mbrola mcal md5sum memlimit mhash mikmod mime mimencode ming mixer mjpeg mmap mng monkey mozcalendar mozdevelop moznoirc mozp3p mozsvg mp3 mpeg mpeg2 mpeg4 mpi mplayer mpm-leader mpm-metux mpm-peruser mpm-prefork mpm-threadpool mpm-worker msdav msn multicall mythtv nagios-dns nagios-ntp nagios-ping nagios-ssh nas ncurses netcdf network nls no-old-linux nopri nozaptel nptl nptlonly ntlm nvidia nviz oav objc odbc offensive ofx ogg openal openexr opengl operanom2 oscar oss pam pam_timestamp parse-clocks pcap pcapnav pcntl pcre pda pdflib perl pg-hier pg-vacuumdelay php pic pie plotutils png pnp portaudio posix postgres ppds pthreads python quotes readline real remote rtc samba scanner sdl serial session shared sharedext sharedmem slang smime sms sndfile snmp snortsam soap sockets socks5 soundtouch sox speex spell spl sql ssl stats stream subversion svg sysfs sysvipc t1lib tabs tcpd tga theora threads thumbnail tidy tiff timidity tokenizer tos transcode transparent-proxy truetype truetype-fonts ttcp type1 type1-fonts underscores ups usb userlocales uudeview v4l v4l2 vcd vidix vmdbpostgres vorbis wddx wifi wma123 wmf xface xgetdefault xine xinerama xml xml2 xmlrpc xmms xosd xpm xprint xrandr xscreensaver xsl xslt xv xvid xvmc yahoo yaz yv12 zeroconf zlib zvbi userland_GNU kernel_linux libc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS [ebuild R ] sys-devel/gdb-6.3-r2 -debug +nls -test 0 kB
Further discovery yields that gcc is at fault for making "bad stuff", i.e. (and i'll update the other bug), x86_64-pc-linux-gnu-3.4.3-20050110 builds programs that are broken, they segfault and/or gdb can't debug them. Scott portage # gcc-config -l [1] x86_64-pc-linux-gnu-3.3.3 [2] x86_64-pc-linux-gnu-3.4.0 [3] x86_64-pc-linux-gnu-3.4.1 [4] x86_64-pc-linux-gnu-3.4.2 [5] x86_64-pc-linux-gnu-3.4.3-20050110 [6] x86_64-pc-linux-gnu-3.4.3-20050110-hardenednopie [7] x86_64-pc-linux-gnu-3.4.3-20050110-hardenednossp [8] x86_64-pc-linux-gnu-3.4.3-20050110-vanilla * -vanilla builds working programs
marking invalid, see bug 91283. this is a gcc issue.