You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if users use the OpenFilo() with the parameters like this: f, err := OpenFifo(context.Background(), filepath.Join(tmpdir, "f0"), syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0600)
The select statement will block beacuse there is no cancelFunc to awaken the <-ctx.Done().
I wrote a test function to reproduce the bug considering the test that
Hello @samuelkarp, When I used fifo, I found a potential bug, I'm not sure, maybe we can discuss to avoid a goleak
blocking position:
fifo/fifo.go
Lines 124 to 133 in 3e17f98
if users use the OpenFilo() with the parameters like this:
f, err := OpenFifo(context.Background(), filepath.Join(tmpdir, "f0"), syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0600)
The select statement will block beacuse there is no cancelFunc to awaken the <-ctx.Done().
I wrote a test function to reproduce the bug considering the test that
fifo/fifo_test.go
Line 47 in 3e17f98
The test result shows it is a goroutine leak, you can use goleak to reproduce the bug.
The text was updated successfully, but these errors were encountered: