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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 5C7337EE80 for ; Fri, 15 Mar 2013 17:02:34 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=pra; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=mailfrom; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@einhorn.in-berlin.de) identity=helo; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="postmaster@einhorn.in-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsMIAAZFQ1HAbSoIiWdsb2JhbABDiDO3SoI6gmEDAYFnFg4BAQEVEhQEJIIqAQEFI1YQCwkPAgIFIQICDwUYMYgnBLAkknIVgQ6NFV0Hgi0yYQOORIgWlA4 X-IPAS-Result: AsMIAAZFQ1HAbSoIiWdsb2JhbABDiDO3SoI6gmEDAYFnFg4BAQEVEhQEJIIqAQEFI1YQCwkPAgIFIQICDwUYMYgnBLAkknIVgQ6NFV0Hgi0yYQOORIgWlA4 X-IronPort-AV: E=Sophos;i="4.84,850,1355094000"; d="scan'208";a="6650876" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Mar 2013 17:02:33 +0100 X-Envelope-From: oliver@first.in-berlin.de Received: from first (e178037077.adsl.alicedsl.de [85.178.37.77]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id r2FG2X4s029944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 15 Mar 2013 17:02:33 +0100 Received: by first (Postfix, from userid 1000) id DC7FF15400E6; Fri, 15 Mar 2013 17:02:32 +0100 (CET) Date: Fri, 15 Mar 2013 17:02:32 +0100 From: oliver To: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> Cc: caml-list@inria.fr Message-ID: <20130315160232.GB5664@siouxsie> References: <51433085.8090405@gmail.com> <20130315143644.GA4950@siouxsie> <514344C4.4070908@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <514344C4.4070908@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] signal-unsafety of %! On Fri, Mar 15, 2013 at 03:56:52PM +0000, Matej Kosik wrote: > On 15/03/13 14:36, oliver wrote: > > On Fri, Mar 15, 2013 at 02:30:29PM +0000, Matej Kosik wrote: > >> Hi, > >> > >> When I compile the attached program > >> > >> (with compilers available directly from Debian's repositories) > >> > >> I can observe a (non-deterministic) deadlock. > >> > >> When I remove > >> > >> %! > >> > >> from the printf function inside the SIGALRM's handler, the deadlock never seem to occur. > >> > >> Obviously, interference can be easily introduced in concurrent programs; I was just surprised that even something like > > [...] > > > > > > Whats going on today? > > > > Use Unix.sigprocmask. > > > > Ciao, > > Oliver > > > > Right, printf simply isn't reentrant. > > (what I was observing was a program that was busy-looping, but stuck. I guess because internal shared data might have been damaged.). Ah, yes, you used it inside the signal handler. Have overlooked it. Ciao, Oliver