[Mono-dev] Catching NRE in Embedded Mono

Robert Jordan robertj at gmx.net
Mon Jan 9 23:54:45 UTC 2012


On 09.01.2012 23:14, Jonathan Chambers wrote:
> Jeff,
>
> Mono uses getenv to access the MONO_DEBUG environment variable. Make sure
> you set it with _putenv rather than SetEnvironmentVariable, as they are two
> blocks of environment variables that are maintained separately.

Ouch! I was debugging another unrelated issue the other day and went
straight into this trap...

Since eglib's g_getenv (used by the managed world) is leaking
its return buffers anyway, I wonder if we shouldn't consolidate
the environment handling by fixing eglib thread-safely and
using g_getenv all over the place.

Robert



More information about the Mono-devel-list mailing list