This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [PATCH] Fix a crash in jit.c


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


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