Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Symbolizing with GNU addr2line 2.40 records `??:?` as the filename of a location with no line info

Closed Beginner friendly
#1,044 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1045 by @TomerAberbach — merged
  • #1046 by @skyfireitdiy — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
tooling

Research direction

The parsing lives in readFrame in internal/binutils/addr2liner.go, around lines 150-165, which currently clears the filename only for ??:0. Read that function and the existing addr2liner tests, then check how the : split handles a non-numeric line. Done when ??:? yields an empty filename like ??:0 and a test covers both forms.

Written by the indexing model from the issue text.

Description

When pprof symbolizes through GNU addr2line from binutils 2.40, it records ??:? as the filename of a location with no file and line info. addr2line 2.40 prints ??:? for an unknown location, but pprof recognizes only ??:0.

Reproduction

In golang:1.26-bookworm (GNU addr2line 2.40), with a heap profile from gperftools:

apt-get update -qq && apt-get install -y -qq google-perftools libgoogle-perftools-dev
go install github.com/google/pprof@latest

cat > t.c <<'C'
#include <stdlib.h>
#include <string.h>
__attribute__((noinline)) char *grow(int n) { char *p = malloc(n); memset(p, 1, n); return p; }
int main(void) { char *k[64] = {0}; for (int i = 0; i < 100000; i++) { free(k[i % 64]); k[i % 64] = grow(64 + i % 512); } return 0; }
C
gcc -O2 -o t t.c   # no -g
HEAPPROFILE=h LD_PRELOAD=$(find / -name libtcmalloc.so -print -quit) ./t
heap=$(ls h.*.heap | sort | tail -1)

addr2line -f -C -i -e ./t 0x$(nm ./t | awk '$3=="grow"{print $1}')
"$(go env GOPATH)/bin/pprof" -raw ./t "$heap" | sed -n '/^Locations/,/^Mappings/p'
Actual

addr2line reports the location as unknown:

grow
??:?

pprof records ??:? as the filename:

     1: 0xaaaae88f08f7 M=1 grow ??:?:0:0 s=0
     2: 0xaaaae88f0757 M=1 main ??:?:0:0 s=0
     4: 0xffff85df7817 M=6 __libc_start_main ??:?:0:0 s=0

A profile written with -proto contains ??:? as each function's filename, and tools reading it show ??:? as the source location.

Expected

An empty filename, as pprof produces for addr2line's ??:0. With llvm-symbolizer installed in the same image, pprof writes these locations with an empty filename (:0:0).

Environment
  • pprof v0.0.0-20261008003335-7bae8d8c4c9e (@latest)
  • GNU addr2line (GNU Binutils for Debian) 2.40
  • Debian bookworm, linux/arm64
Cause

readFrame empties the filename only for ??:0. For ??:?, the text after the last : is not a number, so the whole string stays as the filename:

https://github.com/google/pprof/blob/7bae8d8c4c9ebc3886a79f796fbde65b7e1316f8/internal/binutils/addr2liner.go#L150-L165

Dominant language
Go
Stars
9.3k
Forks
678
Avg merge
2d 6h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/pprof

All issues in google/pprof

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.