bin/90002: env spins chewing CPU in some circumstances

Daniel J. O'Connor darius at
Tue Dec 6 00:00:24 GMT 2005

>Number:         90002
>Category:       bin
>Synopsis:       env spins chewing CPU in some circumstances
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 06 00:00:18 GMT 2005
>Originator:     Daniel J. O'Connor
>Release:        FreeBSD 6.0-RELEASE amd64
FreeBSD 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Wed Nov  2 19:07:38 UTC 2005     root at rat.samsco.home:/usr/obj/usr/src/sys/GENERIC  amd64

The env program has some regressions in 6.0 when used as a script interpreter. In some cases it will
spin in a tight loop consuming CPU.

[cain 10:15] ~ >cat ./testscript
#!/usr/bin/env FOO=BAR /bin/sh

echo FOO in $FOO

In 6.0 amd64, and -current i386 it exhibits the failure above. In i386 5.4 it works. I believe it is a
problem with 6.0 onwards and not architecture specific but I don't have enough test machines to be

It appears to be going in a strange loop allocating and freeing memory as the size fluctuates
between 1.2Mb and 380kb.



More information about the freebsd-bugs mailing list