Skip to content

Panic with "build-output" action #64

@hk21702

Description

@hk21702

The following line which is outputting from go test -json -race appears to cause gotestfmt to panic.

{"ImportPath":"github.com/ubuntu/ubuntu-insights/insights/C.test","Action":"build-output","Output":"# github.com/ubuntu/ubuntu-insights/insights/C.test\nld: warning: '/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/go-link-3781205840/000013.o' has malformed LC_DYSYMTAB, expected 98 undefined symbols to start at index 1626, found 95 undefined symbols starting at index 1626\n"}

In the logs, this results in this panic:

panic: failed to match line: [35 32 103 105 116 104 117 98 46 99 111 109 47 117 98 117 110 116 117 47 117 98 117 110 116 117 45 105 110 115 105 103 104 116 115 47 105 110 115 105 103 104 116 115 47 67 46 116 101 115 116 10 108 100 58 32 119 97 114 110 105 110 103 58 32 39 47 112 114 105 118 97 116 101 47 118 97 114 47 102 111 108 100 101 114 115 47 118 107 47 110 120 51 55 102 102 120 53 48 104 118 53 100 106 99 108 104 108 116 99 50 54 118 119 48 48 48 48 103 110 47 84 47 103 111 45 108 105 110 107 45 54 49 55 54 56 56 57 55 50 47 48 48 48 48 49 51 46 111 39 32 104 97 115 32 109 97 108 102 111 114 109 101 100 32 76 67 95 68 89 83 89 77 84 65 66 44 32 101 120 112 101 99 116 101 100 32 57 56 32 117 110 100 101 102 105 110 101 100 32 115 121 109 98 111 108 115 32 116 111 32 115 116 97 114 116 32 97 116 32 105 110 100 101 120 32 56 56 52 44 32 102 111 117 110 100 32 57 53 32 117 110 100 101 102 105 110 101 100 32 115 121 109 98 111 108 115 32 115 116 97 114 116 105 110 103 32 97 116 32 105 110 100 101 120 32 56 56 52]

which translates to the contents under Output:

# github.com/ubuntu/ubuntu-insights/insights/C.test
ld: warning: '/private/var/folders/vk/nx37ffx50hv5djclhltc26vw0000gn/T/go-link-617688972/000013.o' has malformed LC_DYSYMTAB, expected 98 undefined symbols to start at index 884, found 95 undefined symbols starting at index 884

I suspect that the root cause is just that gotestfmt doesn't know how to handle the action build-output.

For additional context, I believe the underlying warning output from go test is caused by race builders on Darwin when CGO is involved, but any warning from the underlying toolchain used by CGo would cause a panic most likely:
golang/go#74978
golang/go#61229

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions