mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: pthread_getattr_np doing loads of mremaps on ARM, MIPS under QEMU user-mode
Date: Thu, 15 Jun 2017 10:19:27 -0400	[thread overview]
Message-ID: <20170615141927.GN1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <a3a76ce8-0968-7c00-d54c-f68f1ad526b1@nonterra.com>

On Thu, Jun 15, 2017 at 04:08:03PM +0300, Tobias Koch wrote:
> Hi,
> 
> running under QEMU user mode, Ruby 2.4 (and it seems also Guile) ARM
> and MIPS binaries take a long time to start and eventually crash.
> The long startup seems to come from this loop
> 
>   while (mremap(p-l-PAGE_SIZE, PAGE_SIZE, 2*PAGE_SIZE,
> 0)==MAP_FAILED && errno==ENOMEM)
>           l += PAGE_SIZE;
> 
> being executed hundreds of times in pthread_getattr_np. Any idea
> what this could be about except from maybe being a QEMU bug?

This is not particularly unusual (it's the best way we could find to
measure the initial thread's stack size), but it's possible that qemu
user mode is botching emulation of mremap and thus resulting in a
wrong stack size being reported. Can you send a full strace (qemu-arm
-strace, maybe also real strace of the qemu process with the host
strace utility) log of the crash? That will probably shed some light
on what's happening.

> The subsequent crash then occurs after memory set aside by alloca is
> accessed. I think this may be unrelated.

It seems plausible that it's related or that it's unrelated.

Rich


  reply	other threads:[~2017-06-15 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 13:08 Tobias Koch
2017-06-15 14:19 ` Rich Felker [this message]
2017-06-15 20:01   ` Tobias Koch
2017-06-21  0:41     ` Rich Felker
2017-06-24 22:05       ` Tobias Koch
2017-06-24 22:18         ` 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=20170615141927.GN1627@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).