public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/29277] New: jit_event_handler: Assertion `jiter->jiter_data != nullptr' failed with separate debug files
@ 2022-06-22 19:20 guillaume at morinfr dot org
  2022-06-23 13:44 ` [Bug breakpoints/29277] " vries at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: guillaume at morinfr dot org @ 2022-06-22 19:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29277

            Bug ID: 29277
           Summary: jit_event_handler: Assertion `jiter->jiter_data !=
                    nullptr' failed with separate debug files
           Product: gdb
           Version: 12.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: guillaume at morinfr dot org
  Target Milestone: ---

Similar to https://sourceware.org/bugzilla/show_bug.cgi?id=27889, we are
hitting the same assertion handler with separate debug files.

This is just by running the program. No bp set but it does crash in the
breakpoint code:

----- Backtrace -----                                                           
0x55c94740570e gdb_internal_backtrace_1                                         
        /usr/scratch/tmp/gdb-12.1/gdb/bt-utils.c:122                            
0x55c9474057b6 _Z22gdb_internal_backtracev                                      
        /usr/scratch/tmp/gdb-12.1/gdb/bt-utils.c:168                            
0x55c9479240d6 internal_vproblem                                                
        /usr/scratch/tmp/gdb-12.1/gdb/utils.c:394                               
0x55c947924409 _Z15internal_verrorPKciS0_P13__va_list_tag                       
        /usr/scratch/tmp/gdb-12.1/gdb/utils.c:471                               
0x55c947a87bcc _Z14internal_errorPKciS0_z                                       
        /usr/scratch/tmp/gdb-12.1/gdbsupport/errors.cc:55                       
0x55c94766927a _Z17jit_event_handlerP7gdbarchP7objfile                          
        /usr/scratch/tmp/gdb-12.1/gdb/jit.c:1252                                
0x55c9473d2a40 handle_jit_event                                                 
        /usr/scratch/tmp/gdb-12.1/gdb/breakpoint.c:5552                         
0x55c9473d2dbd _Z20bpstat_run_callbacksP6bpstat                                 
        /usr/scratch/tmp/gdb-12.1/gdb/breakpoint.c:5753                         
0x55c947650b18 process_event_stop_test                                          
        /usr/scratch/tmp/gdb-12.1/gdb/infrun.c:6452                             
0x55c9476509ed handle_signal_stop                                               
        /usr/scratch/tmp/gdb-12.1/gdb/infrun.c:6420
0x55c94764ed12 handle_inferior_event
        /usr/scratch/tmp/gdb-12.1/gdb/infrun.c:5681
0x55c94764ac59 _Z20fetch_inferior_eventv
        /usr/scratch/tmp/gdb-12.1/gdb/infrun.c:4085
0x55c94762b0bb _Z22inferior_event_handler19inferior_event_type
        /usr/scratch/tmp/gdb-12.1/gdb/inf-loop.c:41
0x55c947690fbf handle_target_event
        /usr/scratch/tmp/gdb-12.1/gdb/linux-nat.c:4154
0x55c947a889e1 handle_file_event
        /usr/scratch/tmp/gdb-12.1/gdbsupport/event-loop.cc:574
0x55c947a88f80 gdb_wait_for_event
        /usr/scratch/tmp/gdb-12.1/gdbsupport/event-loop.cc:700
0x55c947a87d00 _Z16gdb_do_one_eventv
        /usr/scratch/tmp/gdb-12.1/gdbsupport/event-loop.cc:212
0x55c9476be153 start_event_loop
        /usr/scratch/tmp/gdb-12.1/gdb/main.c:421
0x55c9476be287 captured_command_loop
        /usr/scratch/tmp/gdb-12.1/gdb/main.c:481
0x55c9476bfd5f captured_main
        /usr/scratch/tmp/gdb-12.1/gdb/main.c:1351
0x55c9476bfdc5 _Z8gdb_mainP18captured_main_args
        /usr/scratch/tmp/gdb-12.1/gdb/main.c:1366
0x55c9473071fe main
        /usr/scratch/tmp/gdb-12.1/gdb/gdb.c:32

The objfile is:
p  *jit_bp_sym.objfile
$2 = {original_name = 0x55c94a129950
"build-id/cb/38660bc052d7379d50faef77e2dec1.debug", addr_low = 0, flags =
{m_enum_value = (OBJF_REORDERED | OBJF_PSYMTABS_READ | OBJF_MAINLINE)},
  pspace = 0x55c949e5a8b0, compunit_symtabs = 0x55c94aea7cc0, obfd =
0x55c94a076e50, per_bfd = 0x55c94a0e7760, mtime = 1655843985, objfile_obstack =
{chunk_size = 4064, chunk = 0x55c94f504a10,
    object_base = 0x55c94f508f90 "", next_free = 0x55c94f508f90 "", chunk_limit
= 0x55c94f508fdb "", temp = {i = 0, p = 0x0}, alignment_mask = 15, chunkfun =
{plain = 0x55c9473716d4 <xmalloc(size_t)>,
    extra = 0x55c9473716d4 <xmalloc(size_t)>}, freefun = {plain =
0x55c94772b7d2 <xfree<void>(void*)>, extra = 0x55c94772b7d2
<xfree<void>(void*)>}, extra_arg = 0x0, use_extra_arg = 0, maybe_empty_object =
0,
    alloc_failed = 0}, sf = 0x55c947f5f5e0 <elf_sym_fns>, qf =
std::forward_list = {[0] = std::unique_ptr<quick_symbol_functions> = {get() =
0x55c94a109de0}}, registry_data = {data = 0x55c94a12ac00,
    num_data = 21}, section_offsets = std::vector of length 46, capacity 46 =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0}, sect_index_text = 12, sect_index_data = 28, sect_index_bss = 31,
sect_index_rodata = 15, sections = 0x55c94a1299a0, sections_end =
0x55c94a129df0, separate_debug_objfile = 0x0,
  separate_debug_objfile_backlink = 0x55c94a024d80, separate_debug_objfile_link
= 0x0, stats = {n_syms = 34783, n_stabs = 0, n_types = 31535, sz_strtab = 0},
template_symbols = 0x55c94f402c90,
  static_links = std::unique_ptr<htab> = {get() = 0x0}, jiter_data =
std::unique_ptr<jiter_objfile_data> = {get() = 0x0}, jited_data =
std::unique_ptr<jited_objfile_data> = {get() = 0x0},
  skip_jit_symbol_lookup = false}

A member of our team suggested here that the code should be calling
jit_event_handler should be called with the
jit_bp_sym.objfile->separate_debug_objfile_backlink if it is set.  With this
change, gdb does not crash anymore but we're unfamiliar with the gdb code so
this might be incorrect.

Thanks in advance.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-12-16 15:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22 19:20 [Bug breakpoints/29277] New: jit_event_handler: Assertion `jiter->jiter_data != nullptr' failed with separate debug files guillaume at morinfr dot org
2022-06-23 13:44 ` [Bug breakpoints/29277] " vries at gcc dot gnu.org
2022-06-27 14:06 ` hector.oron at gmail dot com
2022-07-19 14:23 ` vries at gcc dot gnu.org
2022-08-01 13:46 ` schwab@linux-m68k.org
2022-08-01 15:55 ` vries at gcc dot gnu.org
2022-08-01 15:56 ` vries at gcc dot gnu.org
2022-08-01 16:46 ` vries at gcc dot gnu.org
2022-10-13 13:40 ` vries at gcc dot gnu.org
2023-12-16 15:24 ` ssbssa at sourceware dot org
2023-12-16 15:36 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).