From owner-freebsd-emulation@FreeBSD.ORG Mon Aug 4 11:01:14 2003 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55E8A37B404 for ; Mon, 4 Aug 2003 11:01:14 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E651543F3F for ; Mon, 4 Aug 2003 11:01:13 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h74I1DUp065888 for ; Mon, 4 Aug 2003 11:01:13 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h74I1DaW065882 for emulation@freebsd.org; Mon, 4 Aug 2003 11:01:13 -0700 (PDT) Date: Mon, 4 Aug 2003 11:01:13 -0700 (PDT) Message-Id: <200308041801.h74I1DaW065882@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: emulation@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2003 18:01:14 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/09] kern/19814 emulation Oracle8i installer triggers problem in th o [2000/09/21] kern/21463 emulation Linux compatability mode should not allow o [2000/11/13] kern/22826 emulation Memory limits have no effect in linux com o [2000/11/18] kern/22943 emulation Problem with linux emulation o [2001/03/28] kern/26171 emulation not work Linux-emulator, but hi is work i o [2000/12/14] misc/23561 emulation Linux compatibility mode does not support 6 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2002/08/11] kern/41543 emulation Easier wine/w23 support o [2002/11/26] kern/45785 emulation Linux WineX seems to require a few new li o [2000/06/19] misc/19391 emulation Evilness with Linux Terminus, causes X to 3 problems total. From owner-freebsd-emulation@FreeBSD.ORG Thu Aug 7 22:04:59 2003 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4AB537B401 for ; Thu, 7 Aug 2003 22:04:59 -0700 (PDT) Received: from episec.com (episec.com [198.78.65.141]) by mx1.FreeBSD.org (Postfix) with SMTP id 40E8243FBD for ; Thu, 7 Aug 2003 22:04:59 -0700 (PDT) (envelope-from edelkind-freebsd-emulation@episec.com) Received: (qmail 91108 invoked by uid 1024); 8 Aug 2003 05:04:05 -0000 Date: Fri, 8 Aug 2003 01:04:05 -0400 From: ari To: freebsd-emulation@freebsd.org Message-ID: <20030808050405.GL1746@episec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: linprocfs: extern declaration of a static variable X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2003 05:04:59 -0000 I'm sending this post to freebsd-emulation, since the problem is related to linux compatibility. However, the cause pertains to the core kernel architecture, so if you feel it belongs in the freebsd-bugs, freebsd-hackers, or freebsd-stable lists, feel free to let me know or forward it on yourself. A few days ago, i found myself in need of mounting a vmware image on my old 4.7-STABLE system. To do this, i needed linprocfs functioning properly, but this module failed with an "exec format error". Further investigation revealed that nextpid was undefined. So i checked the source, and discovered that in kern/kern_fork.c, nextpid was defined statically. It was defined nowhere else, but in i386/linux/linprocfs/linprocfs_misc.c, it was declared "extern". Since the system needed a new pair of shoes anyway, i promptly upgraded it to 4.8-STABLE. To my surprise, i found that nothing had changed. The nextpid variable was still defined as a "static int" in kern_fork.c, and it was still requested externally in linprocfs.c. And, obviously, the module still couldn't be loaded. I removed the "static" tag in kern_fork.c, recompiled, and everything was fine. What's odd isn't that this wasn't functioning properly. What's odd is that it _does_ function properly for some. Indeed, i also have a 4.8-RELEASE system, using the very same tidbits of code, and linprocfs.ko loads perfectly. In the working module, nm reports that nextpid is still undefined, and in the otherwise linked kernel, nm reports that nextpid is still a local variable: % nm -A /modules/linprocfs.ko /kernel |grep nextpid /modules/linprocfs.ko: U nextpid /kernel:c02c9298 d nextpid I'm not sure why this would have been unchanged from 4.7-STABLE to 4.8-STABLE, as it shouldn't work for _anyone_, barring some compiler bug that exports static variables. In the RELENG_5 kernel tree, the 'nextpid' variable has been changed to 'lastpid', and the static declaration has been removed. So there we have it. I believe it's a bug. Twofold, that is. A bug that it works at all, and a bug that when it works correctly, it doesn't. ari