From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTP id 0171B5D5 for ; Sun, 22 Apr 2018 13:34:11 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.49,312,1520895600"; d="scan'208";a="323967579" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 22 Apr 2018 15:34:10 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 1379B82446; Sun, 22 Apr 2018 15:34:10 +0200 (CEST) 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 327A282416 for ; Sun, 22 Apr 2018 15:34:03 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ygrek@autistici.org; spf=Pass smtp.mailfrom=ygrek@autistici.org; spf=Pass smtp.helo=postmaster@devianza.investici.org IronPort-PHdr: =?us-ascii?q?9a23=3A1EYQ5hUp3GYk+C6rkRrOuuTZgRjV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYYh2Ft8tkgFKBZ4jH8fUM07OQ7/i7HzRYqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRo?= =?us-ascii?q?LerpBIHSk9631+ev8JHPfglEnjWwba98IRmssQndqtQdjJd/JKo21hbHuGZDdf?= =?us-ascii?q?5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXM?= =?us-ascii?q?TRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmij?= =?us-ascii?q?oINyQh/W/ZisJ+kr9VrhGjqBxxxIDbb52aOvVlc6PBZNMXS3ZNU9xNWyFDBI63?= =?us-ascii?q?cosBD/AGPeZdt4T8p1QOrQGgCgmvGejizT9JhnDs3aIk0OQsChvJ3BE8H9IPq3?= =?us-ascii?q?TUsNT1O7sTUeyvy6nI1zrDYupQ1Dzg64bIaggsreyIUL9za8bd1EgiGgHfglmO?= =?us-ascii?q?t4DpISmZ2vkRv2WY6edrSPihhHQ9qw5rpzii3scshZfNhoIS0l3L6Dt2wJg0Jd?= =?us-ascii?q?KiTk56YMSrHIFRtyGcKYt5XNgiQ31puCkmy70Ko5m7fDIFyJg/xh7fbeKIc5SQ?= =?us-ascii?q?7x7+UOucIi10iG9kdb+9nRq+71asxvPmWsWpzFpHrTJJktzWuXAM0xzT5NKHSv?= =?us-ascii?q?x4/kq52TeP2BrT5f9HIU0vj6XbNoIhwr8rlpoPsETMAi72lF/xjK+MeUUo4vKo?= =?us-ascii?q?5Pj/YrX6up+cMJd5hR3kPaQrnsyzGOA4MgkVX2iH4um8z73i/UjhQLpQlPE2k6?= =?us-ascii?q?/ZsIrbJcsBvKK5DRVVgc4f7EO0BjKildAZhmVPeFlMfRbCi4nyJ3nPJur5BLGx?= =?us-ascii?q?mQL/vi1swqXXMafsAd2ZP3fZnbTJdKth6lVAyQEyi9dF6MQHWfk6PPvvVxqp55?= =?us-ascii?q?TjBRgjPlnsmre1OJBGzoobHFm3LOqcOaLWv0WP47tyceCReI4OpDf2Kr4i/fG8?= =?us-ascii?q?1CZly29YRrGg2N4sUF79Bu5vehjLaGfwg8wdEGwL+A0kQ76y0QDQYXtof3+3Gp?= =?us-ascii?q?kEyHQ7BYahV9uRSo2zgbWHzi79H5tIa3taC1uNV3DyeNfdVg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DYCAB3jtxa/2zep8Zcg3SBWyiDapR4g?= =?us-ascii?q?XQUe4I5hDOMFIF4C4RnAgICgkUaBgEEMhYBAgEBAQEBAQEBAWscDII1IoJMBiM?= =?us-ascii?q?EGQEBOA8JAgkRAgUhAgIPEjYGE4R3AxWLWZpTbYFpM4JvAQEFhBANgSuCJgiBC?= =?us-ascii?q?YRfgiSBU0CEGoJPgiSDAIJUjGiKYSwIgjWJDoJyC4dKhQQriUuGN4ElIwongVJ?= =?us-ascii?q?9CDuCQ4sQhUFskE0BAQ?= X-IPAS-Result: =?us-ascii?q?A0DYCAB3jtxa/2zep8Zcg3SBWyiDapR4gXQUe4I5hDOMFIF?= =?us-ascii?q?4C4RnAgICgkUaBgEEMhYBAgEBAQEBAQEBAWscDII1IoJMBiMEGQEBOA8JAgkRA?= =?us-ascii?q?gUhAgIPEjYGE4R3AxWLWZpTbYFpM4JvAQEFhBANgSuCJgiBCYRfgiSBU0CEGoJ?= =?us-ascii?q?PgiSDAIJUjGiKYSwIgjWJDoJyC4dKhQQriUuGN4ElIwongVJ9CDuCQ4sQhUFsk?= =?us-ascii?q?E0BAQ?= X-IronPort-AV: E=Sophos;i="5.49,312,1520895600"; d="scan'208";a="323967557" Received: from devianza.investici.org ([198.167.222.108]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Apr 2018 15:34:02 +0200 Received: from [198.167.222.108] (devianza [198.167.222.108]) (Authenticated sender: ygrek@autistici.org) by localhost (Postfix) with ESMTPSA id D9C55108 for ; Sun, 22 Apr 2018 13:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1524404041; bh=ahLsWTVa2XS7gqMh3ib/nWqsezcsrkMQ0uAJ3snUPYk=; h=Date:From:To:Subject:In-Reply-To:References; b=TlZIUmbrDYi7xLF9qfCgSl/rwVqTtGM+OqYWX3IDot1L3lmyInaKAT2P/r9iJg5L0 0jLZtn07BRdh3xs5qAfa9QAGGAB1u/gQk0PqxmfmwSAa39JUwXpqe9st+efd5P/8Yf MKl2CW7NOlJHAd62LDth+YDp0RxThD+90BTXu2/A= Date: Sun, 22 Apr 2018 16:33:56 +0300 From: ygrek To: caml-list Message-ID: <20180422163356.40689256@kiwi.local.tld> In-Reply-To: References: X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Sys.signal / Sys.set_signal broken in native code? Reply-To: ygrek X-Loop: caml-list@inria.fr X-Sequence: 16842 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Sun, 22 Apr 2018 16:16:59 +0300 Dmitri Boulytchev wrote: > =C2=A0=C2=A0=C2=A0 let _ =3D > =C2=A0=C2=A0=C2=A0 =C2=A0 Sys.set_signal Sys.sigalrm (Sys.Signal_handle = (fun _ -> failwith=20 > "Timeout...")); > =C2=A0 =C2=A0=C2=A0=C2=A0 ignore (Unix.alarm 5); > =C2=A0=C2=A0=C2=A0 =C2=A0 while true do () done >=20 >=20 > =C2=A0=C2=A0=C2=A0 loops forever being compiled with ocamlopt (and raise= s the expected=20 > exception with ocamlc). Am I missing something? OCaml runtime turns signals into quasi-asynchronous - they are invoked only= at allocation points in native code. There is no allocation point inside empty loop so there is no chance to cal= l signal handler. My understanding is that having truly asynchronous signals would be a night= mare wrt runtime state in signal handler (cf. C signal code restrictions)=20 --=20 --=20 Caml-list mailing list. Subscription management and archives: https://sympa.inria.fr/sympa/arc/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs=