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

Functions not showing up in backtrace, even with calls to Sys.opaque #3

Open
EkanshdeepGupta opened this issue May 5, 2024 · 0 comments

Comments

@EkanshdeepGupta
Copy link
Collaborator

EkanshdeepGupta commented May 5, 2024

Inserting calls to Sys.opaque is not working as expected. I made a branch, ppx_monad which you can checkout to see this issue: 6820184

The change is as follows: in the function Frontend.Typing.ProcessModule.process_module, the following tail:
let* x = y in z

was replaced by:
let __ret__ = (let* x = y in z ) |> Sys.opaque in Sys.opaque __ret__

However, even so, when running the following command:

git checkout origin/ppx_monad
dune build; dune exec -- raven test/bugs/interface_module_dep.rav --verbosity=debug

The backtrace I got was the following:

Raised at Util__Error.fail in file "lib/util/error.ml", line 31, characters 36-63
Called from Ast__SymbolTbl.add_symbol.add.(fun) in file "lib/ast/symbolTbl.ml", line 422, characters 52-102
Called from Base__List0.rev_map2_ok.rmap2_f in file "src/list0.ml", line 96, characters 39-46
Called from Base__List0.rev_map2_ok.(fun) in file "src/list0.ml" (inlined), line 99, characters 47-65
.
.
.
Called from Base__List.fold_map.(fun) in file "src/list.ml", line 524, characters 23-31
Called from Base__List.count_map in file "src/list.ml", line 494, characters 13-17
Called from Base__List.map in file "src/list.ml" (inlined), line 510, characters 15-31
Called from Base__List.fold_map in file "src/list.ml", line 523, characters 4-88
Called from Ast__Rewriter.Syntax.Let_syntax.map in file "lib/ast/rewriter.ml", line 31, characters 22-27
Called from Frontend__Typing.process_module.(fun) in file "lib/frontend/typing.ml", line 1875, characters 16-49
Called from Ast__Rewriter.eval in file "lib/ast/rewriter.ml", line 60, characters 18-23
Called from Frontend__Typing.process_module in file "lib/frontend/typing.ml", line 1873, characters 15-201
Called from Dune__exe__Raven.parse_and_check_cu in file "bin/raven.ml", line 28, characters 26-55
Called from Dune__exe__Raven.parse_and_check_all.(fun) in file "bin/raven.ml", line 66, characters 27-103
Called from Base__List0.fold in file "src/list0.ml", line 37, characters 27-37
Called from Dune__exe__Raven.parse_and_check_all in file "bin/raven.ml", line 61, characters 4-491
Called from Dune__exe__Raven.main in file "bin/raven.ml", line 124, characters 10-43

Note that there is a reference to Frontend__Typing.process_module (typing.ml: line 1875), but no Frontend__Typing.ProcessModule.process_module which is called from line 1875 (the names are confusing but there are two process_module functions). Somehow, even after this "rewrite", the function is still not showing up in the backtrace.

I'm using Ocaml 4.14.0

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

When branches are created from issues, their pull requests are automatically linked.

1 participant