Closed ramosian-glider closed 9 years ago
Reported by ramosian.glider
on 2012-03-15 12:24:05
Do you have a *sane* motivating example?
Generally, mixing fork and threads is considered harmful even w/o asan.
We are not making things worse.
Reported by konstantin.s.serebryany
on 2012-03-15 17:41:20
WontFix
Motivation is exactly what you say - it's generally harmful to call fork() if you have
multiple threads, especially if you rely on contents of thread-local memory (say, use
variables stored in stacks of other threads). We can potentially produce error report
in such cases.
Reported by samsonov@google.com
on 2012-03-16 05:57:00
Alexey has yesterday found a nice example of a custom condvar implementation that pings
the threads waiting on it by updating their local variables.
Someone creates two threads waiting on the same condvar and calls fork(). In the child
process the second thread disappears. Once the first thread releases the condvar, it
writes some value in the place where the second thread's stack used to be.
(In this particular case the third thread had already started and reused the stack
of the second thread, which was quite a problem)
Reported by ramosian.glider
on 2012-03-16 17:08:08
Um-m, afair there were no writes, reads were enough to spoil things:
threads waiting on a condvar create structs on their local stacks, and ptrs
to these structs are stored in a queue associated with condvar. If a thread
disappears after a fork(), its local stack gets re-used in a child process,
and we'll read garbage while accessing condvar from a child process.
Reported by samsonov@google.com
on 2012-03-19 09:07:42
Adding Project:AddressSanitizer as part of GitHub migration.
Reported by ramosian.glider
on 2015-07-30 09:12:58
Originally reported on Google Code with ID 47
Reported by
ramosian.glider
on 2012-03-15 12:23:46