Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash during perl's shutdown when env variables were modified by …
…Python When perl is configured without -Accflags='-DPERL_USE_SAFE_PUTENV' it modifies environment variables directly without going through the C library. During shutdown of the interpreter it will then free() the environment variable strings. Python uses its own allocator for strings so a free() on one of those will explode with for example: *** glibc detected *** /build/toolchain/lin32/perl-5.10.0/bin/perl: free(): invalid pointer: 0x0da50904 *** Perl can be forced to use putenv() to set environment variables by compiling with -DPERL_USE_SAFE_PUTENV or at runtime by setting PL_use_safe_putenv to a non-zero value. It will then not try to free() the environment strings either. So we set PL_use_safe_putenv to avoid the free(). The downside is that environment variables may be leaked on systems without a safe putenv(). But that's probably still better than the crash. Fixes GH #7 and #9
- Loading branch information