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

0-ary function application miscompiles and segfaults ocamlrun #6424

vicuna opened this issue May 15, 2014 · 2 comments


None yet
2 participants
Copy link

commented May 15, 2014

Original bug ID: 6424
Reporter: @whitequark
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:27:52Z)
Resolution: fixed
Priority: normal
Severity: crash
Target version: 4.02.0+dev
Category: typing
Related to: #6388
Monitored by: @hcarty

Bug description

While playing with ppx, I accidentally produced some 0-ary function applications. They successfully pass -dsource, typechecker, ocamlc bytecode backend and sometimes result in a segmentation fault in ocamlrun, like this:

As I've said, they segfault sometimes, which is why writing a minimal testcase proved hard. However, I have a branch of ppx_protobuf whose testsuite reliably crashes.

Steps to reproduce

git clone git://
cd ocaml-ppx_protobuf
git checkout ocaml-miscompile
./configure --enable-tests
make test


This comment has been minimized.

Copy link

commented May 16, 2014

Comment author: @alainfrisch

Indeed, we should make the compiler much more robust by checking invariants on the Parsetree which are assumed and currently enforced by the parser (but not by -pp / -ppx). This is one more instance of it.


This comment has been minimized.

Copy link

commented Jun 3, 2014

Comment author: @alainfrisch

Fixed by commit 14948 on 4.02.

@vicuna vicuna closed this Dec 11, 2015

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added this to the 4.02.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.