runtime: improve "sweep increased allocation count" diagnostics #21729
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
The infamous "sweep increased allocation count" panic is not very informative. What it really means is that a free object was found to be live. It should say that, and it should say which object it is and dump its contents. Essentially, it can cheaply give half of the information that gccheckmark can. This half may even be enough to debug the problem from a core dump and a heap graph.
The comments around the panic should give additional context (not worth printing), like saying that common causes are bad liveness maps, past-the-end pointers, unsafe conversions from pointers to integers and back to pointers, and just plain wild pointers. The comments should suggest running with GODEBUG=gccheckmark=1 to find the source of bad pointer.
/cc @RLH @randall77
The text was updated successfully, but these errors were encountered: