From owner-freebsd-bugs Fri Dec 21 14:10:13 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BDF1937B417 for ; Fri, 21 Dec 2001 14:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBLMA1J83912; Fri, 21 Dec 2001 14:10:01 -0800 (PST) (envelope-from gnats) Received: from tomts10-srv.bellnexxia.net (tomts10.bellnexxia.net [209.226.175.54]) by hub.freebsd.org (Postfix) with ESMTP id 14ECB37B419 for ; Fri, 21 Dec 2001 14:06:05 -0800 (PST) Received: from khan.anarcat.dyndns.org ([65.94.189.35]) by tomts10-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011221220604.DGIA24174.tomts10-srv.bellnexxia.net@khan.anarcat.dyndns.org> for ; Fri, 21 Dec 2001 17:06:04 -0500 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 20FC6190B; Fri, 21 Dec 2001 17:06:00 -0500 (EST) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 8DEB020ACD; Fri, 21 Dec 2001 17:05:58 -0500 (EST) Message-Id: <20011221220558.8DEB020ACD@shall.anarcat.dyndns.org> Date: Fri, 21 Dec 2001 17:05:58 -0500 (EST) From: The Anarcat Reply-To: The Anarcat To: FreeBSD-gnats-submit@freebsd.org Cc: anarcat@anarcat.dyndns.org X-Send-Pr-Version: 3.113 Subject: bin/33070: libdisk::Disk_Names() returns empty strings 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: 33070 >Category: bin >Synopsis: libdisk::Disk_Names() returns empty strings >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Dec 21 14:10:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: The Anarcat >Release: FreeBSD 4.4-STABLE i386 >Organization: Nada, Inc. >Environment: System: FreeBSD shall.anarcat.dyndns.org 4.4-STABLE FreeBSD 4.4-STABLE #0: Fri Nov 16 12:57:38 EST 2001 anarcat@shall.anarcat.dyndns.org:/usr/obj/usr/src/sys/SHALL i386 >Description: Some recent MFC broke Disk_Names() on -stable: revision 1.50.2.13.2.1 date: 2001/09/18 15:16:21; author: murray; state: Exp; lines: +2 -2 MFS: Don't use kern.disks sysctl. Makefile (rev 1.27.2.5) disk.c (rev 1.50.2.14) The diff is: ndex: disk.c =================================================================== RCS file: /home/ncvs/src/lib/libdisk/disk.c,v retrieving revision 1.50.2.13 retrieving revision 1.50.2.13.2.1 diff -u -r1.50.2.13 -r1.50.2.13.2.1 --- disk.c 28 Aug 2001 03:45:47 -0000 1.50.2.13 +++ disk.c 18 Sep 2001 15:16:21 -0000 1.50.2.13.2.1 @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. * Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $FreeBSD: src/lib/libdisk/disk.c,v 1.50.2.13 2001/08/28 03:45:47 nyan Exp $ + * $FreeBSD: src/lib/libdisk/disk.c,v 1.50.2.13.2.1 2001/09/18 15:16:21 murray Exp $ * */ @@ -499,7 +499,7 @@ disks = malloc(sizeof *disks * (1 + MAX_NO_DISKS)); memset(disks,0,sizeof *disks * (1 + MAX_NO_DISKS)); -#ifndef PC98 +#if !defined(PC98) && !defined(KERN_DISKS_BROKEN) error = sysctlbyname("kern.disks", NULL, &listsize, NULL, 0); if (!error) { disklist = (char *)malloc(listsize); I do not understand why, but Disk_Names() returns a pointer to a list of NULL strings. This is weird. It definitly breaks libh's libdisk. >How-To-Repeat: #include extern "C" { #include #include } int main() { char** names = ::Disk_Names(); cerr << "n: " << names << endl; for (char **n = names; *n != NULL; n++) { cerr << "disk" << *n << endl; } return 1; } Simply returns with "n: 0x..." gdb also gives us the same sad stuff. >Fix: Back out the change. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message