From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 3B243BC6B for ; Thu, 8 Nov 2007 17:05:42 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPPCMkfAXQInh2dsb2JhbACPAAEBAQgKKYEP X-IronPort-AV: E=Sophos;i="4.21,389,1188770400"; d="scan'208";a="5591956" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Nov 2007 17:05:42 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id lA8G5fgH022134 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 8 Nov 2007 17:05:41 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAI3CMkdQDPISlmdsb2JhbACPAAEBAQEHAggiB4EP X-IronPort-AV: E=Sophos;i="4.21,389,1188770400"; d="scan'208";a="4205340" Received: from smtp19.orange.fr ([80.12.242.18]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Nov 2007 17:05:41 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1926.orange.fr (SMTP Server) with ESMTP id 0FB841C00092 for ; Thu, 8 Nov 2007 17:05:41 +0100 (CET) Received: from [192.168.1.59] (APuteaux-154-1-51-194.w81-249.abo.wanadoo.fr [81.249.2.194]) by mwinf1926.orange.fr (SMTP Server) with ESMTP id D8B6A1C0008E; Thu, 8 Nov 2007 17:05:40 +0100 (CET) X-ME-UUID: 20071108160540887.D8B6A1C0008E@mwinf1926.orange.fr Message-ID: <473333D0.3040807@frisch.fr> Date: Thu, 08 Nov 2007 17:05:36 +0100 From: Alain Frisch User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Till Varoquaux Cc: caml-list Subject: Re: [Caml-list] Search for the smallest possible possible Ocaml segfault.... References: <9d3ec8300711080617g1b023711o1a8f9aa50b7874@mail.gmail.com> In-Reply-To: <9d3ec8300711080617g1b023711o1a8f9aa50b7874@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 473333D5.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 frisch:01 ocaml:01 segfault:01 bug:01 ocaml:01 segfault:01 bug:01 scanf:01 sscanf:01 printf:01 printf:01 'x':01 pervasives:01 mli:01 Till Varoquaux wrote: > I have a open bug in ocaml > (http://caml.inria.fr/mantis/view.php?id=4321) 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 prize. a.mli = sub/a.mli: type t val x: t val f: t -> unit a.ml: type t = int let x,f = 0,print_int sub/a.ml: type t = string let x,f = "",print_string b.ml: let r = A.x c.ml: A.f B.r;; To be compiled with: ocamlc -o main a.mli a.ml b.ml sub/a.mli sub/a.ml c.ml -- Alain