This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] ensure run-clang-tidy reports children killed by signals
ClosedPublic

Authored by ijc on Mar 22 2021, 8:14 AM.

Details

Summary

If a clang-tidy child process exits with a signal then run-clang-tidy will exit
with an error but there is no hint why in the output, since the clang-tidy
doesn't log anything and may not even have had the opportunity to do so
depending on the signal used.

subprocess.CompletedProcess.returncode is the negative signal number in this
case.

I hit this in a CI system where the parallelism used exceeded the RAM assigned
to the container causing the OOM killer to SIGKILL clang-tidy processes.

Diff Detail

Event Timeline

ijc created this revision.Mar 22 2021, 8:14 AM
ijc requested review of this revision.Mar 22 2021, 8:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2021, 8:14 AM
ijc added a comment.Mar 22 2021, 8:23 AM

I sent this to cfe-commits a while back but it didn't gain any notice (perhaps that was the wrong place).

Do we have tests for this?
If so, it would be nice to add some :)

ijc added a comment.Mar 23 2021, 7:06 AM

I may be looking in the wrong places but all I can see is tests which are using run-clang-tidy as part of the mechanism for testing clang-tidy itself, nothing which is testing run-clang-tidy itself AFAICT.

If I've missed some existing suite and it's just a case of adding a new test case to cover this case based on existing test infra then I'd be happy to do so given some pointers where to look, but if it's a case of creating the infrastructure to test run-clang-tidy in order to do so then I'm afraid I don't have the bandwidth for that right now.

sylvestre.ledru accepted this revision.Apr 4 2021, 9:21 AM

OK, no worries.
I don't think it will regress the situation anyway

This revision is now accepted and ready to land.Apr 4 2021, 9:21 AM
ijc added a comment.Apr 12 2021, 2:38 AM

Thanks Sylvestre!

Now that you've approved AIUI things are now out of my hands and some process will result in this eventually being merged, but please let me know if I'm wrong and there is something further I'm meant to do.

ijc added a comment.Jul 19 2021, 4:16 AM

@sylvestre.ledru do I need to do anything more for this to get merged?

Oh, I missed your message. I can land it for you, ok?

ijc added a comment.Jul 19 2021, 5:09 AM

@sylvestre.ledru yes please that would be great.