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 Index out of bounds error when compiling empty external value #7170

vicuna opened this Issue Mar 9, 2016 · 1 comment


None yet
2 participants
Copy link

vicuna commented Mar 9, 2016

Original bug ID: 7170
Reporter: @kayceesrk
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-09-24T15:32:03Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.02.3
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Tags: afl
Monitored by: @gasche @hcarty

Bug description

Compiling the program

external foo : 'a = ""

crashes ocamlopt.opt with Fatal error: exception Invalid_argument("index out of bounds"). The bug was found by fuzzing afl-instrumented ocamlopt.opt.

Steps to reproduce

$ cat
external foo : 'a = ""
$ ocamlopt.opt
Fatal error: exception Invalid_argument("index out of bounds")
$ OCAMLRUNPARAM="b" ocamlopt.opt
Fatal error: exception Invalid_argument("index out of bounds")
Called from file "", line 214, characters 2-73


This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Mar 14, 2016

Comment author: @alainfrisch

I cannot reproduce the error with 4.03; I now get:

Error: External identifiers must be functions

This was apparently fixed by 77bc51f (" Avoid an index-out-of-bound fatal error when the primitive name is empty").

@vicuna vicuna closed this Sep 24, 2017

@vicuna vicuna added this to the 4.03.0 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
You can’t perform that action at this time.