Bug 2130624

Summary: ../../gdb/jit.c:1278: internal-error: void jit_event_handler(gdbarch*, objfile*): Assertion `jiter->jiter_data != nullptr' failed.
Product: Red Hat Enterprise Linux 9 Reporter: Ray Strode [halfline] <rstrode>
Component: gdbAssignee: Guinevere Larsen <guinevere>
gdb sub component: system-version QA Contact: Michal Kolar <mkolar>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: gdb-bugs, keiths, ohudlick, rstrode
Version: 9.1Keywords: Bugfix, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gdb-10.2-11.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:28:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ray Strode [halfline] 2022-09-28 17:49:11 UTC
i'm using gdb-10.2-10.el9.x86_64 on a rhel 9.1 nightly and when i have breakpoints set up, sometimes gdb has an internal error like:

../../gdb/jit.c:1278: internal-error: void jit_event_handler(gdbarch*, objfile*): Assertion `jiter->jiter_data != nullptr' failed.

an example of the kind of breakpoint commands that can cause this is:

(gdb) commands
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>p rectangles[0]
>p rectangles[1]
>p rectangles[2]
>p rectangles[3]
>cont
>end

doing that after the breakpoint has been hit a few times, the assertion gets blown. This is in gnome-shell by the way which has llvmpipe running and javascript.

I've seen the issue in fedora before too, but never filed it until now.

Comment 1 Keith Seitz 2022-09-28 19:51:15 UTC
(In reply to Ray Strode [halfline] from comment #0)
> 
> ../../gdb/jit.c:1278: internal-error: void jit_event_handler(gdbarch*,
> objfile*): Assertion `jiter->jiter_data != nullptr' failed.

This may have been addressed in an upstream commit that did not make 10.2:

commit 6d1a09b77a9ab52d9fc627b8f5eb952892c81f90
Author: Tom de Vries <tdevries>
Date:   Fri May 21 15:09:14 2021 +0200

    [gdb/breakpoint] Fix assert in jit_event_handler

I imagine this is not very easy to reproduce, but I can backport the
patch and provide you with a scratch build to try out.

Is that acceptable?

Comment 2 Ray Strode [halfline] 2022-09-28 20:50:19 UTC
sure. it's not actually hard to reproduce so testing shouldn't be an issue. thanks

Comment 3 Ray Strode [halfline] 2022-09-30 13:55:41 UTC
The scratch build you provided me in email with the fix from https://gitlab.com/keiths1/gdb/-/tree/2130624-jit_event_handler-assertion works great. Thank you.

Comment 4 Michal Kolar 2023-04-27 10:33:05 UTC
Tested with gdb-10.2-11.el9.

Comment 8 Michal Kolar 2023-04-27 11:47:49 UTC
Verified with gdb-10.2-11.el9.

Comment 10 errata-xmlrpc 2023-11-07 08:28:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: gdb security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6372