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

miscompilation of the "%raise_with_backtrace" primitive. #7666

Closed
vicuna opened this issue Nov 4, 2017 · 3 comments
Closed

miscompilation of the "%raise_with_backtrace" primitive. #7666

vicuna opened this issue Nov 4, 2017 · 3 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Nov 4, 2017

Original bug ID: 7666
Reporter: @hhugo
Assigned to: @nojb
Status: resolved (set by @nojb on 2018-04-09T13:03:29Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.06.0
Category: middle end (typedtree to clambda)
Related to: #7674
Monitored by: @gasche @hcarty

Bug description

The primitive "%raise_with_backtrace" is miscompiled when not fully applied.

Introduced by:
#378

Steps to reproduce

$cat test.ml
let bt = Printexc.get_raw_backtrace ()
let f = Printexc.raise_with_backtrace Not_found
let y = f bt

$ ocamlc test.ml
File "test.ml", line 1:
Error: Error while linking test.cmo:
The external function `%raise_with_backtrace' is not available
EXIT STATUS 2

$ ocamlopt test.ml
/tmp/camlasmb473fc.s: Assembler messages:
/tmp/camlasmb473fc.s:39: Error: junk raise_with_backtrace (%rip)' after expression /tmp/camlasmb473fc.s:39: Error: missing or invalid immediate expression 25raise_with_backtrace@GOTPCREL(%rip)'
/tmp/camlasmb473fc.s:62: Error: junk raise_with_backtrace (%rip)' after expression /tmp/camlasmb473fc.s:62: Error: missing or invalid immediate expression 25raise_with_backtrace@GOTPCREL(%rip)'
File "test.ml", line 1:
Error: Assembler error, input left in file /tmp/camlasmb473fc.s
EXIT STATUS 2

@vicuna
Copy link
Author

vicuna commented Nov 5, 2017

Comment author: @nojb

I gave this one a try, see #1465.

@vicuna
Copy link
Author

vicuna commented Jan 4, 2018

Comment author: @nojb

See #1557 for a more general approach to fixing this and other primitive-related issues.

@vicuna
Copy link
Author

vicuna commented Apr 9, 2018

Comment author: @nojb

#1557 merged; issue resolved.

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

2 participants