-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remotely debugging multi-threaded bytecode program causes segmentation fault. #4538
Description
Original bug ID: 4538
Reporter: jsk
Assigned to: @damiendoligez
Status: assigned (set by @mshinwell on 2017-03-10T10:13:03Z)
Resolution: open
Priority: normal
Severity: crash
Version: 3.10.2
Target version: later
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: ogasawara jsk
Bug description
=== Operating System ===
Type: Ubuntu Linux
Version: 7.10
Platform: x86
=== OCaml Installation ===
Version: 3.10.2
Build: x86
=== Summary of Fault ===
When the attached program is compiled as a bytecode executable, remotely
debugging the program causes it to terminate with a segmentation fault,
when stepping through manually on the debugger.
=== Reproduction Steps ===
-
Compile the attached program with ocamlc:
ocamlc -custom -thread -g unix.cma threads.cma test.ml -o test.exe
-
Start ocamldebug in remote debugging mode (manual loading):
ocamldebug -s test.exe
set loadingmode manual
goto 0 -
Manually start the program (possibly on another machine):
CAML_DEBUG_SOCKET=<socket_name> ./test.exe
-
Repeatedly issue the following command to ocamldebug:
step
=== Fault Description ===
After some number of steps (different number each time), the executable
(test.exe) terminates with a "Segmentation Fault (core dumped)" message
(See the attached core dump files). Analysis of the core dumps with gdb
invariably points to the following location:
Program terminated with signal 11, Segmentation fault.
#0 0x08073570 in caml_interprete (prog=0x80ad1e8, prog_size=48680) at interp.c:284
284 curr_instr = *pc++;
(gdb) backtrace
#0 0x08073570 in caml_interprete (prog=0x80ad1e8, prog_size=48680) at interp.c:284
#1 0x0805bd3f in caml_main (argv=0xbf83daa4) at startup.c:414
#2 0x0805befb in main (argc=1, argv=0xbf83daa4) at main.c:56