Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Search for the smallest possible possible Ocaml segfault....
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-11-08 (16:05)
From: Alain Frisch <alain@f...>
Subject: Re: [Caml-list] Search for the smallest possible possible Ocaml segfault....
Till Varoquaux wrote:
> I have a  open bug in ocaml
> ( that leads very simply
> to a segfault. The bug has been there for more than 4 months and is
> still marked as "new". Since it seems to be stalling I thought I might
> give it a gentle prod: what is the smallest possible ocaml program you
> can come up with that leads to a reproducible segfault without using
> FFI's Obj or Marshal. Here is mine:
> Scanf.sscanf  "\"%2$c%1$s\"" "%{%c%s%}" (fun f->Printf.printf f 'x' "xy");;

Till, what a childish attitude ;-)

The following is certainly not the smallest, but it uses only the 
Pervasives module, so maybe it is cute enough to qualify for the Jury's 

a.mli = sub/a.mli: type t val x: t val f: t -> unit              type t = int let x,f = 0,print_int
sub/          type t = string let x,f = "",print_string              let r = A.x              A.f B.r;;

To be compiled with:

  ocamlc -o main a.mli sub/a.mli sub/

-- Alain