Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2012 22:17:11 GMT
From:      "C. Jullien" <jullien@eligis.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   amd64/164425: stat function doesn't 32bit mode on amd64
Message-ID:  <201201232217.q0NMHBcK093954@red.freebsd.org>
Resent-Message-ID: <201201232220.q0NMK3mY008877@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 <stdio.h>
#include <sys/stat.h>

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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201232217.q0NMHBcK093954>