[Bug gdb/26303] New: SIGABRT after connection to qemu

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] New: SIGABRT after connection to qemu

Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

            Bug ID: 26303
           Summary: SIGABRT after connection to qemu
           Product: gdb
           Version: 9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: feklushkin.denis at gmail dot com
  Target Milestone: ---

(gdb-multiarch from Debian Sid is also affected)

While debugging ARM running on qemu:

~/Dev/multiarch/gdb-9.2/build/gdb/gdb --init-eval-command="set architecture
armv7e-m" --init-eval-command="target remote localhost:1234"
--eval-command="break abort.c:54" firmware.elf
Python Exception <type 'exceptions.ImportError'> No module named gdb:
/home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb: warning:
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
The target architecture is assumed to be armv7e-m
Remote debugging using localhost:1234

warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
Python Exception <type 'exceptions.NameError'> Installation error:
gdb._execute_unwinders function is missing:
0x080b80de in ?? ()
Reading symbols from firmware.elf...
Python Exception <type 'exceptions.NameError'> Installation error:
gdb._execute_unwinders function is missing:
Breakpoint 1 at 0x80b80de: file
../subprojects/picolibc/newlib/libc/stdlib/abort.c, line 60.
(gdb) c
Continuing.
fish: '~/Dev/multiarch/gdb-9.2/build/g…' terminated by signal SIGABRT (Abort)


coredump and backtrace:

coredumpctl debug 18652                                                        
                                     Пн 27 июл 2020 00:28:55
           PID: 18652 (gdb)
           UID: 1000 (denizzz)
           GID: 1000 (denizzz)
        Signal: 6 (ABRT)
     Timestamp: Mon 2020-07-27 00:28:06 +07 (51s ago)
  Command Line: /home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb
--init-eval-command=set architecture armv7e-m --init-eval-command=target remote
localhost:1234 --eval-command=break abort.c:54 firmware.elf
    Executable: /home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb
 Control Group: /user.slice/user-1000.slice/session-5.scope
          Unit: session-5.scope
         Slice: user-1000.slice
       Session: 5
     Owner UID: 1000 (denizzz)
       Boot ID: 009b0c34931749cd9244f5321339ebd5
    Machine ID: cb887893853d9496b8a2532700000db3
      Hostname: denpc
       Storage:
/var/lib/systemd/coredump/core.gdb.1000.009b0c34931749cd9244f5321339ebd5.18652.1595784486000000.lz4
       Message: Process 18652 (gdb) of user 1000 dumped core.

                Stack trace of thread 18652:
                #0  0x00007ff04b6a7f61 __GI_raise (libc.so.6)
                #1  0x00007ff04b693535 __GI_abort (libc.so.6)
                #2  0x000055d16b66228d n/a
(/home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb)

GNU gdb (Debian 9.2-1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb...
bt
[New LWP 18652]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb
--init-eval-command=set archi'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: Нет такого файла или каталога.
warning: File "/home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb-gdb.gdb"
auto-loading has been declined by your `auto-load safe-path' set to
"$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path
/home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb-gdb.gdb
line to your configuration file "/home/denizzz/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/home/denizzz/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
warning: File "/home/denizzz/Dev/multiarch/gdb-9.2/build/gdb/gdb-gdb.py"
auto-loading has been declined by your `auto-load safe-path' set to
"$debugdir:$datadir/auto-load".
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ff04b693535 in __GI_abort () at abort.c:79
#2  0x000055d16b66228d in handle_sigsegv (sig=11) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/event-top.c:884
#3  <signal handler called>
#4  bfd_getl16 (p=0x55d26e67794f) at
/home/denizzz/Dev/multiarch/gdb-9.2/bfd/libbfd.c:601
#5  0x000055d16b7a5150 in read_2_bytes (abfd=<optimized out>,
buf=0x55d26e67794f <error: Cannot access memory at address 0x55d26e67794f>)
    at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:24781
#6  dwarf_parse_macro_header (opcode_definitions=0x7fff8cc1b940,
abfd=<optimized out>, mac_ptr=0x55d26e67794f <error: Cannot access memory at
address 0x55d26e67794f>,
    offset_size=0x7fff8cc1c198, section_is_gnu=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:24781
#7  0x000055d16b7acca7 in dwarf_decode_macro_bytes (cu=cu@entry=0x55d16e2fd980,
abfd=abfd@entry=0x55d16e2ff470,
    mac_ptr=mac_ptr@entry=0x55d26e67794f <error: Cannot access memory at
address 0x55d26e67794f>, mac_end=mac_end@entry=0x55d16e67a8a6 "",
    current_file=current_file@entry=0x55d16e5c8db0, lh=lh@entry=0x55d16e4ef410,
section=0x55d16e5778a0, section_is_gnu=1, section_is_dwz=0,
offset_size=<optimized out>,
    include_hash=0x55d16e50d900) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:24844
#8  0x000055d16b7ad4bf in dwarf_decode_macro_bytes (cu=cu@entry=0x55d16e2fd980,
abfd=abfd@entry=0x55d16e2ff470, mac_ptr=0x55d16e67a287 "\003",
    mac_ptr@entry=0x55d16e67a27b "\004", mac_end=mac_end@entry=0x55d16e67a8a6
"", current_file=current_file@entry=0x55d16e5c8db0, lh=lh@entry=0x55d16e4ef410,
    section=0x55d16e5778a0, section_is_gnu=1, section_is_dwz=0,
offset_size=<optimized out>, include_hash=0x55d16e50d900)
    at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:25078
#9  0x000055d16b7adbcc in dwarf_decode_macros (cu=0x55d16e2fd980, offset=10539,
section_is_gnu=1) at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:25305
#10 0x000055d16b7c93e8 in read_file_scope (cu=0x55d16e2fd980,
die=0x55d16e177af0) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:11676
#11 process_die (die=0x55d16e177af0, cu=0x55d16e2fd980) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:10665
#12 0x000055d16b7cdf78 in process_full_comp_unit (pretend_language=<optimized
out>, per_cu=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:10430
#13 process_queue (dwarf2_per_objfile=<optimized out>,
dwarf2_per_objfile=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:9674
#14 dw2_do_instantiate_symtab (per_cu=<optimized out>, skip_partial=<optimized
out>) at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:2917
#15 0x000055d16b7cf57d in dwarf2_read_symtab (self=0x55d16e5b4f90,
objfile=0x55d16e43e950) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/dwarf2read.c:9540
#16 0x000055d16b93f1e7 in psymtab_to_symtab (objfile=0x55d16e43e950,
pst=0x55d16e5b4f90) at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/psymtab.c:769
#17 0x000055d16b941a4e in psym_find_pc_sect_compunit_symtab
(objfile=0x55d16e43e950, msymbol=..., pc=<optimized out>, section=<optimized
out>, warn_if_readin=1)
    at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/psymtab.c:403
#18 0x000055d16ba31c80 in find_pc_sect_compunit_symtab (pc=135020934,
section=0x0) at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/symtab.c:2978
#19 0x000055d16b6f2f3d in blockvector_for_pc_sect (pc=pc@entry=135020934,
section=<optimized out>, pblock=pblock@entry=0x7fff8cc1d6c8,
cust=cust@entry=0x0)
    at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/block.c:193
#20 0x000055d16b6f308f in block_for_pc_sect (section=<optimized out>,
pc=135020934) at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/block.c:271
#21 block_for_pc (pc=pc@entry=135020934) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/block.c:283
#22 0x000055d16b86407e in skip_inline_frames (thread=0x55d16e2fee10,
stop_chain=stop_chain@entry=0x0) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/inline-frame.c:334
#23 0x000055d16b85fd23 in handle_signal_stop (ecs=0x7fff8cc1daf0) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/infrun.c:5642
#24 0x000055d16b8619ec in handle_inferior_event (ecs=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/infrun.c:5134
#25 0x000055d16b862633 in fetch_inferior_event (client_data=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/infrun.c:3736
#26 0x000055d16b9e909e in run_async_handler_and_reschedule (scb=0x55d16e435840)
at /home/denizzz/Dev/multiarch/gdb-9.2/gdb/ser-base.c:137
#27 0x000055d16b7dbe23 in poll_timers () at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/event-loop.c:1274
#28 gdb_do_one_event () at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/event-loop.c:316
#29 0x000055d16b7dbe7e in gdb_do_one_event () at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/event-loop.c:370
#30 start_event_loop () at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/event-loop.c:370
#31 0x000055d16b8a71ab in captured_command_loop () at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/main.c:359
#32 0x000055d16b8a8f35 in captured_main (data=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/main.c:1202
#33 gdb_main (args=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/main.c:1217
#34 0x000055d16b67786c in main (argc=<optimized out>, argv=<optimized out>) at
/home/denizzz/Dev/multiarch/gdb-9.2/gdb/gdb.c:32
(gdb) ⏎

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

Denis Feklushkin <feklushkin.denis at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|SIGABRT after connection to |SIGABRT while connected to
                   |qemu                        |qemu

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Can you share firmware.elf?
This seems to be a bug reading the macro debuginfo from that file,
so not really related to qemu at all.
Maybe there is something weird about that file.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #2 from Denis Feklushkin <feklushkin.denis at gmail dot com> ---
Created attachment 12725
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12725&action=edit
binary what causes gdb failing

How to run, cmd line:

qemu-system-arm -machine netduino2 -m 15M -nographic -kernel firmware.elf  -d
exec,unimp,guest_errors,in_asm,int,cpu_reset -D HUGE.log -semihosting -s -S

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #3 from Denis Feklushkin <feklushkin.denis at gmail dot com> ---
Requested file attached

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #4 from Denis Feklushkin <feklushkin.denis at gmail dot com> ---
If this is important, this binary built from C and D languages sources

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
It has a suspicious import in the macro section

 DW_MACRO_import - offset : 0xffffffff

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
It's easy to patch that, but of course the harder part is writing
a test case.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #7 from Denis Feklushkin <feklushkin.denis at gmail dot com> ---
> It has a suspicious import in the macro section

> DW_MACRO_import - offset : 0xffffffff

Where is it?
(Don't know GDB's internals)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-07-27
     Ever confirmed|0                           |1

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
You can see the weirdness with "readelf --debug-dump=macro".
I'll attach my patch here.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
Created attachment 12727
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12727&action=edit
the patch

Note this can't go in until I write a test case,
which is a bit of a pain because we can't yet write
custom debug_macro data from the test suite.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/26303] SIGABRT while connected to qemu

Sourceware - gdb-prs mailing list
In reply to this post by Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26303

--- Comment #10 from Tom Tromey <tromey at sourceware dot org> ---
Upstream bug: https://github.com/ldc-developers/ldc/issues/3527

--
You are receiving this mail because:
You are on the CC list for the bug.