From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 76CB0BBA7 for ; Wed, 8 Feb 2006 23:22:53 +0100 (CET) Received: from uproxy.gmail.com (uproxy.gmail.com [66.249.92.205]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k18MMqBD030638 for ; Wed, 8 Feb 2006 23:22:53 +0100 Received: by uproxy.gmail.com with SMTP id e2so34133ugf for ; Wed, 08 Feb 2006 14:22:52 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Xdh/XPT9AH1jwp8jh6a4O6HW+TFYI1p8c6MSnjjjuw1DNWTgUNwR5/GTNH+VINZD7JoPujUAS6o3gyiFWOmh800Cs9Pq5xlMVSffdyuBBHpap5eNKLtDWh9szqXHYP4PAxO1qMU8obCe2B0ymhj/IceQhhKimoe198WlULc173Q= Received: by 10.48.47.14 with SMTP id u14mr2122886nfu; Wed, 08 Feb 2006 14:22:52 -0800 (PST) Received: by 10.48.4.15 with HTTP; Wed, 8 Feb 2006 14:22:52 -0800 (PST) Message-ID: <9d3ec8300602081422q17fa1cb4wd0e2c2587063f0a1@mail.gmail.com> Date: Wed, 8 Feb 2006 23:22:52 +0100 From: Till Varoquaux To: caml-list@yquem.inria.fr Subject: Limitations of continuation? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 43EA6F3D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; toying:01 netencoding:01 netcgi:01 netencoding:01 segfaults:01 compiler:01 wrote:01 marshal:01 marshal:01 closures:01 compile:01 encode:01 inline:01 xleroy:01 spaces:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=RCVD_BY_IP, RCVD_IN_BL_SPAMCOP_NET autolearn=disabled version=3.0.3 Xavier Leroy wrote a small continuation proof of concept module which can be found here: http://pauillac.inria.fr/~xleroy/software.html I've been toying with it lately whilst doing so I stumbled across a problem= : I'm using a module containing the following code: let continuation_to_string k =3D let c=3DMarshal.to_string k [Marshal.Closures] in Netencoding.Base64.encode ~linelength:72 c let send_page (f:string->unit) =3D let apply f k=3D f (continuation_to_string k) in Callcc.callcc(apply f) let _ =3D try ( let cgi =3D new Netcgi.std_activation () in let res =3D ( let cont=3D(cgi#argument "continuation") # value in Netencoding.Base64.decode ~accept_spaces:true cont ) in let k=3DMarshal.from_string res 0 in Callcc.throw k ()) with Not_found -> () I have a test app using this module. If I compile it with a standard Open ... the code segfaults, however if I inline the code (i.e. not actually putting it in a separate file) the application works just fine. I guess the compiler builds different code since it is working with modules. Where those this come from and would there be anyways to work around it ? Regards, Till