From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9095 Path: news.gmane.org!not-for-mail From: Alexander Cherepanov Newsgroups: gmane.linux.lib.musl.general Subject: Re: Possible infinite loop in qsort() Date: Tue, 12 Jan 2016 15:25:57 +0300 Message-ID: <5694F0D5.8080709@openwall.com> References: <20160109082139.GD2016@debian> <20160109090719.GA385@nyan> <20160110040516.GQ238@brightrain.aerifal.cx> <20160110113852.GE2016@debian> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1452601579 29748 80.91.229.3 (12 Jan 2016 12:26:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Jan 2016 12:26:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9108-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jan 12 13:26:13 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aIy1b-0001SP-Ja for gllmg-musl@m.gmane.org; Tue, 12 Jan 2016 13:26:11 +0100 Original-Received: (qmail 7985 invoked by uid 550); 12 Jan 2016 12:26:09 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7967 invoked from network); 12 Jan 2016 12:26:09 -0000 X-Enigmail-Draft-Status: N1110 In-Reply-To: <20160110113852.GE2016@debian> Xref: news.gmane.org gmane.linux.lib.musl.general:9095 Archived-At: On 2016-01-10 14:38, Markus Wichmann wrote: > On Sat, Jan 09, 2016 at 11:05:16PM -0500, Rich Felker wrote: >> On Sat, Jan 09, 2016 at 10:07:19AM +0100, Felix Janda wrote: >>> musl enforces that object sizes should not be greater than PTRDIFF_MAX. >>> See for example the discussion at >>> >>> http://www.openwall.com/lists/musl/2013/06/27/7 >>> >>> So there will not be objects of size 3GB with musl on x32. Since the >>> Leonardo numbers grow slower than 2^n in general no overflow should >>> happen if "size" is valid. Otherwise, UB was invoked. >> > > OK. Might want to make that assumption a bit more prominent, because > this is the first time I've ever heard about it, but OK, no objects >2GB > on 32-bit archs. Yeah, I don't see it in the doc. Did I miss it? If it neither works nor documented as a limit I'd call it a bug. BTW the support in compilers for working with objects larger than half the address space is buggy -- see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67999 . The same situation -- it neither works nor documented. Somewhat puzzling... -- Alexander Cherepanov