From:
[email protected]
Package: gdb
Version: 6.1-3
If I try to patch shared object file, gdb will segfault at quit time.
Here is a short test case.
# cat a.c
short buf[256] = {
[0x01] = 0x1234,
};
# cc -c -o a.o a.c
# cc -shared -o a.so a.o
# gdb /usr/bin/gdb
GNU gdb 6.1-debian
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-linux"...(no debugging symbols found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) run
Starting program: /usr/bin/gdb
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...GNU gdb 6.1-debian 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-linux".
(gdb) set write on
(gdb) file a.so
Reading symbols from a.so...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) exec-file a.so
(gdb) x/xh ((short*)&buf+1)
0x16e2 <buf+2>: 0x1234
(gdb) set {short}((short*)&buf+1) = 0x0
(gdb) x/xh ((short*)&buf+1)
0x16e2 <buf+2>: 0x0000
(gdb) quit
Program received signal SIGSEGV, Segmentation fault.
0x081a6108 in _bfd_elf_strtab_emit ()
(gdb) bt
#0 0x081a6108 in _bfd_elf_strtab_emit ()
#1 0x0819ee53 in _bfd_elf_write_object_contents ()
#2 0x08182e50 in bfd_close ()
#3 0x0807522c in exec_open ()
#4 0x0811f085 in target_close ()
#5 0x08079fd5 in quit_confirm ()
#6 0x08078bd1 in catch_exceptions_with_msg ()
#7 0x08078a50 in throw_exception ()
#8 0x08078c30 in catch_errors ()
#9 0x0807a075 in quit_force ()
#10 0x080a7c59 in _initialize_cli_dump ()
#11 0x080a9b4c in cmd_func ()
#12 0x08078fa6 in execute_command ()
#13 0x08105d3f in async_disable_stdin ()
#14 0x00000001 in ?? ()
#15 0x082a50b8 in ?? ()
#16 0x40045227 in add_history () from /lib/libreadline.so.4
Previous frame inner to this frame (corrupt stack?)
(gdb)
Regards,
Fumitoshi UKAI
--
To UNSUBSCRIBE, email to
[email protected]
with a subject of "unsubscribe". Trouble? Contact
[email protected]
--- SoupGate-Win32 v1.05
* Origin: you cannot sedate... all the things you hate (1:229/2)