From nobody@FreeBSD.org  Fri Apr 20 19:16:55 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0FA48106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Apr 2012 19:16:55 +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 EDF308FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Apr 2012 19:16:54 +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 q3KJGsEr021418
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Apr 2012 19:16:54 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3KJGsE6021417;
	Fri, 20 Apr 2012 19:16:54 GMT
	(envelope-from nobody)
Message-Id: <201204201916.q3KJGsE6021417@red.freebsd.org>
Date: Fri, 20 Apr 2012 19:16:54 GMT
From: Hui Wang <hui.wang.ca@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 'ps -e' or 'pw -wwe' doesn't display the environment of 32-bit processes
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167128
>Category:       bin
>Synopsis:       ps(1): 'ps -e' or 'pw -wwe' doesn't display the environment of 32-bit processes (amd64-specific)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 20 19:20:10 UTC 2012
>Closed-Date:    Sat Apr 21 09:43:50 UTC 2012
>Last-Modified:  Sat Apr 21 09:43:50 UTC 2012
>Originator:     Hui Wang
>Release:        FreeBSD 9.0
>Organization:
Juniper Networks
>Environment:
FreeBSD freebsd9 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:
ps -e doesn't display the environment of a 32-bit process. 

test program:
cat t.c
int main() {
  printf("long int size is %i bytes long!\n", sizeof(long));
  sleep(3600);
}

gcc -m32 t.c

./a.out &

freebsd9# ps -e
PID  TT STAT TIME COMMAND
985  v0 Is   0:00.01 TERM=xterm login [pam] (login)
993  v0 S    0:00.08 USER=root LOGNAME=root HOME=/root SHELL=/bin/csh FTP_PA
1169 v0 S    0:00.00 ./a.out
 986 v1 Is+  0:00.00 USER=xterm /usr/libexec/getty Pc ttyv1

If I compile t.c without the -m32 option, the output looks fine.


>How-To-Repeat:
1. compile the test program in 32-bit mode
2. run 'ps -e'
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-amd64->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Apr 21 05:38:25 UTC 2012 
Responsible-Changed-Why:  
I'm not really sure how to classify this, but it isn't hardware-related, 
so move it over to bin/. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167128 
State-Changed-From-To: open->closed 
State-Changed-By: kib 
State-Changed-When: Sat Apr 21 09:42:24 UTC 2012 
State-Changed-Why:  
This is fixed in HEAD and stable/9, due to recent trociny@ work 
on providing kernel interfaces to retrieve arguments and environments 
for the running processes. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167128 
>Unformatted:
