From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13313 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: setrlimit hangs the process Date: Tue, 25 Sep 2018 16:15:52 +0200 Message-ID: <20180925141551.GE10209@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1537884839 5193 195.159.176.226 (25 Sep 2018 14:13:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Sep 2018 14:13:59 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Rabbitstack To: musl@lists.openwall.com Original-X-From: musl-return-13329-gllmg-musl=m.gmane.org@lists.openwall.com Tue Sep 25 16:13:55 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 1g4o67-0001GK-Ct for gllmg-musl@m.gmane.org; Tue, 25 Sep 2018 16:13:55 +0200 Original-Received: (qmail 20194 invoked by uid 550); 25 Sep 2018 14:16:04 -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 20173 invoked from network); 25 Sep 2018 14:16:03 -0000 Mail-Followup-To: musl@lists.openwall.com, Rabbitstack Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:13313 Archived-At: * Rabbitstack [2018-09-25 14:59:45 +0200]: > I'm using the latest golang:alpine Docker image to produce a > statically-linked Go binary. Even though I'm able to build the binary, when > I run it the process gets stuck during ebpf program loading. I've > investigated a bit and found the root cause is the call to setrlimit (this > is the offending line > > https://github.com/iovisor/gobpf/blob/2e314be67b1854ad226f012f08a984e0e89b6da9/elf/elf.go#L105). > Are you aware of such behaviour in musl? > well you could have described what goes wrong in more detail (error message, strace output, target platform, are you root, ...) i assume you are not running this on mips (since there is no alpine docker image for mips), which has the issue of SYSCALL_RLIM_INFINITY != RLIM_INFINITY the kernel side value is different from userspace so musl has to translate the value which may go wrong. nor on x32 (which may have various issues with the raw syscalls both in the go code and c code). increasing rlimit is not allowed by default, so you have to ensure you have permissions, musl should have no special behaviour with respect to RLIMIT_MEMLOCK, so it's more likely that you just don't have bpf and setrlimit permissions. instead of using a complex system like go + c code + elf loader, try a minimal c program to see if the bpf syscall succeeds at all in your docker environment.