OCaml Forge
SCM

Detail: [#1290] execinfo segfault with ocaml 4.00 on i386

Bugs: Browse | Download .csv | Monitor

[#1290] execinfo segfault with ocaml 4.00 on i386

Date:
2013-06-19 12:05
Priority:
3
State:
Closed
Submitted by:
Hendrik Tews (hendrik_tews)
Assigned to:
ygrek (ygrek)
Resolution:
Fixed
Severity:
None
Hardware:
None
 
Operating System:
Version:
 
URL:
Summary:
execinfo segfault with ocaml 4.00 on i386

Detailed description
Hi,

for me the execinfo test produces a segmentation fault with OCaml
4.00 on i386. I see

PD ocaml-extunix-0.0.6 109> _build/test/test.native -only-test tests:10:execinfo -verbose
[some output deleted]
tests:9:pts ...
SKIP
execinfo start
Segmentation fault (core dumped)

after adding "execinfo start" and end markers. Can you reproduce
this?

Bye,

Hendrik

Followup

Message
Date: 2013-07-11 08:10
Sender: ygrek

fixed in 8d892efab51ed25c5c3ab2ec27ba3f6dd5c3f642
Date: 2013-07-09 09:21
Sender: ygrek

I think it is the same bug (glibc one). backtrace is called correctly, but it segfaults. ExtUnix is a thin wrapper, so if glibc wants to segfault - not much we can do. Probably warrants a documentation note - glibc cannot always unwind stack with ocaml frames in it on all architectures so this function is quite unsafe, test case happens to be just lucky. I will drop the execinfo test and add a warning in docs. Thanks for investigating this!
Date: 2013-07-09 08:19
Sender: Hendrik Tews

running in gdb gives

tests:9:pts ...
SKIP
execinfo start

Program received signal SIGSEGV, Segmentation fault.
0xb7c68390 in ?? () from /lib/i386-linux-gnu/libgcc_s.so.1
(gdb) bt
#0 0xb7c68390 in ?? () from /lib/i386-linux-gnu/libgcc_s.so.1
#1 0xb7c69493 in _Unwind_Backtrace () from /lib/i386-linux-gnu/libgcc_s.so.1
#2 0xb7f05ee5 in backtrace () from /lib/i386-linux-gnu/libc.so.6
#3 0x080868da in caml_extunix_backtrace ()
#4 0x0804eac0 in camlTest__test_execinfo_1920 () at test/test.ml:194
#5 0x0804d86c in camlTest__fun_2310 () at test/test.ml:517
#6 0x0804d927 in camlTest__with_unix_error_1851 () at test/test.ml:6
#7 0x08060607 in camlOUnit__run_test_case_1357 () at src/oUnit.ml:597
#8 0x080606d1 in camlOUnit__run_test_1364 () at src/oUnit.ml:618
#9 0x0805fff3 in camlOUnit__rfold_lefti_1176 () at src/oUnit.ml:412
#10 0x08061701 in camlOUnit__time_fun_1375 () at src/oUnit.ml:646
#11 0x08061862 in camlOUnit__run_test_tt_1380 () at src/oUnit.ml:697
#12 0x08061cbe in camlOUnit__run_test_tt_main_1401 () at src/oUnit.ml:776
#13 0x08051400 in camlTest__entry () at test/test.ml:550
#14 0x0804ba89 in caml_program ()
#15 0x080a1332 in caml_start_program ()
#16 0x08091218 in caml_main ()
#17 0x0809125a in main ()
(gdb)


When I try the test case in
http://caml.inria.fr/mantis/view.php?id=5334 I get

PD 5334 60> ocamlopt backtrace.c main.ml && ./a.out; echo $?
10
PD 5334 61> ocamlc -custom backtrace.c main.ml && ./a.out; echo $?
7

and for the test case in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637360 I get

PD 5334 59> gcc -Wall a.c; ./a.out ; echo $?
3

So, it does not seem any of the known issues.

Bye,

Hendrik
Date: 2013-07-06 21:23
Sender: Goswin Brederlow, von

Not reproducible on amd64.

But could be related to:
http://caml.inria.fr/mantis/view.php?id=5334


Could you run it in gdb and get a backtrace of where it crashes?

Attached Files:

Changes:

Field Old Value Date By
status_idOpen2013-07-11 08:10ygrek
close_dateNone2013-07-11 08:10ygrek
ResolutionNone2013-07-11 08:10ygrek
assigned_tonone2013-07-09 09:21ygrek