summaryrefslogtreecommitdiff
path: root/tests/spawn_test.cpp
AgeCommit message (Collapse)Author
2020-03-30dynamic libc: ignore ART profiling signal by default.Florian Mayer
These solves the issue that targetting non-profilable apps crashed them. There is still a race condition between starting the app and the SIG_IGN being installed, but that will be fixed in follow-ups. This also does not cover programs that statically link libc, but those are rare. This might be reverted if we find a more general solution to b/151835887. Bug: 151328035 Test: java profile sysui, doesn't crash Test: atest CtsBionicTestCases This is a cherry-pick of 96272df35cbc89c696dcacc0796519a89d9e2212 Change-Id: I6b99352ed50afe15a609f7ddb85312c2676ddf11 Merged-In: I6b99352ed50afe15a609f7ddb85312c2676ddf11
2018-10-09Block TIMER_SIGNAL in sigprocmask(SIG_SETMASK, ...).Josh Gao
Previously, we were zeroing out the reserved signals, when we actually wanted to have TIMER_SIGNAL always be blocked, and the other signals always be unblocked. This resulted in process termination when a SIGEV_THREAD timer callback calls sigprocmask(SIG_SETMASK, ...) with any signal mask value, and then subsequently fails to complete its callback and reach the sigtimedwait in bionic before the next timer iteration triggers. Add a how argument to filter_reserved_signals to appropriately block/unblock our reserved signals. Bug: http://b/116783733 Test: bionic-unit-tests32/64 Change-Id: Ie5339682cdeb914711cd4089cd26ee395704d0df
2018-04-09spawn.signal_stress: reap spawned children on exitRyan Prichard
Test: adb shell \ /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static \ --gtest_filter=spawn.signal_stress Bug: b/77824306 Change-Id: I970d1a4d0f8ac9621e676f32f838fc2f638d9750
2018-04-03Fix race in spawn.signal_stress testRyan Prichard
The default behavior for a real-time signal is to terminate the process. If the child we fork sends a SIGRTMIN signal before we've set up the ScopedSignalHandler for it, then the parent is terminated. Test: adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static --gtest_filter=spawn.signal_stress --gtest_repeat=1000 Bug: b/77554047 Change-Id: Ib44cbea8ccf506644405d8f426d9ad24e77cfa33
2018-03-05Rewrite system(3) to use posix_spawn(3).Elliott Hughes
We saw crashes from pthread_exit+debuggerd on LP32 (https://issuetracker.google.com/72291624), and it seems like the equivalent problem should exist with system(3). I fixed posix_spawn(3) as part of that bug, so the easiest fix is probably to reuse that. Bug: http://b/72470344 Test: ran tests Change-Id: I05f838706f2b4a14ac3ee21292833e6c8579b0d4
2018-01-30Add `sigset64_t` and accompanying functions.Elliott Hughes
This doesn't address `struct sigaction` and `sigaction`. That will come later. Bug: http://b/72493232 Test: ran tests Change-Id: I4134346757ce3a4dac6feae413361cec16223386
2018-01-26Better handling of sigset_t on LP32.Elliott Hughes
The main motivation here is that the sigprocmask in pthread_exit wasn't actually blocking the real-time signals, and debuggerd (amongst other things) is using them. I wasn't able to write a test that actually won that race but I did write an equivalent one for posix_spawn. This also fixes all the uses of sigset_t where the sigset_t isn't exposed to the outside (which we can't easily fix because it would be an ABI change). Bug: https://issuetracker.google.com/72291624 Test: ran tests Change-Id: Ib6eebebc5a7b0150079f1cb79593247917dcf750
2017-11-29Fix posix_spawn signal defaulting.Elliott Hughes
Add a new stress test, and fix the code to pass it. We need to ensure that we reset signal handlers for caught signals before unblocking signals in the child, we need to ensure that this happens even if you haven't passed a pthread_spawn_attr_t, and we need to ensure that this happens if you pass in an empty sigdefault set. Bug: http://b/68707996 Test: ran tests Change-Id: I348e9b17b1bdf221591da42c0ada133d98471d66
2017-10-11Implement <spawn.h>.Elliott Hughes
As described here: http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html And here: http://man7.org/linux/man-pages/man3/posix_spawn.3.html Bug: N/A (but mentioned in my inbox since 2013) Test: ran tests Change-Id: I0b27b2919b660779e3bd8a25fb429527c16dc621