[Python-bugs-list] pythonlib.a makes SIGSEGV with LD_PRELOAD variable (PR#378)

epx@conectiva.com epx@conectiva.com
Fri, 30 Jun 2000 16:10:25 -0400 (EDT)

Full_Name: Elvis Pfützenreuter
Version: 1.5.2
OS: Linux glibc 2.1.3 kernel 2.2.16
Submission from: presuntinho.conectiva.com.br (

Modules/posixmodule,c, function convertenviron(), uses a dirty trick when
parsing POSIX environment variables. All variables are formatted as

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.