From owner-freebsd-questions@freebsd.org Mon Oct 2 06:58:01 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336A2E3813D for ; Mon, 2 Oct 2017 06:58:01 +0000 (UTC) (envelope-from yuripv@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8A581CD9 for ; Mon, 2 Oct 2017 06:58:00 +0000 (UTC) (envelope-from yuripv@gmx.com) Received: from procyon.local ([62.183.124.200]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MTeVY-1dq0gq1Qzw-00QScl for ; Mon, 02 Oct 2017 08:57:52 +0200 Subject: Re: no dead-lock when signal handler calls localtime_r() on FreeBSD, but on Linux To: freebsd-questions@freebsd.org References: <20171002063425.GA21552@sh4-5.1blu.de> From: Yuri Pankov Message-ID: <102e950a-f3f2-bff1-1025-d5e757ee793b@gmx.com> Date: Mon, 2 Oct 2017 09:57:51 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171002063425.GA21552@sh4-5.1blu.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:GFkmN+Lpvwz0wjh7csfAlw0U30V1s959KtIkxlZPC33T7o60Zyw duSkmgoVjQ3mqSPyLGgji9i9K2QVnXcDHmeShj4ew2ozZEKjO2pBh8Z3WY+xiXfxnmSu785 fieNpL5A9lPWVyNgEEs9fnyHecqrnZQNPNQKGuQqOeAfXKJqWtpEfLzZeervTyMRRfidrXa SZFYrc+tLivXmCfe5oHvQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:w5t+/S2gcAM=:FJbnRBjDrVCRKOUkTAYcBR 2ba6A3bc7O34Oitnw7GXlCeBz2Sxy56+ZKfbilSHEQM5ZWhKsxVfU9xL4w1HbVOKn8MId6Gco tWVnDryVzS7w7JNXitD5UWxAbut9Oyoi8Ai9eCLeCcmLVX8vlAlmuS7yLgBUMvbNG5arvRtdj KkI2hW6f76R/j2aKj+vHq2qqURU8SaRukzgrjGAs6jxCggsibJ/YWka7aJrzDyIX9lU6IqQw4 poJEcipT0glAJ+5RqgvUc5c3QM47HgZ07/QmE4M/DhZFpGE8pPdf53Qf4MNZOtKudZylkHNrF hPQ5rbXpwGCPyYxSVdXr+0nXjN57GYTCbF6Q82mlrnF+b9NA23B4lmf+yljQqES4H0qXe4Ieb ERkR1OsA1pcxDGPrkdsklI5UPKYcWuSzJp5Vyf9cAFD9JflRts9RjlT++NbHZscCtjUbkNt3n CG1zWZUVzx2AApRdW15lEKWlsdPFQyL9IH5W5ZCI2JmbGSyipkUsbOPl+tOX1rEhvu8pvWVqN iBtZLE8tUJcjhnKdT2Q4FCWM0jpeISuPEJJIp2NdLX/h+fUNsoQ5ibQLCq5eMH2m7AiJiZC0a atd/LHiQLLoeA6NNlwF80i9qTdRCq11lO8DS5wgOdTdhdZuqDjcNoXLUP54EMhOTynuR26LRB Cksunw3X7PtWgtehDAqx431XsnggJgF/qwgD3hUROvs87XxdP5i/7M5bza24TyPmxkuE9iAXC 3+T15D1gUfpISF0tU/85XZm1nNEKfCwYLT4jIhyojUB1AYWzGpMK2rYlnvT0O3r2/lUbZwaw+ SA5NgN9q4Kn/pL5AhS/JHDSXOk+3xV4Q/daZXVI3WLnBvrigtjm6w2MWKXG1TnflTuAOu4r X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 06:58:01 -0000 On Mon, 2 Oct 2017 08:34:26 +0200, Matthias Apitz wrote: > > > Hello, > > I'm on the way clarifying a deadlock-issue we face on Linux when localtime_r() > is called in a signal-handler funtion. If you compile the code attached > below with gcc on Linux, the code gives what one deserves: a dead-lock > when Ctrl-C is pressed. Why? I don't see anything explicitly stating that localtime_r() is async-signal-UNsafe. > Interestingly this does not give a dead-lock on my FreeBSD (12-CURRENT) > system. I checked our man page sigaction(2) but the function is not in > the list of functions which may be called safe in signal-handlern. > > Any idea, while this does not give a dead-lock on FreeBSD too? Different implementation? :-)