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.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 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 F01FDBC37 for ; Fri, 19 Jun 2009 15:23:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjIFAFAuO0pYvxGE/2dsb2JhbACBUc10hAkF X-IronPort-AV: E=Sophos;i="4.42,252,1243807200"; d="scan'208";a="28394353" Received: from www.rastageeks.org (HELO mail.rastageeks.org) ([88.191.17.132]) by mail2-smtp-roc.national.inria.fr with ESMTP; 19 Jun 2009 15:23:14 +0200 Received: from leonard.localnet (sphinx.lix.polytechnique.fr [129.104.11.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.rastageeks.org (Postfix) with ESMTPSA id 55A3A288E2 for ; Fri, 19 Jun 2009 15:23:14 +0200 (CEST) From: Romain Beauxis To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Uncaught Unix_error. Date: Fri, 19 Jun 2009 15:23:54 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.29-2-amd64; KDE/4.2.4; x86_64; ; ) References: <200906181416.39314.toots@rastageeks.org> <53c655920906180741m71893536he6ea5960c124dddf@mail.gmail.com> <4A3A93B0.10907@glondu.net> In-Reply-To: <4A3A93B0.10907@glondu.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200906191523.55358.toots@rastageeks.org> X-Spam: no; 0.00; uncaught:01 runtime:01 statically:01 dynlink:01 unixsupport:01 semantics:01 2009:98 20,:98 phane:98 unix:01 unix:01 dynamically:01 exception:01 exception:01 caml-list:01 Le jeudi 18 juin 2009 21:21:20, St=C3=A9phane Glondu a =C3=A9crit : > > I'm lost, I'd like to understand when the exception is registered: at > > runtime initialization? In this case, only one should ever be > > registered (at least it seems easy to enforce). Or is it statically > > registered somehow? > > The exception is registered when the module is evaluated. This can > happen at program startup, or during a call to Dynlink.load_file. Note > that if Unix is linked in a cmxs file and you dynload it, you will face > trouble. So, if I understand it well, the C code in unixsupport.c does not match the= =20 expected semantics of exceptions registration. If exceptions are registered for acess through the C code, if it is assumed= =20 that one can link against two modules that will provide exceptions in the s= ame=20 namespace, and if both modules registers these exceptions dynamically, then= it=20 should not be assumed that a global value in the C code is sufficient to ge= t the=20 exception value. Current C code says "let's get this value once and for all". This contradic= ts=20 the dynamic loading, hence should be changed to "let's get the *current* va= lue=20 for this exception", this being called each time one wants to raise such an= =20 exception... Romain