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

OCAMLRUNPARAM=b backtrace is missing its innermost frame when an exception is raised from C funtion (e.g. Pervasives.=). #8442

Closed
vicuna opened this issue Jan 8, 2004 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 8, 2004

Original bug ID: 2030
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Aleksey Nogin
Version: 3.06 and 3.07+13 (2004-01-04)
OS: Red Hat Linix 7.3 and 9.0
Submission from: wasco.cs.caltech.edu (131.215.44.173)

Compare the following two testcases:

% cat temp1.ml ; ocamlc -g temp1.ml ; env OCAMLRUNPARAM=b ./a.out
let h () = raise Not_found
let _ = h ()
Fatal error: exception Not_found
Raised at file "temp1.ml", line 1, character 26
Called from file "temp1.ml", line 2, character 12

% cat temp2.ml ; ocamlc -g temp2.ml ; env OCAMLRUNPARAM=b ./a.out
let f x = x + 1
let g x = x + 2
let h () = (f = g)
let _ = h ()
Fatal error: exception Invalid_argument("equal: functional value")
Raised by primitive operation at file "temp2.ml", line 4, character 12

% ocamlc -version
3.07+13 (2004-01-04)

In the first testcase, the backtrace correctly has two frames, but in the second
case, the innermost frame is omited - the backtrace claims that the C function
was called from line 4, while in fact is was called from line 3.

P.S. If I have a longer h with the offending call somwhere in the middle (to
rule out inlining, tail-call optimizations, etc), or if I use 3.06, I still get
similar results.

@vicuna
Copy link
Author

vicuna commented May 9, 2004

Comment author: administrator

Fixed 2004-05-09 by XL

@vicuna vicuna closed this as completed May 9, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant