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

Closed
vicuna opened this issue May 15, 2014 · 2 comments
Closed

0-ary function application miscompiles and segfaults ocamlrun #6424

vicuna opened this issue May 15, 2014 · 2 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna 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: https://gist.github.com/whitequark/558574ce2f5be4550215

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://github.com/whitequark/ocaml-ppx_protobuf
cd ocaml-ppx_protobuf
git checkout ocaml-miscompile
./configure --enable-tests
make test

@vicuna
Copy link
Author

vicuna 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.

@vicuna
Copy link
Author

vicuna commented Jun 3, 2014

Comment author: @alainfrisch

Fixed by commit 14948 on 4.02.

@vicuna vicuna closed this as completed 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
avsm pushed a commit to avsm/ocaml that referenced this issue Jun 21, 2020
… of arguments in function applications.

git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@14948 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants