Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(baseTrack): panic on close of nil channel #474

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adityaa30
Copy link

panic: close of nil channel

goroutine 281 [running]:
github.com/pion/mediadevices.(*baseTrack).bind.func1.1()
	/Users/naruto/go/pkg/mod/github.com/pion/[email protected]/track.go:190 +0x54
github.com/pion/mediadevices.(*baseTrack).bind.func1()
	/Users/naruto/go/pkg/mod/github.com/pion/[email protected]/track.go:204 +0x120
created by github.com/pion/mediadevices.(*baseTrack).bind
	/Users/naruto/go/pkg/mod/github.com/pion/[email protected]/track.go:186 +0x30c


Process finished with the exit code 1

@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Base: 58.08% // Head: 58.05% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (8e0c671) compared to base (76ba048).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #474      +/-   ##
==========================================
- Coverage   58.08%   58.05%   -0.04%     
==========================================
  Files          62       62              
  Lines        3691     3693       +2     
==========================================
  Hits         2144     2144              
- Misses       1420     1422       +2     
  Partials      127      127              
Impacted Files Coverage Δ
track.go 24.53% <0.00%> (-0.16%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adityaa30 adityaa30 requested a review from Sean-Der February 20, 2023 09:06
@adityaa30 adityaa30 added the bug Something isn't working label Feb 21, 2023
@@ -196,7 +196,9 @@ func (track *baseTrack) bind(ctx webrtc.TrackLocalContext, specializedTrack Trac
var doneCh chan<- struct{}
writer := ctx.WriteStream()
defer func() {
close(stopRead)
if stopRead != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing where the channel is ever not initialized or explicitly set to nil. Can you point me at that or provide a reproduction of the panic you mention?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants