From owner-freebsd-amd64@FreeBSD.ORG Mon Jan 23 22:20:03 2012 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E571A106564A for ; Mon, 23 Jan 2012 22:20:03 +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 A42738FC17 for ; Mon, 23 Jan 2012 22:20:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0NMK3Rh008878 for ; Mon, 23 Jan 2012 22:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0NMK3mY008877; Mon, 23 Jan 2012 22:20:03 GMT (envelope-from gnats) Resent-Date: Mon, 23 Jan 2012 22:20:03 GMT Resent-Message-Id: <201201232220.q0NMK3mY008877@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "C. Jullien" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CA8F106566B for ; Mon, 23 Jan 2012 22:17:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2688FC14 for ; Mon, 23 Jan 2012 22:17:12 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NMHBTt093955 for ; Mon, 23 Jan 2012 22:17:11 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q0NMHBcK093954; Mon, 23 Jan 2012 22:17:11 GMT (envelope-from nobody) Message-Id: <201201232217.q0NMHBcK093954@red.freebsd.org> Date: Mon, 23 Jan 2012 22:17:11 GMT From: "C. Jullien" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Mon, 23 Jan 2012 23:07:34 +0000 Cc: Subject: amd64/164425: stat function doesn't 32bit mode on amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 22:20:04 -0000 >Number: 164425 >Category: amd64 >Synopsis: stat function doesn't 32bit mode on amd64 >Confidential: no >Severity: critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 23 22:20:03 UTC 2012 >Closed-Date: >Last-Modified: >Originator: C. Jullien >Release: 8.1 and 9.0 >Organization: Eligis >Environment: FreeBSD freebsd.eligis.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46: 30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: A friend of mine also confirmed this issue I discovered at least on 8.1 and is still present on 9.0-RELEASE. The problem is that, when compiled on amd64 but for i686 target, stat function hangs with a core dump. $ gcc -m32 -DCOMPAT_32BIT -L/usr/lib32 -B/usr/lib32 I don't see where I'm wrong but can't imagine I'm the only one having this issue. Christian >How-To-Repeat: #include #include void main() { // char dummy[16]; // uncomment dummy to let it work!!! struct stat buf; stat("foo.c", &buf ); printf("%x\n, but.st_mode); } # tested on the recent 9.0 $ gcc -m32 -DCOMPAT_32BIT -L/usr/lib32 -B/usr/lib32 foo && ./foo >Fix: >Release-Note: >Audit-Trail: >Unformatted: