- Home /
Unity Cloud USYM Uploader crashes when Go Mobile Present
I am working with a project that is built in Unity, and is attempting to use Gomobile to deal with various network communications.
When attempting to upload an iOS build that uses a Go Mobile built library to TestFlight, the following occurs
11:58:21 ▸ Generating '<name of app>.dSYM'
11:58:21 ▸ Running script 'Run Script'
11:58:21 ▸ Running script 'Process symbols'
11:58:21 ** ARCHIVE FAILED **
11:58:21
11:58:21
11:58:21 The following build commands failed:
11:58:21 PhaseScriptExecution Process\ symbols /Users/administrator/Library/Developer/Xcode/DerivedData/Unity-iPhone-bycgdxfbrkuyytbxlcychbuwwowu/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-FC34453AA9340C29E1DB06A5.sh
The full stack trace that is occuring at that phase in the build is as follows
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x1441c36]goroutine 81 [running]:
debug/dwarf.(*LineReader).Next(0x0, 0xc43800baf8, 0x0, 0x0)
/usr/local/go/src/debug/dwarf/line.go:317 +0x26
unitycloud-go-crash/usym.readLines(0xc42e284000, 0xc43800bd20)
/go/src/unitycloud-go-crash/usym/dwarf.go:32 +0x11d
unitycloud-go-crash/usym.convertDwarfData(0xc42e284000, 0xc43800bd20)
/go/src/unitycloud-go-crash/usym/dwarf.go:11 +0x35
unitycloud-go-crash/usym.(*machoConverter).Convert(0xc4200a0f60, 0xc428cb81c0, 0x62, 0x0, 0x0)
/go/src/unitycloud-go-crash/usym/macho.go:170 +0x681
unitycloud-go-crash/usym.(*uploader).convertAndUpload(0xc42028adb0, 0x1905f20, 0xc4200a0f60, 0x0, 0x0)
/go/src/unitycloud-go-crash/usym/upload.go:184 +0x29f
unitycloud-go-crash/usym.(*uploader).UploadSymbolsInPath.func1(0xc4200a0fc0, 0xc42028adb0, 0xc42013c3c0, 0xc428550bf0)
/go/src/unitycloud-go-crash/usym/upload.go:128 +0xba
created by unitycloud-go-crash/usym.(*uploader).UploadSymbolsInPath
/go/src/unitycloud-go-crash/usym/upload.go:124 +0x359
Command PhaseScriptExecution failed with a nonzero exit code
debug/dwarf.(*LineReader).Next(0x0, 0xc43800baf8, 0x0, 0x0)
/usr/local/go/src/debug/dwarf/line.go:317 +0x26
unitycloud-go-crash/usym.readLines(0xc42e284000, 0xc43800bd20)
/go/src/unitycloud-go-crash/usym/dwarf.go:32 +0x11d
unitycloud-go-crash/usym.convertDwarfData(0xc42e284000, 0xc43800bd20)
/go/src/unitycloud-go-crash/usym/dwarf.go:11 +0x35
unitycloud-go-crash/usym.(*machoConverter).Convert(0xc4200a0f60, 0xc428cb81c0, 0x62, 0x0, 0x0)
/go/src/unitycloud-go-crash/usym/macho.go:170 +0x681
unitycloud-go-crash/usym.(*uploader).convertAndUpload(0xc42028adb0, 0x1905f20, 0xc4200a0f60, 0x0, 0x0)
/go/src/unitycloud-go-crash/usym/upload.go:184 +0x29f
unitycloud-go-crash/usym.(*uploader).UploadSymbolsInPath.func1(0xc4200a0fc0, 0xc42028adb0, 0xc42013c3c0, 0xc428550bf0)
/go/src/unitycloud-go-crash/usym/upload.go:128 +0xba
created by unitycloud-go-crash/usym.(*uploader).UploadSymbolsInPath
/go/src/unitycloud-go-crash/usym/upload.go:124 +0x359
Command PhaseScriptExecution failed with a nonzero exit code
I attempted it with both the default configuration that go mobile provides as well as by stripping out debug symbols by using -ldflags="-s -w" when building the Gomobile library in accordance with this possibly related issue https://github.com/golang/go/issues/28997 .
I wanted to also reach out about it here in case anybody else is using Gomobile with Unity and has encountered something similar, or if somebody who knew more about Unity internals and how its symbol extraction tools work.
For now we've just worked around it by disabling Unity crash reporting entirely, which is not ideal