caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Segmentation fault due to uncaught type error
@ 2014-07-30 13:11 Christoph Höger
  2014-07-30 14:24 ` Jacques Garrigue
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Höger @ 2014-07-30 13:11 UTC (permalink / raw)
  To: caml-list

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear OCaml users/developers,

I am developing a rather large codebase using OCaml and somewhat
stressing the type system in the process. I already triggered a bug
which I could reproduce with a small example and reported it.

This one is different. In short: I have a test case that compiles just
fine, even though my program contains a (stupid) type error. Resulting
is a runtime crash of the generated OCaml code (while attempting to
access a record field, a computed pointer points to noman's land).

The thing is: this time, I don't see a way to reduce the code to a
smaller size. It is probably doable, but it's also likely that the
reduced code will not trigger the error. So the whole process will
probably take a long time. Time, I (unfortunately) do not have.

On the other hand, I would consider this kind of a bug a very severe
problem in any statically typed language. So I really want to help out
to track down and reproduce this bug. I just cannot do it alone.

As a first step, if anyone wants to work on this issue, I would help
out to compile the program in the first place. It has some
dependencies which could be cut-off, and others that need to be
installed. Hopefully, most deps could be removed, though.

Anyone interested?

Christoph
- -- 
Christoph Höger

Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: +49 (30) 314-24890
E-Mail: christoph.hoeger@tu-berlin.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlPY7vcACgkQhMBO4cVSGS+JuQCglLXD2Qt9SdvdndA3hGd2JVdw
iLsAn2OsG/BVHfYwmhJ2knrrX33kVHEm
=zvj1
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Segmentation fault due to uncaught type error
  2014-07-30 13:11 [Caml-list] Segmentation fault due to uncaught type error Christoph Höger
@ 2014-07-30 14:24 ` Jacques Garrigue
  2014-07-30 15:28   ` Christoph Höger
  0 siblings, 1 reply; 3+ messages in thread
From: Jacques Garrigue @ 2014-07-30 14:24 UTC (permalink / raw)
  To: Christoph Höger; +Cc: OCaML List Mailing

On 2014/07/30 22:11, Christoph Höger wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Dear OCaml users/developers,
> 
> I am developing a rather large codebase using OCaml and somewhat
> stressing the type system in the process. I already triggered a bug
> which I could reproduce with a small example and reported it.
> 
> This one is different. In short: I have a test case that compiles just
> fine, even though my program contains a (stupid) type error. Resulting
> is a runtime crash of the generated OCaml code (while attempting to
> access a record field, a computed pointer points to noman's land).
> 
> The thing is: this time, I don't see a way to reduce the code to a
> smaller size. It is probably doable, but it's also likely that the
> reduced code will not trigger the error. So the whole process will
> probably take a long time. Time, I (unfortunately) do not have.
> 
> On the other hand, I would consider this kind of a bug a very severe
> problem in any statically typed language. So I really want to help out
> to track down and reproduce this bug. I just cannot do it alone.
> 
> As a first step, if anyone wants to work on this issue, I would help
> out to compile the program in the first place. It has some
> dependencies which could be cut-off, and others that need to be
> installed. Hopefully, most deps could be removed, though.
> 
> Anyone interested?
> 
> Christoph


If there is really a bug in the compiler, this is indeed bad.
This happens once in a while, and we fix that as soon as possible.
A good idea would be to check with a recent version of the compiler,
for instance the current state of the 4.02 branch, which is now pretty stable.

  svn co http://caml.inria.fr/svn/ocaml/version/4.02

Otherwise, if you know what the type error should be, you can try to explain it with
a snippet of code. Sometimes what the type should be is not so clear :-)

And bug reports go to the bug tracking system.
  http://caml.inria.fr/mantis/
It’s better if you can cut it down to something understandable, but if you can’t
we’ll still look into it.

Jacques Garrigue


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Segmentation fault due to uncaught type error
  2014-07-30 14:24 ` Jacques Garrigue
@ 2014-07-30 15:28   ` Christoph Höger
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Höger @ 2014-07-30 15:28 UTC (permalink / raw)
  To: caml-list

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 30.07.2014 16:24, schrieb Jacques Garrigue:

> If there is really a bug in the compiler, this is indeed bad. This 
> happens once in a while, and we fix that as soon as possible. A 
> good idea would be to check with a recent version of the compiler, 
> for instance the current state of the 4.02 branch, which is now 
> pretty stable.
> 
> svn co http://caml.inria.fr/svn/ocaml/version/4.02

I am going to give it a try. Should be a no-brainer with opam.

> Otherwise, if you know what the type error should be, you can try 
> to explain it with a snippet of code. Sometimes what the type 
> should be is not so clear :-)

Hmm. Basically, I am using a lense like this:

let state = { get = (fun a -> a#get_sim_state) ; set = fun a b ->
b#set_sim_state a }

In one point of the program, I am using it to get an option, in
another I (and that's the error) use it to get the record directly.
Then I feed the program with an object that delivers a option (i.e.
get_sim_state yields an option of the state record) and the
typechecker accepts that.

The program is here:

https://github.com/AMSUN-Berlin/ocsimrun/tree/typecheck_bug

The relevant bits are in sim.ml and simTests.ml (and maybe monads.ml).

I have removed all dependencies that are complicated to install. The
rest should be a simple opam install ... && oasis setup && ./configure
&& make

> And bug reports go to the bug tracking system. 
> http://caml.inria.fr/mantis/ It’s better if you can cut it down to 
> something understandable, but if you can’t we’ll still look into 
> it.

Good to hear.


- -- 
Christoph Höger

Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: +49 (30) 314-24890
E-Mail: christoph.hoeger@tu-berlin.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlPZDwUACgkQhMBO4cVSGS/TGwCePh6rx4OI7uWnYieDjibP3Avc
cZQAoLJMQNpXYUK77fTX6TnZh5KiXMQ4
=QSvy
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-30 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-30 13:11 [Caml-list] Segmentation fault due to uncaught type error Christoph Höger
2014-07-30 14:24 ` Jacques Garrigue
2014-07-30 15:28   ` Christoph Höger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).