mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rob Landley <rob@landley.net>
To: Alexander Monakov <amonakov@ispras.ru>, Rich Felker <dalias@aerifal.cx>
Cc: musl@lists.openwall.com
Subject: Re: Re: sysconf(_SC_ARG_MAX) broken in musl.
Date: Sun, 14 Aug 2016 15:41:40 -0500	[thread overview]
Message-ID: <1524ba55-d337-e8a2-070a-ac554328fdf0@landley.net> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1608142302570.11152@monopod.intra.ispras.ru>

On 08/14/2016 03:20 PM, Alexander Monakov wrote:
> On Wed, 10 Aug 2016, Rich Felker wrote:
>> Has anyone else looked into the issue enough to have a good opinion on
>> it, or at least additional information that would add to discussion?
> 
> To provide a data point, I've been told that userspace QEmu used to limit the
> cumulative args length in a more restrictive way than the kernel (1/4th stack
> limit). The observed failure mode was this: xargs running under qemu-user would
> build the command line according to what glibc thought would be accepted by the
> syscall (based on large stack size), but then the syscall would fail because
> qemu-user wouldn't process that many args.
> 
> I understand this is not much, since qemu-user is unreliable in other ways, and
> this particular issue has been fixed in QEmu regardless, but still I think it
> contributes to the general point. Is the concern that 128KB is too low to be
> usable? My understanding is that _SC_ARG_MAX is not broken in musl (contrary to
> what the subject says), just conservative (in a healthy way in this case imho).

The reason for sysconf() instead of a #defined limit is so you can query
the system to get the actual value, which may vary at runtime. (And in
this case, does, since ulimit can modify it arbitrarily without even
requiring special access.)

What happens if your stack size is smaller than 131072? (Not
stacksize/4, but stacksize total?) I haven't tried, but a quick glance
looks like Bad Things. And on nommu systems, that may actually come up.

Rob


  reply	other threads:[~2016-08-14 20:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bcf8d4b8-aee7-da0e-dffa-0f7cd9fdc30e@landley.net>
2016-08-10 20:36 ` Rich Felker
2016-08-14 20:20   ` Alexander Monakov
2016-08-14 20:41     ` Rob Landley [this message]
2016-08-14 22:11       ` Alexander Monakov

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=1524ba55-d337-e8a2-070a-ac554328fdf0@landley.net \
    --to=rob@landley.net \
    --cc=amonakov@ispras.ru \
    --cc=dalias@aerifal.cx \
    --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).