This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

symtab/1410: ELF32


>Number:         1410
>Category:       symtab
>Synopsis:       ELF32
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 07 08:08:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     ken.tsukahara@tmt-d.co.jp
>Release:        GNU gdb 6.0
>Organization:
>Environment:
RedHat Linux 9
Linux pc1 2.4.20-20.9smp #1 SMP Mon Aug 18 11:32:15 EDT 2003 i686 i686 i386 GNU/Linux
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
>Description:
Recent gdb does not create correct ELF32 file.
Neither gdb-5.3post-0.20021129.18 nor 6.0 .
(1) set write on
(2) load an ELF32 executable
(3) set value of an global variable
(4) quit
(5) always dumps core (SIGSEGV)

backtrace of the core is here. it seems very strange that tab value is NULL.

#0  0x0817152e in _bfd_elf_strtab_emit (abfd=0x8284108, tab=0x0) at elf-strtab.c:256
256       for (i = 1; i < tab->size; ++i)
(gdb) bt
#0  0x0817152e in _bfd_elf_strtab_emit (abfd=0x8284108, tab=0x0) at elf-strtab.c:256
#1  0x0816b504 in _bfd_elf_write_object_contents (abfd=0x8284108) at elf.c:4459
#2  0x08151c7c in bfd_close (abfd=0x8284108) at opncls.c:425
#3  0x080e1a4d in exec_close (quitting=1) at exec.c:145
#4  0x080f88e7 in quit_target (arg=0xbffff1f8) at top.c:1718
#5  0x080f7272 in do_catch_errors (uiout=0x8271d80, data=0x0) at top.c:497
#6  0x080f71d8 in catcher (func=0x80f7264 <do_catch_errors>, func_uiout=0x8271d80,
    func_args=0xbffff1d0, func_val=0xbffff1c8, func_caught=0xbffff1cc, errstring=0x0, mask=6)
    at top.c:429
#7  0x080f72a8 in catch_errors (func=0, func_args=0x0, errstring=0x81efc2e "Quitting: ", mask=6)
    at top.c:509
#8  0x080f896d in quit_force (args=0x0, from_tty=0) at top.c:1750
#9  0x080799c2 in do_cfunc (c=0x0, args=0x0, from_tty=1) at cli/cli-decode.c:53
#10 0x0807b296 in cmd_func (cmd=0x827cb40, args=0x0, from_tty=1) at cli/cli-decode.c:1537
#11 0x080f75a2 in execute_command (p=0x82568fc "", from_tty=1) at top.c:716
#12 0x080bdcbd in command_handler (command=0x82568f8 "quit") at event-top.c:500
#13 0x080be0e4 in command_line_handler (rl=0x82687f0 "&#29562;207&\b") at event-top.c:793
#14 0x081a0975 in rl_callback_read_char () at callback.c:123
#15 0x080bd677 in rl_callback_read_char_wrapper (client_data=0x0) at event-top.c:166
#16 0x080bdbca in stdin_event_handler (error=0, client_data=0x0) at event-top.c:416
#17 0x080bd0a3 in handle_file_event (event_file_desc=1) at event-loop.c:721
#18 0x080bcd0c in process_event () at event-loop.c:334
#19 0x080bcd54 in gdb_do_one_event (data=0x0) at event-loop.c:371
#20 0x080f7272 in do_catch_errors (uiout=0x8271d80, data=0x0) at top.c:497
#21 0x080f71d8 in catcher (func=0x80f7264 <do_catch_errors>, func_uiout=0x8271d80,
    func_args=0xbffff4e0, func_val=0xbffff4d8, func_caught=0xbffff4dc, errstring=0x0, mask=6)
    at top.c:429
#22 0x080f72a8 in catch_errors (func=0, func_args=0x0, errstring=0x81b5a57 "", mask=6) at top.c:509
#23 0x080bcd77 in start_event_loop () at event-loop.c:397
#24 0x08077a47 in captured_command_loop (data=0x0) at main.c:97
#25 0x080f7272 in do_catch_errors (uiout=0x8271d80, data=0x0) at top.c:497
#26 0x080f71d8 in catcher (func=0x80f7264 <do_catch_errors>, func_uiout=0x8271d80,
    func_args=0xbffff660, func_val=0xbffff658, func_caught=0xbffff65c, errstring=0x0, mask=6)
    at top.c:429
#27 0x080f72a8 in catch_errors (func=0, func_args=0x0, errstring=0x81b5a57 "", mask=6) at top.c:509
#28 0x08078532 in captured_main (data=0x0) at main.c:811
#29 0x080f7272 in do_catch_errors (uiout=0x8233440, data=0x0) at top.c:497
#30 0x080f71d8 in catcher (func=0x80f7264 <do_catch_errors>, func_uiout=0x8233440,
    func_args=0xbffff910, func_val=0xbffff908, func_caught=0xbffff90c, errstring=0x0, mask=6)
    at top.c:429
#31 0x080f72a8 in catch_errors (func=0, func_args=0x0, errstring=0x81b5a57 "", mask=6) at top.c:509
#32 0x08078647 in gdb_main (args=0x1) at main.c:820
#33 0x08077a37 in main (argc=0, argv=0x0) at gdb.c:35
>How-To-Repeat:
sample1.c :
#include <stdio.h>
int  symbol1 = 0;
int  symbol2 = 0;
int main(int argc, char** argv)
{
    symbol1 = 1;
    symbol2 = 2;
    printf("symbol1 = %d\n", symbol1);
    printf("symbol2 = %d\n", symbol2);
    return 0;
}
---
$ gcc sample1.c -o sample1
$ gdb
GNU gdb 6.0
Copyright 2003 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 "i686-pc-linux-gnu".
(gdb) set write on
(gdb) file sample1
Reading symbols from sample1...done.
(gdb) set symbol1=1
(gdb) quit
Segmentation fault (core dumped)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]