This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug manual/5069] env thread safety problem


------- Additional Comments From zhangxiliang at cn dot fujitsu dot com  2007-09-27 03:35 -------
(In reply to comment #6)
> (In reply to comment #5)
> Hi everyone,
> 
> Please check the source codes of each functions, again. There are some 
> portions which is referring to __environ (or _environ which is an alias) 
> without using getenv().
> 
> For example, the following files.
> 
> ./posix/execl.c
> ./sysdeps/unix/sysv/linux/execve.c
> ./malloc/arena.c:ptmalloc_init()
> and etc.
> 
> If these processings are performed at the time of realloc() having been called 
> by __add_to_environ(), SIGSEGV will occur.
> 

Yes, some exec*() family of functions refer to __environ without using getenv().
The patch can't solve this problem unless they are also applied the read_lock.
But it can solve the getenv() safety problem. I think it has a higher priority.

Because getenv() is a very foundation function. In glibc, the funcitons which
calls getenv() directly or indirectly is more than 1500. In them, the
multi-thread safe functions in POSIX is more than 170. 

If we don't modify getenv() problem, the glibc safety will descend dramatically
unless we don't use the multi-thread. So I think we should modify the sourse
code. Make sure the more than 1500 funcitons are multi-thread safety.



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |drepper at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=5069

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]