Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Oct 2017 09:57:51 +0300
From:      Yuri Pankov <yuripv@gmx.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: no dead-lock when signal handler calls localtime_r() on FreeBSD,  but on Linux
Message-ID:  <102e950a-f3f2-bff1-1025-d5e757ee793b@gmx.com>
In-Reply-To: <20171002063425.GA21552@sh4-5.1blu.de>
References:  <20171002063425.GA21552@sh4-5.1blu.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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? :-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?102e950a-f3f2-bff1-1025-d5e757ee793b>