This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix a crash in jit.c
- From: Simon Marchi <simark at simark dot ca>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Sun, 23 Dec 2018 10:20:36 -0500
- Subject: Re: [PATCH] Fix a crash in jit.c
- References: <20181221185415.20964-1-tom@tromey.com>
On 2018-12-21 1:54 p.m., Tom Tromey wrote:
> A user at Mozilla pointed out a crash in jit.c. In his situation, an
> inferior using the JIT API exec'd an executable that did not use it.
> This caused an assertion failure when jit.c:free_objfile_data called
> delete_breakpoint with NULL.
>
> This patch fixes the problem in the obvious way. New test case
> included.
The fix itself LGTM. Using "run" in the test, however, makes it not work
with the native-gdbserver board. Changing it to this works for me:
diff --git a/gdb/testsuite/gdb.base/jit-exec.exp b/gdb/testsuite/gdb.base/jit-exec.exp
index 74c6fa7a430f..514e01ffeaed 100644
--- a/gdb/testsuite/gdb.base/jit-exec.exp
+++ b/gdb/testsuite/gdb.base/jit-exec.exp
@@ -43,7 +43,10 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" \
clean_restart $binfile
-runto_main
-delete_breakpoints
+if ![runto_main] {
+ fail "can't run to main"
+ return
+}
+delete_breakpoints
gdb_test "continue" "Inferior .* exited normally.*"
Simon