From owner-freebsd-bugs Sun Sep 15 21:50: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8101437B400 for ; Sun, 15 Sep 2002 21:50:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E869843E4A for ; Sun, 15 Sep 2002 21:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g8G4o1JU041500 for ; Sun, 15 Sep 2002 21:50:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g8G4o1Ir041499; Sun, 15 Sep 2002 21:50:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EF9137B400 for ; Sun, 15 Sep 2002 21:42:55 -0700 (PDT) Received: from pesto.lbl.gov (pesto.lbl.gov [131.243.2.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id E962243E3B for ; Sun, 15 Sep 2002 21:42:54 -0700 (PDT) (envelope-from jin@pesto.lbl.gov) Received: from pesto.lbl.gov (localhost [127.0.0.1]) by pesto.lbl.gov (8.12.3/8.12.3) with ESMTP id g8G4gs7P012463 for ; Sun, 15 Sep 2002 21:42:54 -0700 (PDT) (envelope-from jin@pesto.lbl.gov) Received: (from jin@localhost) by pesto.lbl.gov (8.12.3/8.12.3/Submit) id g8G4gr5p012462; Sun, 15 Sep 2002 21:42:53 -0700 (PDT) Message-Id: <200209160442.g8G4gr5p012462@pesto.lbl.gov> Date: Sun, 15 Sep 2002 21:42:53 -0700 (PDT) From: Jin Guojun (DSD staff) Reply-To: j_guojun@lbl.gov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/42818: qsort can only sort up to 6 element for structure Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 42818 >Category: kern >Synopsis: qsort can only sort up to 6 element for structure >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 15 21:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jin Guojun (DSD staff) >Release: FreeBSD 4.6.2-RELEASE i386 >Organization: >Environment: FreeBSD 4.x >Description: The code included in "How-To-Repeat" section works on Linux, Solaris, but fails on FreeBSD when array size is greater than 6. solaris/linux: ./qsort-app orig: 2 3 0 1 4 5 6 7 8 9 22 23 45 56 10 11 sort: 0 1 2 3 4 5 6 7 8 9 10 11 22 23 45 56 OK orig: 0 1 2 3 4 5 6 7 8 9 10 11 22 23 sort: 0 1 2 3 4 5 6 7 8 9 10 11 22 23 OK orig: 0 1 2 3 4 5 6 7 8 9 sort: 0 1 2 3 4 5 6 7 8 9 OK orig: 2 3 0 1 4 5 6 7 8 9 12 13 sort: 0 1 2 3 4 5 6 7 8 9 12 13 OK orig: 0 1 2 3 4 5 6 7 8 9 12 13 15 16 10 11 sort: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 16 OK FreeBSD: orig: 2 3 0 1 4 5 6 7 8 9 22 23 45 56 10 11 sort: 10 11 0 1 4 5 6 7 8 9 2 3 22 23 45 56 FAILED orig: 10 11 0 1 4 5 6 7 8 9 2 3 22 23 sort: 6 7 0 1 4 5 2 3 8 9 10 11 22 23 FAILED orig: 6 7 0 1 4 5 2 3 8 9 sort: 0 1 2 3 4 5 6 7 8 9 OK orig: 2 3 0 1 4 5 6 7 8 9 12 13 sort: 0 1 2 3 4 5 6 7 8 9 12 13 OK orig: 0 1 2 3 4 5 6 7 8 9 12 13 15 16 10 11 sort: 10 11 2 3 4 5 6 7 8 9 0 1 12 13 15 16 FAILED >How-To-Repeat: make qsort-app ./qsort-app % cat qsort-app.c #include smaller(const void *i1, const void *i2) { return *(int*)i1 > *(int*)i2; } #define N 8 typedef int ia_t[2]; main() { int i; ia_t d0[N] = {2, 3, 0, 1, 4, 5, 6, 7, 8, 9, 22, 23, 45, 56, 10, 11}, d1[N] = {2, 3, 0, 1, 4, 5, 6, 7, 8, 9, 12, 13, 15, 16, 10, 11}; #define test(dx, n) { \ ia_t *da = dx; \ printf("orig: "); \ for (i=0; iFix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message