facebookarchive / xctool

An extension for Apple's xcodebuild that makes it easier to test iOS and macOS apps.
Apache License 2.0
6.91k stars 737 forks source link

Bug in TeamCity reporter throws exception when reporting a failure with empty "output" #540

Closed loufranco closed 9 years ago

loufranco commented 9 years ago

I can reproduce call stacks like this in TeamCity when I make build mistakes (there is really a build error, but I can't see it)

It's an easy fix -- PR coming.

[14:23:04][Step 6/11] 2015-07-09 14:23:04.523 teamcity[55363:11783837] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSCFConstantString substringToIndex:]: Index 1 out of bounds; string length 0'
[14:23:04][Step 6/11] *** First throw call stack:
[14:23:04][Step 6/11] (
[14:23:04][Step 6/11]   0   CoreFoundation                      0x00007fff8ed9703c __exceptionPreprocess + 172
[14:23:04][Step 6/11]   1   libobjc.A.dylib                     0x00007fff93ea376e objc_exception_throw + 43
[14:23:04][Step 6/11]   2   CoreFoundation                      0x00007fff8ed96eed +[NSException raise:format:] + 205
[14:23:04][Step 6/11]   3   Foundation                          0x00007fff9607ac2b -[NSString substringToIndex:] + 118
[14:23:04][Step 6/11]   4   teamcity                            0x0000000102845b18 -[TeamCityReporter condensedBuildCommandOutput:] + 42
[14:23:04][Step 6/11]   5   teamcity                            0x0000000102845d1c -[TeamCityReporter endBuildCommand:] + 149
[14:23:04][Step 6/11]   6   teamcity                            0x000000010284535d -[Reporter handleEvent:] + 805
[14:23:04][Step 6/11]   7   teamcity                            0x0000000102844f35 __38+[Reporter readFromInput:andOutputTo:]_block_invoke + 259
[14:23:04][Step 6/11]   8   teamcity                            0x000000010284542d __ReadFileDescriptorAndOutputLinesToBlock_block_invoke + 61
[14:23:04][Step 6/11]   9   teamcity                            0x0000000102844d3b +[Reporter readFromInput:andOutputTo:] + 587
[14:23:04][Step 6/11]   10  teamcity                            0x0000000102845926 main + 89
[14:23:04][Step 6/11]   11  teamcity                            0x0000000102844ae4 start + 52
[14:23:04][Step 6/11]   12  ???                                 0x0000000000000001 0x0 + 1```
ExtremeMan commented 9 years ago

PR merged. Thanks for fixing!