[Python-bugs-list] pythonlib.a makes SIGSEGV with LD_PRELOAD variable (PR#378)
Guido van Rossum
guido@python.org
Fri, 30 Jun 2000 16:36:00 -0500
> Modules/posixmodule,c, function convertenviron(), uses a dirty trick when
> parsing POSIX environment variables. All variables are formatted as
>
> <variable>=<value>
> Example: KDEDIR=/usr
>
> Python changes '=' to '\0' for a moment while parsing, in the line
>
> *p = '\0'
>
> But, if LD_PRELOAD variable is present, it SIGSEGVs in this command. I guess
> this variable is in a mprotect()ed page for security reasons. The environment
> variable parser should strdup() the variables or change the parsing algorithm so
> it no longer writes directly the environment var. array.
This has long been fixed in the CVS repository. Check out 1.6a2 or
the new 2.0b1 that will be out tomorrow.
--Guido van Rossum (home page: http://www.python.org/~guido/)