uber-go / goleak

Goroutine leak detector
MIT License
4.48k stars 148 forks source link

Is these function in testing package should be filtered in default? #104

Closed Mskxn closed 1 year ago

Mskxn commented 1 year ago

I got some FP with backtrace looks like this

        [Goroutine 1 in state chan receive, with testing.tRunner.func1 on top of the stack:
        goroutine 1 [chan receive]:
        testing.tRunner.func1()
            C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:1542 +0x4a5
        testing.tRunner(0xc0000376c0, 0xc000071c88)
            C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:1582 +0x144
        testing.runTests(0xc000055b80?, {0x16ac3a0, 0x1b, 0x1b}, {0xc00007c180?, 0x100c000071d10?, 0x0?})
            C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:2034 +0x489
        testing.(*M).Run(0xc000055b80)
            C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:1906 +0x63a
        main.main()
            _testmain.go:101 +0x1aa
        ]

Indeed, these functions also occurs on the top of the stack, is them missed or by design?

testing.tRunner.func1"
"testing.(*F).Fuzz.func1"
"testing.runFuzzTests"
"testing.runFuzzing"
JacobOaks commented 1 year ago

Hey, can you give us a repro for this?

Mskxn commented 1 year ago

They are found when using go/fuzzing to test the program. I don't have a stable repro but I think it is not related to a specific test case.

sywhang commented 1 year ago

internal ref: GO-2002