[Bug 248537] procstat -e/kvm_getenvv() fails for specific processes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Aug 8 14:51:35 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248537

Konstantin Belousov <kib at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kib at FreeBSD.org

--- Comment #1 from Konstantin Belousov <kib at FreeBSD.org> ---
Some possible reasons for ENOMEM from kern.proc.env are:
- env vector corruption, e.g. if application filled env vector with invalid (or
NULL) pointers
- application made the env vector or env strings set larger that ARG_MAX.

>From the kernel PoV, the environment strings exist only at the moment of the
execve(2) calls,
when strings for args and env are passed through kernel from previous program
to the new one.
Between execs, it is up to the usermode to maintain env strings in a way it
finds most convenient.
Sysctl kern.proc.env is a hack to satisfy the popular request assuming the
application did
not deviated much from the structure passed to the new program on exec.  If it
did deviate,
kernel cannot do much.

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


More information about the freebsd-bugs mailing list