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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 8B6C3BBAF for ; Sat, 13 Mar 2010 20:29:46 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvoCAEt2m0vUGyoGkWdsb2JhbACQaooHFQEBAQEJCwoHEwMfqiaGIS6IUIR7BA X-IronPort-AV: E=Sophos;i="4.49,633,1262559600"; d="scan'208";a="46697219" Received: from smtp6-g21.free.fr ([212.27.42.6]) by mail2-smtp-roc.national.inria.fr with ESMTP; 13 Mar 2010 20:29:45 +0100 Received: from smtp6-g21.free.fr (localhost [127.0.0.1]) by smtp6-g21.free.fr (Postfix) with ESMTP id 2A062E08151 for ; Sat, 13 Mar 2010 20:29:40 +0100 (CET) Received: from localhost.localnet (91-168-184-92.rev.libertysurf.net [91.168.184.92]) by smtp6-g21.free.fr (Postfix) with ESMTP id 40B1DE080BD for ; Sat, 13 Mar 2010 20:29:38 +0100 (CET) From: Florent Monnier To: "caml-list" Subject: Re: [Caml-list] exception not registered.Abandon Date: Sat, 13 Mar 2010 20:33:33 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31.12-desktop586-1mnb; KDE/4.3.2; i686; ; ) References: <201003131742.25933.monnier.florent@gmail.com> <201003131936.16333.monnier.florent@gmail.com> <20100313185537.GA27381@annexia.org> In-Reply-To: <20100313185537.GA27381@annexia.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201003132033.33849.monnier.florent@gmail.com> X-Spam: no; 0.00; 0100,:01 compiler:01 stdlib:01 lib:01 windowing:01 exn:01 exn:01 fprintf:01 stderr:01 ocaml:01 bug:01 bindings:01 sdlvideo:01 sdlvideo:01 bug:01 Le samedi 13 mars 2010 19:55:37, vous avez =E9crit : > On Sat, Mar 13, 2010 at 07:36:16PM +0100, Florent Monnier wrote: > > > > I have compiled a program using the native compiler, then when I run > > > > the executable I get this error message: > > > > > > > > exception not registered.Abandon > > > > > > > > Searching Google I don't find anything about this error message. > > > > How should I interpret it? > > > > > > Is the program linked to C code (apart from stdlib, I mean)? > > > > Yes it is. > > It's linked with OpenGL (only the GL lib, no GLU or anything esle) and > > SDL (through ocaml-sdl) > > > > It's a program that I try to switch the windowing part from Glut to SDL. > > With Glut it works alright. > > > > Also I've just seen that running in the interpreted mode instead of > > native code the program does run without any problem. > > > > Do these additional informations give you any clue? >=20 > As Adrian said, it's from ocaml-SDL. It's from one of several > functions which look like this: >=20 > static void > sdlloader_raise_exception (char *msg) > { > static value *loader_exn =3D NULL; > if(! loader_exn){ > loader_exn =3D caml_named_value("SDLloader_exception"); > if(! loader_exn) { > fprintf(stderr, "exception not registered."); > abort(); > } > } > raise_with_string(*loader_exn, msg); > } >=20 > Essentially you have to register OCaml exceptions before you can call > them from C, so it sounds like you're not calling some sort of SDL > "init" function (or calling it too late in your program). Or possibly > there is a bug in the ocaml-SDL bindings. In the source of the sdlvideo.ml module there is: exception Video_exn of string let _ =3D Callback.register_exception "SDLvideo2_exception" (Video_exn "") it seems for some reason that this code is not executed, because if I add a= t=20 the beginning of my program (not in sdl source): let () =3D (* notice the exception is prefixed with the name of the sdl module *) Callback.register_exception "SDLvideo2_exception" (Sdlvideo.Video_exn ""); ;; then I get the correct exception. I don't understand what the bug is.