Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Feb 2017 23:15:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 217144] procstat -e fails to report changes to environment.
Message-ID:  <bug-217144-8-DjhRqgSbj1@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-217144-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-217144-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217144

Konstantin Belousov <kib@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kib@FreeBSD.org
             Status|New                         |Closed
         Resolution|---                         |Works As Intended

--- Comment #2 from Konstantin Belousov <kib@FreeBSD.org> ---
This is perfectly normal.  Kernel can reliably see the environment for a
process only during execve(2), when old program passes the environment to a=
 new
executed program through the syscall.  New program (address space) gets the
envirnment as a set of strings on top of the main thread stack.  procstat -e
best guess is to access these strings and show them as good enough
approximation.

During the normal operations, the environment changes do not need to be
reflected into the strings and they are not, as you discovered.  Still proc=
stat
-e is useful because typical program only consumes the environment without
changing it.  Shells of course do change env vars, but maintaining env as
externally visible strings set is not needed until something is execed.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217144-8-DjhRqgSbj1>