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

ocamlopt.opt fails with Fatal error: Cmmgen.transl_prim_1 #7167

Closed
vicuna opened this issue Mar 7, 2016 · 3 comments
Closed

ocamlopt.opt fails with Fatal error: Cmmgen.transl_prim_1 #7167

vicuna opened this issue Mar 7, 2016 · 3 comments
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Mar 7, 2016

Original bug ID: 7167
Reporter: @kayceesrk
Status: closed (set by @mshinwell on 2016-12-07T15:50:34Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 4.02.3
Target version: 4.03.1+dev
Category: ~DO NOT USE (was: OCaml general)
Tags: afl
Monitored by: @kayceesrk @gasche

Bug description

Another crash found with afl-instrumented ocamlopt.opt (See #7165).

Steps to reproduce

$ ocamlopt.opt crash_22909_40.ml
File "/tmp/afl_crashes/crash_22909_40.ml", line 28, characters 11-12:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 29, characters 11-17:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 29, characters 16-17:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 30, characters 11-17:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 30, characters 16-17:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 31, characters 11-22:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 31, characters 16-22:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 31, characters 21-22:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 32, characters 15-44:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 32, characters 20-44:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 32, characters 25-44:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 32, characters 34-44:
Warning 20: this argument will not be used by the function.
File "/tmp/afl_crashes/crash_22909_40.ml", line 32, characters 43-44:
Warning 20: this argument will not be used by the function.

Fatal error: Cmmgen.transl_prim_1
Fatal error: exception Misc.Fatal_error

File attachments

@vicuna
Copy link
Author

vicuna commented Mar 7, 2016

Comment author: @mshinwell

I am looking at this.

@vicuna
Copy link
Author

vicuna commented Mar 7, 2016

Comment author: @mshinwell

This fails with Flambda as well, but earlier, with a different error.

The problem is that an application of %apply gets generated with the wrong arity.

Leo and I discussed this. It could be fixed by checking in Translcore, for actual applications of primitives (rather than any eta-expanded versions), whether the arity is as expected. A proper error could then be emitted. There is precedent for emitting proper errors from Translcore.

@vicuna
Copy link
Author

vicuna commented Dec 7, 2016

Comment author: @mshinwell

As per another recently-closed Mantis issue: just be careful to generate applications of % primitives properly, if you must use them.

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added this to the 4.03.1 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 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