Skip to content

32-bit int overflow in heap profile #100

@sporksmith

Description

@sporksmith

Originally golang/go#48580

I'm profiling a long-running program using LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc_and_profiler.so.4 HEAPPROFILE=shadow.heap HEAP_PROFILE_TIME_INTERVAL=180

The initial profiles are parsed fine by pprof, but after a point pprof refuses to parse any subsequent profiles.

Inspecting the profiles themselves, it looks like a 32-bit integer is overflowing.

First line from the last parseable profile:

heap profile: 2237252: 888238604 [2144665071: 188608279238] @ heapprofile

And from the first un-parseable profile:

heap profile: 2250136: 892383061 [-2147316050: 188867582594] @ heapprofile

I've confirmed that editing the files to change the negative number to a positive number allows pprof to parse it. It also works if I put a number there too large to be represented by a 32-bit int, suggesting that pprof supports a larger integer size.

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