From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 26 21:40:19 2005 Return-Path: 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 D71D716A4CE for ; Tue, 26 Apr 2005 21:40:19 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89E0F43D66 for ; Tue, 26 Apr 2005 21:40:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3QLeJVp056191 for ; Tue, 26 Apr 2005 21:40:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3QLeJGx056190; Tue, 26 Apr 2005 21:40:19 GMT (envelope-from gnats) Resent-Date: Tue, 26 Apr 2005 21:40:19 GMT Resent-Message-Id: <200504262140.j3QLeJGx056190@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, John Engelhart Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9808C16A4CE for ; Tue, 26 Apr 2005 21:35:00 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72D4543D5A for ; Tue, 26 Apr 2005 21:35:00 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j3QLYx4i099182 for ; Tue, 26 Apr 2005 21:34:59 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j3QLYxoB099181; Tue, 26 Apr 2005 21:34:59 GMT (envelope-from nobody) Message-Id: <200504262134.j3QLYxoB099181@www.freebsd.org> Date: Tue, 26 Apr 2005 21:34:59 GMT From: John Engelhart To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: bin/80378: Possible mis-declaration of __sglue in /usr/src/lib/libc/stdio/glue.h X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2005 21:40:20 -0000 >Number: 80378 >Category: bin >Synopsis: Possible mis-declaration of __sglue in /usr/src/lib/libc/stdio/glue.h >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 26 21:40:19 GMT 2005 >Closed-Date: >Last-Modified: >Originator: John Engelhart >Release: FreeBSD 5.3-RELEASE-p5 >Organization: >Environment: FreeBSD new.zang.com 5.3-RELEASE-p5 FreeBSD 5.3-RELEASE-p5 #0: Mon Mar 7 03:05:55 EST 2005 johne@new.zang.com:/usr/src/sys/i386/compile/new i386 >Description: Someone should make a quick check as to the intentions of the declaration of __sglue inside /usr/src/lib/libc/stdio/glue.h. The files stdio/findfp.c and stdio/fwalk.c both refer to it, and glue.h's declaration is: struct glue { struct glue *next; int niobs; FILE *iobs; } __sglue; This causes both files to allocate this symbol, though findfp.c is clearing the one that declares and initilizes the structure, and fwalk.c only makes reference to it. fwalk.c ends up allocating BSS space for it. The linker seems to either silently ignore this and "do the right thing", or just.. who knows. Didn't quite dig that far. Regardless, I think what was intended was for glue.h to declare it extern, and then findfp.c to create it, and fwalk.c to refer to findfp.c's declaration. >How-To-Repeat: n/a, see affected files. >Fix: I believe what was really intended in glue.h was: struct glue { struct glue *next; int niobs; FILE *iobs; }; extern struct glue __sglue; >Release-Note: >Audit-Trail: >Unformatted: