Skip to content

"go test ./..." fails when llvm-symbolizer is not available (even if llvm-symbolizer-14 is there) #906

@aalexand

Description

@aalexand

#891 added support for populating function start lines using llvm-symbolizer data. One caveat is that if llvm-symbolizer is not available, the default go test ./... run fails with the error below. In fact, even if llvm-symbolizer is available in its versioned form, such as llvm-symbolizer-14, the test run still fails with the same error.

The workaround right now is to install llvm-symbolizer and then run a command like sudo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-14 100. This command makes the symbolizer available as llvm-symbolizer, which enables pprof to locate it.

Maybe we should make the test skipped if llvm-symbolizer is not available, but also have an option (a flag or environment variable) to disable that skippage so that we set that option in our CI to ensure we forcefully test the start function numbers.

$ go test ./...
?   	github.com/google/pprof	[no test files]
?   	github.com/google/pprof/driver	[no test files]
ok  	github.com/google/pprof/fuzz	0.034s
?   	github.com/google/pprof/internal/plugin	[no test files]
?   	github.com/google/pprof/internal/proftest	[no test files]
?   	github.com/google/pprof/internal/transport	[no test files]
?   	github.com/google/pprof/third_party/svgpan	[no test files]
--- FAIL: TestObjFile (1.77s)
    --- FAIL: TestObjFile/fixed_load_address (1.65s)
        binutils_test.go:379: SourceLine for main: got [{main /tmp/hello.c 3 0 0}]; want [{main /tmp/hello.c 3 0 3}]
    --- FAIL: TestObjFile/simulated_ASLR_address (0.12s)
        binutils_test.go:379: SourceLine for main: got [{main /tmp/hello.c 3 0 0}]; want [{main /tmp/hello.c 3 0 3}]
FAIL
FAIL	github.com/google/pprof/internal/binutils	1.867s
ok  	github.com/google/pprof/internal/driver	1.728s
ok  	github.com/google/pprof/internal/elfexec	0.092s
ok  	github.com/google/pprof/internal/graph	0.125s
ok  	github.com/google/pprof/internal/measurement	0.125s
ok  	github.com/google/pprof/internal/report	0.921s
ok  	github.com/google/pprof/internal/symbolizer	0.097s
ok  	github.com/google/pprof/internal/symbolz	0.071s
ok  	github.com/google/pprof/profile	0.114s
FAIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions