Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash/segmentation fault on x86_32 for a simple program #4297

Closed
vicuna opened this issue May 24, 2007 · 3 comments
Closed

Crash/segmentation fault on x86_32 for a simple program #4297

vicuna opened this issue May 24, 2007 · 3 comments

Comments

@vicuna
Copy link

vicuna commented May 24, 2007

Original bug ID: 4297
Reporter: @hcarty
Assigned to: ertai
Status: closed (set by @xavierleroy on 2008-08-07T12:30:59Z)
Resolution: won't fix
Priority: normal
Severity: crash
Version: 3.10.0
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #5064
Monitored by: @hcarty

Bug description

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.

File attachments

@vicuna
Copy link
Author

vicuna commented May 24, 2007

Comment author: @hcarty

This is the working version of the same code. No segfault on either 3.09.3 or 3.10.0.

The system I'm testing this on is running CentOS 5, Linux kernel 2.6.18 x86_32. Pentium-M processor, so just no SMP.

@vicuna
Copy link
Author

vicuna commented May 24, 2007

Comment author: @hcarty

This is my fault. I found the error. Apparently there is no Stack_overflow exception generated by test.ml on x86_32 native code.

@vicuna
Copy link
Author

vicuna commented Aug 7, 2008

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant