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

Ocaml infers incorrect type of library function, allowing user to write code that segfaults #7095

Closed
vicuna opened this issue Dec 16, 2015 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Dec 16, 2015

Original bug ID: 7095
Reporter: jura
Status: closed (set by @gasche on 2015-12-16T06:08:16Z)
Resolution: not a bug
Priority: normal
Severity: crash
Platform: x86_64GNU/Linux3.13.0-66-generic
OS: Ubuntu
OS Version: 14.04
Version: 4.02.3
Category: typing
Tags: suggest_closing

Bug description

The library "otto.0.0.1".
The inferred type for a library function is incorrect. In particular, it allows a user to write a program that type-checks but segfaults.git clone

Steps to reproduce

https://github.com/jrraymond/otto.git
cd otto
git checkout 4a578aa
ocaml setup.ml -configure
ocaml setup.ml -build
ocaml setup.ml -install
cd ../
mkdir temp
cd temp
#paste the example code in bug.ml

ocamlbuild -use-ocamlfind -pkg otto bug.native
./bug.native
Segmentation fault (core dumped)
.
.
.
cd otto
ocaml setup.ml -uninstall

File attachments

@vicuna
Copy link
Author

vicuna commented Dec 16, 2015

Comment author: @sliquister

Looking quickly, I'm guessing the library is broken. It uses marshal without enough type annotations and so the types are wrong.

@vicuna
Copy link
Author

vicuna commented Dec 16, 2015

Comment author: jura

I believe you are correct. I recommend closing the issue.

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

1 participant