|
|
Message-ID: <tencent_CE65C392BE0D3B83C3F7A48DA41FEBCB8D05@qq.com>
Date: Fri, 10 Apr 2026 16:30:02 +0800
From: "Hankins" <546824250@...com>
To: "Luca Kellermann" <mailto.luca.kellermann@...il.com>
Cc: "musl" <musl@...ts.openwall.com>
Subject: Re: qsort core dump with 20,000,000 elements on 32-bit systems
Thank you for your patch. Your patch has successfully resolved my issue.
------------------ Original ------------------
From: Luca Kellermann <mailto.luca.kellermann@...il.com>
Date: Fri,Apr 10,2026 11:18 AM
To: Hankins <546824250@...com>
Cc: musl <musl@...ts.openwall.com>
Subject: Re: [musl] qsort core dump with 20,000,000 elements on 32-bit systems
On Thu, Apr 09, 2026 at 03:21:49PM +0800, Hankins wrote:
> Sorry, I should have described it in more detail.
> I discovered the issue while testing on a 32-bit system: when the
> number of elements sorted by qsort exceeds 18454930, a core dump
> occurs; otherwise, it does not
I was trying to understand musl's qsort() a few weeks ago (by reading
Keith Schwarz's explanation [1] and Dijkstra's original paper [2]) and
I found some bugs back then that might explain your issue. I just
haven't gotten around to reporting them yet but your mail encouraged
me to do that now :)
Description and fixes of two bugs attached.
Are your 32-bit systems Arm or PowerPC by any chance? If so, see the
commit message of the first attached patch for where the number
18454930 might come from.
Luca
[1] https://www.keithschwarz.com/smoothsort/
[2] https://www.cs.utexas.edu/~EWD/ewd07xx/EWD796a.PDF
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.