spotify / XCRemoteCache

Other
825 stars 50 forks source link

Sometimes xcpostbuild hangs forever. #229

Closed grigorye closed 7 months ago

grigorye commented 7 months ago

My integration setup

[x] CocoaPods cocoapods-xcremotecache plugin [ ] Automatic integration using xcprepare integrate ... [ ] Manual integration [ ] Carthage

Expected/desired behavior

XCRemoteCache should not hang in producer mode.

Minimal reproduction of the problem with instructions

I can't provide steps to reproduce as it concerns a proprietary project, but I believe it should be possible to create a unit test to cover it (not yet done).

I'm attaching LLDB logs in case of hangup. From the logs, I believe it's an issue of waiting for subprocess exit with the process in question (dsymutil) writing to a pipe that is supposed to be read by the process awaiting for the exit (xcpostbuild). See more info here: https://stackoverflow.com/a/39281558.

LLDB Logs

The backtrace for xcpostbuild during the hangup:

LLDB-xcpostbuild

The backtrace for dsymutil during the hangup:

LLDB-dsymutil

Producer Logs

 [REPLACE THIS WITH YOUR INFORMATION] 

Consumer Logs

 [REPLACE THIS WITH YOUR INFORMATION] 

Pods/Carthage file

 [REPLACE THIS WITH YOUR INFORMATION] 

Environment

Post build stats

 [REPLACE THIS WITH YOUR INFORMATION] 

Others

grigorye commented 7 months ago

Closing this for now, as it looks like the problem was triggered in the fork that we employed, that does not use standardError for capturing the output, when invoked from xcpostbuild, rather employs a pipe for reading. The problem is still potentially there (rooted in shellInternal using pipe in case of nil stderr), I guess, for calls like shellExec, but shellExec does not seem to be used anywhere atm.