haiku/src
Ingo Weinhold 2f7eb9b546 Fixed a stupid race condition between IORequest finishing and
IORequest::Wait(). Wait() immediately returned when IsFinished() returned
true, but this is the case as soon as the last IOOperation has finished. The
I/O scheduler is not done with the request at this point, though, since it
will still be sitting in at least one of three doubly linked lists. Since the
usual procedure to issue synchronous I/O requests is to create an IORequest
on the stack, pass it to the I/O scheduler, and Wait() on it, Wait()
returning early might cause the IORequest object to be destroyed while it is
still in use, leading to invalid memory access in the I/O scheduler,
corruption of its list structures, as well as later corruption of the issuing
thread's stack.
Related tickets:
* #4431: The request issuing thread returned and already deleted the area the
  request was writing to before NotifyFinished() was called.
* #3048, #4883: Caused by the on stack IORequest being overwritten with other
  data while being handled by the I/O scheduler thread.
* #4517: Hard to say, but I've seen a such a problem too, after a thread
  scheduling related change. An explanation would be a list structure
  corruption in the I/O scheduler causing an infinite loop with disabled
  interrupts.
* #2845, #3428, #3429: The block notifier/writer is I/O heavy and as such
  quite likely to run into the stack corruption issue.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-13 19:28:33 +00:00
..
add-ons the sample rate label is Hz, not kHz. 2009-12-11 22:21:57 +00:00
apps Use B_OP_OVER instead of B_OP_COPY on Haiku (bug #4815) 2009-12-13 00:23:07 +00:00
bin * Improved type output. 2009-12-02 10:33:40 +00:00
build * Minor cleanup. 2009-11-26 16:04:23 +00:00
data update to tzdata2009l 2009-12-09 23:17:00 +00:00
documentation removed former haiku_book and headersampler tool 2007-10-04 22:15:58 +00:00
kits gcc4 build fix 2009-12-13 13:28:28 +00:00
libs * Implementing rman_get_start and copying rman_make_alignment_flags from 2009-12-10 22:04:51 +00:00
preferences Added new bulgarian transations done by cssvb94. Thanks again! 2009-12-12 10:58:47 +00:00
servers Some simplifications (thanks Axel): 2009-12-12 20:22:10 +00:00
system Fixed a stupid race condition between IORequest finishing and 2009-12-13 19:28:33 +00:00
tests * The transfer_area() test was not updated to its newer semantics, works again 2009-12-08 14:15:58 +00:00
tools Changed the way the syscall infos are generated. We no longer include the 2009-11-27 21:00:37 +00:00
Jamfile libshared.a doesn't deserve a src/ subdirectory. Moved to 2007-06-15 18:32:50 +00:00