Commit 91102db
Add state guard to WebRTC connection controller
WebRtcSessionDescriptionFactory forcibly flushes its callbacks during
destruction. When the WebRtcSessionDescriptionFactory executes a pending
callback, it runs after the parent PeerConnection has begun destruction.
This results in an immediate crash if the callback attempts to access or
modify members of the already dying PeerConnection object.
Example backtrace:
0 webrtc::WebRtcSessionDescriptionFactory::SdesPolicy() const ()
1 webrtc::SdpOfferAnswerHandler::ValidateSessionDescription()
2 webrtc::SdpOfferAnswerHandler::DoSetLocalDescription()
3 rtc::rtc_operations_chain_internal::OperationWithFunctor::Run() ()
4 webrtc::SdpOfferAnswerHandler::SetLocalDescription()
5 webrtc::PeerConnectionProxyWithInternal()
6 webrtc_streaming::ConnectionController::OnCreateSDPSuccess()
7 CreateSessionDescriptionObserverIntermediate::OnSuccess()
8 WebRtcSessionDescriptionFactory::~WebRtcSessionDescriptionFactory()
9 webrtc::PeerConnection::~PeerConnection() ()
10 rtc::RefCountedObject<webrtc::PeerConnection>::~RefCountedObject() ()
This change adds an explicit IsShuttingDown() state guard in the
connection controller. This ensures that any callback triggered during
destruction safely exits before attempting to access objects being
destroyed.1 parent 3585f61 commit 91102db
File tree
4 files changed
+21
-2
lines changed- base/cvd/cuttlefish/host/frontend/webrtc
- libcommon
- libdevice
4 files changed
+21
-2
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
189 | 195 | | |
190 | 196 | | |
191 | 197 | | |
| 198 | + | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
| |||
225 | 232 | | |
226 | 233 | | |
227 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
228 | 240 | | |
229 | 241 | | |
230 | 242 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| 171 | + | |
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
0 commit comments