From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13346 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: setrlimit hangs the process Date: Tue, 9 Oct 2018 15:45:21 -0400 Message-ID: <20181009194521.GJ17110@brightrain.aerifal.cx> References: <20180925141551.GE10209@port70.net> <20180925153605.GF10209@port70.net> <20180925163850.GL17995@brightrain.aerifal.cx> <20181004150421.GC17110@brightrain.aerifal.cx> <20181004155302.GD17110@brightrain.aerifal.cx> <20181005004715.GF17110@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1539114210 7405 195.159.176.226 (9 Oct 2018 19:43:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 Oct 2018 19:43:30 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13362-gllmg-musl=m.gmane.org@lists.openwall.com Tue Oct 09 21:43:26 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1g9xug-0001oh-1a for gllmg-musl@m.gmane.org; Tue, 09 Oct 2018 21:43:26 +0200 Original-Received: (qmail 5287 invoked by uid 550); 9 Oct 2018 19:45:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5266 invoked from network); 9 Oct 2018 19:45:34 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13346 Archived-At: On Tue, Oct 09, 2018 at 09:37:06PM +0200, Rabbitstack wrote: > Should we raise an issue in Go upstream repository since there is nothing > actionable from musl side? Yes, I think so. Rich > El vie., 5 oct. 2018 2:47, Rich Felker escribió: > > > On Thu, Oct 04, 2018 at 11:53:02AM -0400, Rich Felker wrote: > > > On Thu, Oct 04, 2018 at 05:41:52PM +0200, Rabbitstack wrote: > > > > Please use the following link to download strace since daemon is > > refusing > > > > to deliver the mail. > > > > > > > > https://www.dropbox.com/s/syhbzxvijf7s4v1/agent.strace?dl=0 > > > > > > Here is the bug: > > > > > > 6208 rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT ILL TRAP ABRT BUS FPE > > SEGV TERM STKFLT CHLD PROF SYS RTMIN RT_1], > > > > > > Apparently Go has its own version of sigfillset, rather than calling > > > the libc one, and it's hard-coded the glibc values for which signals > > > are reserved for the implementation (just RTMIN and RT_1) rather than > > > honoring SIGRTMIN (which resolves at runtime via a function call), > > > which would exempt RT_2 from being blocked too. > > > > > > It needs to be fixed on the Go side. I'll look at it later if nobody > > > else more familiar with Go gets to it sooner. > > > > If these are the right source files: > > > > https://golang.org/src/runtime/os_linux_generic.go#L33 > > https://golang.org/src/runtime/sys_linux_amd64.s#L290 > > > > Then they're not even making any attempt to avoid stomping on > > implementation-internal signals, and there's nothing musl could do to > > prevent this. This suggests to me that something in your codebase is > > explicitly avoiding RTMIN and RT_1 (33 and 34). Making it also avoid > > RT_2 (35) would be a short-term hack you could use to get past this > > problem, but there's no guarantee assignments won't change in the > > future (this is why SIGRTMIN and SIGRTMAX macros expand to functions > > calls). Really if a Go program wants to use libc, it needs to avoid > > bypassing libc in ways that change the process state (like signal mask > > or disposition). > > > > Rich > >