From owner-freebsd-bugs@FreeBSD.ORG Fri Dec 12 19:10:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A27201065676 for ; Fri, 12 Dec 2008 19:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 805728FC1D for ; Fri, 12 Dec 2008 19:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCJA1ZI068253 for ; Fri, 12 Dec 2008 19:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mBCJA1gX068250; Fri, 12 Dec 2008 19:10:01 GMT (envelope-from gnats) Resent-Date: Fri, 12 Dec 2008 19:10:01 GMT Resent-Message-Id: <200812121910.mBCJA1gX068250@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Paul Wessel Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7DC41065670 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/129599: Possible 64-bit bug in qsort X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 19:10:01 -0000 >Number: 129599 >Category: misc >Synopsis: Possible 64-bit bug in qsort >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Dec 12 19:10:01 UTC 2008 >Closed-Date: >Last-Modified: >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: >Unformatted: