Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor interactions with SIGCHLD-using projects #778

Open
mathstuf opened this issue Jun 16, 2021 · 5 comments
Open

Poor interactions with SIGCHLD-using projects #778

mathstuf opened this issue Jun 16, 2021 · 5 comments
Assignees
Labels
Instrumentation Issues relating to ptrace and parsing of DWARF tables

Comments

@mathstuf
Copy link
Contributor

Describe the bug
I have a project that uses wait-timeout to check the timeout of some commands that are executed. By some printf debugging (unless there's some way to run tarpaulin under gdb), it seems that the SIGCHLD handler in wait-timeout is not being executed at all. Tarpaulin should chain off to any already installed signal handlers (if at all possible). Alternatively, it could be that something goes wrong when installing wait-timeout's signal handler?

Alternatively, maybe some way to disable interposition on SIGCHLD handler could be done?

To Reproduce
A simple example wasn't doing it, but the crate in question is here.

Expected behavior
Already installed SIGCHLD handlers should work.

@xd009642
Copy link
Owner

Have you tried --forward as a CLI arg, it forwards unexpected signals to the test process. I was considering making it default but I didn't know if it would break certain things

@mathstuf
Copy link
Contributor Author

Ah, I had missed that flag. Trying now, thanks.

@mathstuf
Copy link
Contributor Author

Hrm. Alas, that doesn't seem to resolve it for me. The odd thing is that the underlying crate which actually does the work is fine. It's when it's all driven from other threads and such using Tokio to manage communications via a Unix socket and other event sources that things end up going south.

@jrray
Copy link

jrray commented Jun 25, 2022

I am facing a similar problem with a project that uses tokio::process::Command, which currently relies on SIGCHLD to get woken up. The subprocess exits but the parent process (my test) never stops waiting for the child process. Using --forward doesn't help.

There is some talk of removing the use of SIGCHLD here.

jrray pushed a commit to spkenv/spk that referenced this issue Aug 11, 2022
When using tarpaulin for coverage testing in the spk project,
`remount_runtime` hangs forever, because `tokio::process` uses `SIGCHLD` to
learn when the subprocess exits, and tarpaulin steals `SIGCHLD` for its own
purposes.

xd009642/tarpaulin#778

Signed-off-by: J Robert Ray <jrray@imageworks.com>
@xd009642 xd009642 added the Instrumentation Issues relating to ptrace and parsing of DWARF tables label Jan 26, 2023
@xd009642
Copy link
Owner

I'd generally say now --engine llvm is potentially a solution the only issue is the llvm coverage instrumentation doesn't really handle threads or spawned processes well so results can differ from run-to-run. A lot has gone into tarpaulin since last comment so just wondering if things have changed for anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Instrumentation Issues relating to ptrace and parsing of DWARF tables
Projects
None yet
Development

No branches or pull requests

3 participants