mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] [Bug] Do not ignore membarrier return code
Date: Tue, 24 Mar 2020 09:53:12 -0400	[thread overview]
Message-ID: <20200324135312.GV11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <CALqoRwy+zePYh5-iA9YTe9R448RvBRP=j+fk9s9iFoiN=5Ti9g@mail.gmail.com>

On Tue, Mar 24, 2020 at 02:20:08PM +0100, Julio Guerra wrote:
> Hello Rich,
> 
> Here are more details on what we did to reproduce the issue.
> You can clone this gist
> https://gist.github.com/vdeturckheim/d420310e272f525824d7e92e7e875024
> and have a look at the run.sh file example in order to get started
> with it. The test.js file does a require of the js bindings of grpc,
> which involves the dlopen.
> 
> What we observed yesterday with this example was:
> - It crashed approximately 9 times out of 10 on aws codebuild with the
> machine BUILD_GENERAL1_SMALL (3 GB memory, 2 vCPUs).
> - It worked all the time by only adding membarrier to the seccomp
> profile of the docker run.
> 
> But I wanted to give you more details with stack traces of the
> segfault by retrying today with gdb but I cannot reproduce it
> anymore...!
> I'll retry later to see if I see the error again...
> 
> If what you say about membarrier is true, I think there may be some
> synchronization side-effect of the syscall since, afaik, node uses
> threads in order to load the shared libraries in the libuv.

My best guess, especially since the crash was unpredictable, is that
the stack size on at least one thread is barely sufficient for what
it's doing. The fallback path when the membarrier syscall fails
requires the ability to deliver signals, and if any thread has
insufficient space left on its stack to accept a signal, it will
crash.

Rich

  reply	other threads:[~2020-03-24 13:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 16:10 Julio Guerra
2020-03-23 16:38 ` Rich Felker
2020-03-24 13:20   ` Julio Guerra
2020-03-24 13:53     ` Rich Felker [this message]
2020-03-24 13:53     ` Julio Guerra
2020-03-24 14:01       ` Rich Felker
2020-03-24 16:08         ` A. Wilcox
2020-03-24 17:42           ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200324135312.GV11469@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).