Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash/segmentation fault on x86_32 for a simple program #4297
Original bug ID: 4297
This seems similar to #4235 but this issue doesn't seem to be fixed in 3.10.0.
The attached test.ml crashes with a segmentation fault on my system when compiled using:
ocamlopt -o test test.ml
The same code works when compiled with ocamlc. I have this problem with both 3.09.3 and 3.10.0 (final installed from http://rpmbin.nogin.org/MetaPRL/RHEL-5/).
The attached test_works.ml does almost exactly the same thing and works without issue.
Comment author: @xavierleroy
For the record: the Stack_overflow exception is generated when f overflows the system stack. But then, f returns, calls get_it, which calls the C primitive compare_val, and since the system stack is still very nearly full, compare_val overflows the stack. Stack overflows within C code is not turned into an exception, and I believe it is essentially impossible to do so safely.