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.
![1712307934228](https://private-user-images.githubusercontent.com/61485003/319929268-2f1aec2e-6d74-46d3-94c7-7fb4dc56933e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NjEzMzksIm5iZiI6MTcyNDU2MTAzOSwicGF0aCI6Ii82MTQ4NTAwMy8zMTk5MjkyNjgtMmYxYWVjMmUtNmQ3NC00NmQzLTk0YzctN2ZiNGRjNTY5MzNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDA0NDM1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVkOTFkZmQ2YjhjMTYwYWY0MzI4YWYxZmM1MzNiNTc0MmI5NTVjNTQ1NTBiYjdiYWIxYTU3ODkxMmYzMTkwYWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2GZ3lAPIxDQFjO-HGLGux9Y87IrfeEptHNFIFqlEo0Y)
The text was updated successfully, but these errors were encountered: