Open GoogleCodeExporter opened 9 years ago
I discovered today that recvmsg() holds syscall_mutex_ on i386 but not
on x86-64. This is because recvmsg() is implemented using different
code on the two architectures. On i386 it reuses "accept_complex"
which calls sendSystemCall() with locked=true.
So there are two cases to consider:
a) recvmsg() first, which is unblocked by sendmsg() in another thread.
b) sendmsg() first, which blocks because the socket's buffer is full,
and is unblocked by recvmsg() in another thread.
(a) currently deadlocks only on i386. This is simple to fix without
refactoring the sandbox to use multiple mutexes.
(b) will deadlock on both i386 and x86-64. Fixing this requires
refactoring to use multiple mutexes.
The ability to fill up a socket's buffer using sendmsg() is exposed by
Native Client's IMC syscalls, and although there are currently some
differences in IMC's behaviour between Unix and Windows, we should
probably fix case (b).
Also it might be possible that Chromium relies on case (b) working.
Original comment by mseaborn@chromium.org
on 1 Oct 2010 at 11:03
Original issue reported on code.google.com by
mseaborn@chromium.org
on 7 Sep 2010 at 3:57