infer icon indicating copy to clipboard operation
infer copied to clipboard

Process.ml regression introduced since after commit-hash 04543938aba60e7c5cf01848c529a486bc3eb1b4

Open amz-fruxo opened this issue 6 years ago • 4 comments

Information:

  • Infer version: any version since after commit hash 04543938aba60e7c5cf01848c529a486bc3eb1b4
  • OS version: AL2 (CentOS)
  • Command: infer analyze/capture/run

By running Infer current HEAD on master with a custom wrapper around Ant and Gradle that was used to work before, we have now observed a regression which causes Infer to crash (either capture or analysis).

The trace of the failure looks like:

Capturing in ant mode...
External Error: Error executing:   ant-wrapper -version
exited with code 1

Error backtrace:
Raised at file "string.ml", line 115, characters 19-34
Called from file "string.ml" (inlined), line 116, characters 36-61
Called from file "string.ml" (inlined), line 179, characters 15-34
Called from file "string.ml", line 182, characters 19-38
Re-raised at file "src/base/Die.ml" (inlined), line 26, characters 8-56
Called from file "src/base/Logging.ml", line 324, characters 6-39
Called from file "src/base/Process.ml" (inlined), line 64, characters 6-133
Called from file "src/integration/Ant.ml", line 36, characters 4-83
Called from file "src/integration/Driver.ml", line 154, characters 6-29
Called from file "src/base/Utils.ml", line 420, characters 16-20
Called from file "src/base/ScubaLogging.ml" (inlined), line 76, characters 29-44
Called from file "src/integration/Driver.ml", line 207, characters 2-90
Called from file "src/infer.ml" (inlined), line 20, characters 2-36
Called from file "src/base/Utils.ml" (inlined), line 420, characters 16-20
Called from file "src/base/ScubaLogging.ml" (inlined), line 76, characters 29-44
Called from file "src/infer.ml", line 25, characters 22-94

The way ant-wrapper behaves is that it creates a child process in which it runs ant -version, waits for it to finish and returns the result to stdout, as Ant would do itself.

Local troubleshooting has suggested that https://github.com/facebook/infer/blob/04543938aba60e7c5cf01848c529a486bc3eb1b4/infer/src/base/Process.ml#L38-L52 is the place to look at.

That code has change since March 16th and the previous way of dealing with processes and their output was working fine. That suggests the issue is likely to be there.

We are currently pointing our internal builds to commit-hash 04543938aba60e7c5cf01848c529a486bc3eb1b4 to have a working version of Infer built from source.

Please, do have a look and keep me posted when a PR is ready (we may propose one if you do not have one) as this is blocking the adoption of any new update post 04543938aba60e7c5cf01848c529a486bc3eb1b4.

amz-fruxo avatar May 06 '20 09:05 amz-fruxo

Can you check out deee3ef28498a230500c9a902466cda22081565b ?

ngorogiannis avatar May 06 '20 12:05 ngorogiannis

Will do, cheers!

amz-fruxo avatar May 06 '20 15:05 amz-fruxo

Thanks, it works, although I'm worried there is not unit-testing.

amz-fruxo avatar May 07 '20 10:05 amz-fruxo

We don't have a repro, so we can't add a test. If you can share a repro, I'll be happy to add it.

ngorogiannis avatar May 07 '20 11:05 ngorogiannis