testing: fuzz funcs that panic print redundant stack frames #48885
Labels
fuzz
Issues related to native fuzzing support
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Note that I got a fairly large stack frame, but I don't actually find most of those entries useful. Compare that with a
func TestFoo(t *testing.T) { panic("foo") }
, which prints roughly the same as afunc FuzzFoo(f *testing.F) { panic("foo") }
:The lowest hanging fruit is the
runtime/debug.Stack
stack frame from the original output. https://pkg.go.dev/runtime#Callers certainly supports skipping a number of frames, for example. I'm not sure why callingdebug.Stack
includes its own frame, but I've run out of time to figure out if that is by design.And, more in general and not specifically to fuzzing, I would hope that other frames like
testing.tRunner.func1
ortesting.tRunner
would not be included. Ideally, the frame would go fromTestFoo
topanic
, and nothing else - because as a user, that's the code I wrote. I get that including the full stack trace fromfunc main
is correct, but in practice that's usually not what the user cares about.cc @katiehockman @jayconrod
The text was updated successfully, but these errors were encountered: