http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51784
--- Comment #12 from Iain Sandoe <iains at gcc dot gnu.org> 2012-01-11 21:31:19 UTC --- we have the source - it looks like inherited stdlib from FreeBSD. http://www.opensource.apple.com/source/Libc/Libc-498.1.7/stdlib/getenv-fbsd.c however, more debugging is going to be needed.. I guess we're going to have to look at what is set up for at exit .. and if that's getting broken (or this is revealing a lingering bug).