From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <5764c029b688c1c0d24a2e97cd764f@gmail.com> 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 F32657EE80 for ; Fri, 15 Mar 2013 15:29:21 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com) identity=pra; client-ip=209.85.212.169; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of 5764c029b688c1c0d24a2e97cd764f@gmail.com designates 209.85.212.169 as permitted sender) identity=mailfrom; client-ip=209.85.212.169; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f169.google.com) identity=helo; client-ip=209.85.212.169; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="5764c029b688c1c0d24a2e97cd764f@gmail.com"; x-sender="postmaster@mail-wi0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AikDAEovQ1HRVdSpiGdsb2JhbABDg3sEg2u9LIFlFg4BAQEKCRQUBCSCWBkBGxwBAQMSEBYWGAMCAQIBEREBBQEvAQcCh30BAw8EpFKMMoJ7hHgKGScNWYh8AQUMjwkdgyoDjziBKIV7hX2JIz+ELQ X-IPAS-Result: AikDAEovQ1HRVdSpiGdsb2JhbABDg3sEg2u9LIFlFg4BAQEKCRQUBCSCWBkBGxwBAQMSEBYWGAMCAQIBEREBBQEvAQcCh30BAw8EpFKMMoJ7hHgKGScNWYh8AQUMjwkdgyoDjziBKIV7hX2JIz+ELQ X-IronPort-AV: E=Sophos;i="4.84,850,1355094000"; d="ml'?scan'208";a="6636874" Received: from mail-wi0-f169.google.com ([209.85.212.169]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 15 Mar 2013 15:29:21 +0100 Received: by mail-wi0-f169.google.com with SMTP id l13so672916wie.2 for ; Fri, 15 Mar 2013 07:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type; bh=oQKWbNrLJySVE7MeSmKqYQOXJz/E5W/DDFk6MQrBNM8=; b=TlBfH0LQJGXrgiqBAlowjbU7lvr6olfofTuZpug5UUmVTjOJ+qlYV+uvFCE7dZx5jn Yb4jacfTIMgAbWMoB5AoaBJdYZynawkcgOuxdfKRIdSoETDufkN5j+U1XcGC5zYa6nGn WQ+7UTnO8b3LucqgJ9JgXkxO5BtzNU8A/mnouT5gAo+cVwrA5TP2tt3jG/Wd/6E+k6th btCGgKtyU4y7rpk3V2rvQAZeioDhJYTV+XFc25BzprXt/Wmi+oxMaQqxTWE/xSM5T6vc gSqUE48Qu1Dx/d9khO9i8cckGO8TKQB7rBMLtPyvC8PSF67C6nnoqATofSEj4b2Efjtc 3UWQ== X-Received: by 10.194.58.202 with SMTP id t10mr11499437wjq.4.1363357760567; Fri, 15 Mar 2013 07:29:20 -0700 (PDT) Received: from [172.27.6.158] ([213.106.240.92]) by mx.google.com with ESMTPS id fx5sm3486992wib.11.2013.03.15.07.29.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Mar 2013 07:29:19 -0700 (PDT) Message-ID: <51433085.8090405@gmail.com> Date: Fri, 15 Mar 2013 14:30:29 +0000 From: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: caml-list@inria.fr CC: Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> Content-Type: multipart/mixed; boundary="------------020204000805000209070309" Subject: [Caml-list] signal-unsafety of %! This is a multi-part message in MIME format. --------------020204000805000209070309 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 %! can cause it. Isn't this something, that could be avoided in this case? --------------020204000805000209070309 Content-Type: text/plain; name="main.ml" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="main.ml" open Unix ;; Sys.set_signal Sys.sigalrm (Sys.Signal_handle (fun _ -> Printf.printf "H%!")); ignore (Unix.alarm 1); while true do Printf.printf ".%!" done --------------020204000805000209070309 Content-Type: text/plain; name="Makefile" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Makefile" main : % : %.ml ocamlfind c -linkpkg -package unix $< -o $@ clean : rm -f *.cmo *.cmi main --------------020204000805000209070309--