From nobody@FreeBSD.org  Fri Dec 12 19:05:27 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A7DC41065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Dec 2008 19:05:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 97E758FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Dec 2008 19:05:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCJ5RtC013058
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 12 Dec 2008 19:05:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id mBCJ5Rh1013057;
	Fri, 12 Dec 2008 19:05:27 GMT
	(envelope-from nobody)
Message-Id: <200812121905.mBCJ5Rh1013057@www.freebsd.org>
Date: Fri, 12 Dec 2008 19:05:27 GMT
From: Paul Wessel <pwessel@hawaii.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Possible 64-bit bug in qsort
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         129599
>Category:       misc
>Synopsis:       Possible 64-bit bug in qsort
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 12 19:10:01 UTC 2008
>Closed-Date:    Fri Dec 12 19:28:31 UTC 2008
>Last-Modified:  Fri Dec 12 19:28:31 UTC 2008
>Originator:     Paul Wessel
>Release:        Actually using OSX but bug is in FreeBSD too
>Organization:
GG/SOEST/UH
>Environment:
Darwin macnut 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386 i386


>Description:
Darwin and I believe FreeBSD has a qsort which fails in 64-bit mode for large > 3.5Gb data.
>How-To-Repeat:
Try to sort any large array (say 4 Gb) in 64-bit mode using qsort.  If it fails then FreeBSD also has this bug that Leopard has.
>Fix:
Two key internal variables in qsort (r and d) need to be long and not int.  That is easy to check.  Also, a swapfunc (if used) needs its 3rd argument to be size_t.  With those changes the function works.



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: das 
State-Changed-When: Fri Dec 12 19:27:06 UTC 2008 
State-Changed-Why:  
Thanks, but this is already addressed in FreeBSD. 
Duplicate of 111085, which I resolved about a year ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=129599 
>Unformatted:
