From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: Wrong info in libc comparison
Date: Sat, 16 Sep 2017 19:11:54 +0200 [thread overview]
Message-ID: <20170916171154.GC15263@port70.net> (raw)
In-Reply-To: <20170916140110.p4xiuzvsuarfcfk4@voyager>
* Markus Wichmann <nullplan@gmx.net> [2017-09-16 16:01:10 +0200]:
> On Sat, Sep 16, 2017 at 11:37:53AM +0200, Szabolcs Nagy wrote:
> > * Markus Wichmann <nullplan@gmx.net> [2017-09-15 21:18:46 +0200]:
> > > On Wed, Sep 13, 2017 at 03:53:06PM -0400, Rich Felker wrote:
> > > > If you're considering big-O, where n->infinity (or at least to the
> > > > largest value that can fit in memory), malloc most certainly has
> > > > failed (because the array to be sorted already filled memory) and
> > > > you're looking at the "fallback" case.
> > > >
> > >
> > > I think we're getting sidetracked here. Every libc worth its salt uses a
^^^^^^^^^^
> > > loglinear sorting algorithm. Thus they are all equal in that regard.
^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
> >
> > that is not true at all.
> > embedded libcs are often optimized for size, not worst case behaviour.
> > note that worst-case behaviour is not just big-O..
> > (e.g. glibc uses mergesort which uses malloc which means it's not as-safe,
> > may introduce arbitrary latency since malloc can be interposed, concurrent
> > mallocs can delay forward progress, large allocation may cause swapping,
> > cancellation or longjmp out of the cmp callback can leak memory etc.)
> >
>
> Did you even read what I wrote? Rich talked about big-O, i.e. complexity
> theory, to which I remarked that most algorithms in use are loglinear
> and thus equal _in_that_regard_.
>
glibc, uclibc, dietlibc, newlib, netbsd, openbsd, freebsd
qsort are all O(n^2) worst-case, musl qsort is O(n log(n)).
i think this is not a sidetrack, but relevant detail
for a libc comparision page.
(the openbsd proof of concept stack clash exploit
relied on the unbounded stack use in qsort, that
would not work against musl, but all the other libcs
are affected.)
next prev parent reply other threads:[~2017-09-16 17:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-13 13:51 Markus Wichmann
2017-09-13 18:10 ` Rich Felker
2017-09-13 18:51 ` Markus Wichmann
2017-09-13 19:25 ` Szabolcs Nagy
2017-09-13 19:53 ` Rich Felker
2017-09-15 19:18 ` Markus Wichmann
2017-09-16 9:37 ` Szabolcs Nagy
2017-09-16 14:01 ` Markus Wichmann
2017-09-16 17:11 ` Szabolcs Nagy [this message]
2017-09-16 19:34 ` Markus Wichmann
2017-09-16 16:18 ` Rich Felker
2017-09-16 18:38 ` Markus Wichmann
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=20170916171154.GC15263@port70.net \
--to=nsz@port70.net \
--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).