From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 3D72C7F890 for ; Sun, 23 Mar 2014 11:01:48 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ygrek@autistici.org) identity=pra; client-ip=82.221.99.153; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ygrek@autistici.org"; x-sender="ygrek@autistici.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of ygrek@autistici.org designates 82.221.99.153 as permitted sender) identity=mailfrom; client-ip=82.221.99.153; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ygrek@autistici.org"; x-sender="ygrek@autistici.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@diserzione.investici.org designates 82.221.99.153 as permitted sender) identity=helo; client-ip=82.221.99.153; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ygrek@autistici.org"; x-sender="postmaster@diserzione.investici.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am8BAGmwLlNS3WOZnGdsb2JhbABYxwWBDhYOAQEBAQEICwkJFCiCJQEBAQMBQAEBOAQLCwkYJQ9IBhOHcQyqWIRVAQWeChEGjwGEOIlUhgl6hg2BaQGGTI8f X-IPAS-Result: Am8BAGmwLlNS3WOZnGdsb2JhbABYxwWBDhYOAQEBAQEICwkJFCiCJQEBAQMBQAEBOAQLCwkYJQ9IBhOHcQyqWIRVAQWeChEGjwGEOIlUhgl6hg2BaQGGTI8f X-IronPort-AV: E=Sophos;i="4.97,713,1389740400"; d="asc'?scan'208";a="64287301" Received: from diserzione.investici.org ([82.221.99.153]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 23 Mar 2014 11:01:45 +0100 Received: from [82.221.99.153] (diserzione [82.221.99.153]) (Authenticated sender: ygrek@autistici.org) by localhost (Postfix) with ESMTPSA id 7F5841813FE for ; Sun, 23 Mar 2014 10:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1395568903; bh=htV3PUj/3TW8s+seqTvUJ1MKrilFA+bmOTh/F4TAl4I=; h=Date:From:To:Subject:In-Reply-To:References; b=Qr/Stm4pnN1DNAiUsiiYGLt7gXmbT+Vs1OsMFaX6tNSfEvQzabUCcG1S44DIdP/NS qs77B1euduKNNcBBONDDSgm4Y/4TCEUpN7/DS2SEDyuWjSdFXKNji1GLyEtREGqrFY dJafS3MlYDnE7PYh9aOivHywX8sh9keiy+hEsOGY= Date: Sun, 23 Mar 2014 18:01:28 +0800 From: ygrek To: caml-list Message-ID: <20140323180128.05bb41dc@kiwi.local.tld> In-Reply-To: <1395346042.27397.33.camel@zotac> References: <532A0A5E.6070107@fugmann.net> <1395271296.27397.11.camel@zotac> <20140320132941.09aa04f4@kiwi.local.tld> <1395346042.27397.33.camel@zotac> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/Duk2flFhnGBVtA8qDEZU/zY"; protocol="application/pgp-signature" Subject: Re: [Caml-list] Bug when printing from signal handlers? --Sig_/Duk2flFhnGBVtA8qDEZU/zY Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 20 Mar 2014 08:42:47 +0100 Anders Fugmann wrote: > I circumvented the problem by using unbuffered writes (Unix.write), but=20 > it makes me wonder if I have code erroneous code lying around. I personally prefer to use signalfd for non-trivial signal handling, which = means that handler is invoked with specific and controlled program state. On Thu, 20 Mar 2014 21:07:22 +0100 Gerd Stolpmann wrote: > No, there aren't any mutexes here involved - the failing program is > single-threaded. Indeed, the program is compiled with single-threaded runtime, so that's an = additional failure scenario. > Nevertheless it's a bit surprising that innocent-looking OCaml code > turns out as unsafe. The current state is a bit unsatisfactory, at > least. Agreed, that's the point - OCaml signal handler though safe on the libc sid= e, is nevertheless subject to asynchronous execution at arbitrary program spots and, unless th= e user code and runtime are fully reentrant, various unexpected program failures are in= evitable..=20=20 --=20 --Sig_/Duk2flFhnGBVtA8qDEZU/zY Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlMusPgACgkQY0a5RXCNWgw2kwCfSr4gqiKuAtzvrERAMe3afQHH KfYAoKPNgLlLQhRQaHdzrpscIkEi1L5b =lvpk -----END PGP SIGNATURE----- --Sig_/Duk2flFhnGBVtA8qDEZU/zY--