6 Commits

Author SHA1 Message Date
Jamie Liu a5b10b7dd0 Fix some processes_test flakes.
- Do not return from ExecSwapPreClone(), which is called from a fork()ed
  process.

- Use TEST_*CHECK() rather than ASSERT_*() in some places requiring
  async-signal-safety.

- Use ReadFd/WriteFd() rather than bare read/write(), to handle EINTR.

PiperOrigin-RevId: 632019219
2024-05-08 21:08:23 -07:00
Andrei Vagin bfd27a1e43 systrap: track the spinning queue length in a separate counter
The current implementation has a race condition resulting in the skipping of
one element in the queue array. When retrieving objects from the queue, the
stub code can get stuck in an infinite loop due to unexpected unused elements.

Updates #10000

PiperOrigin-RevId: 608679165
2024-02-20 11:35:21 -08:00
Andrei Vagin c3a7b477f9 tests: don't use raw threads
We have to use pthreads if we want to use other libc calls.

PiperOrigin-RevId: 453851326
2022-06-08 23:57:50 -07:00
Etienne Perot 75f0c9b05e Fix flakiness in Processes::ExecSwapThreadGroupLeader.
This closes the write end of the pipe earlier in the main test
body, and avoids allocations after fork+clone when building up
the `execve` array's flags.

There may be more obvious ways to do this, let me know :)

PiperOrigin-RevId: 453809395
2022-06-08 18:02:53 -07:00
Etienne Perot c9f8b165cf Cache each thread group's TID within their own namespace.
This avoids requiring a lock in `ThreadGroup.ID`, which in turn breaks the
following lock cycle:
`kernel.taskSetRWMutex` -> `kernel.taskMutex` -> `mm.metadataMutex`
-> `mm.mappingRWMutex` -> `kernel.taskSetRWMutex`

(Also, less locking within `createVMALocked` is probably for the better in
general.)

PiperOrigin-RevId: 449588573
2022-05-18 15:14:14 -07:00
Andrei Vagin fe4f478960 kernel: reparentLocked has to update children maps of old and new parents
Reported-by: syzbot+9ffc71246fe72c73fc25@syzkaller.appspotmail.com
PiperOrigin-RevId: 356536113
2021-02-09 10:37:04 -08:00