Commit ac75f4c
Bug 2000941 - Vendor libwebrtc from 426f0590b6
Upstream commit: https://webrtc.googlesource.com/src/+/426f0590b6e4ae4541ac30fe898e5fdfcde4a7d5
Fix threading issue in "fake" (test) DescriptionObservers
This fixes a problem affecting PeerConnectionWrapper and other
classes using FakeSetLocalDescriptionObserver and
FakeSetRemoteDescriptionObserver whereby callbacks would arrive on
a different thread than the test thread. This has caused some flake
in tests, but mostly has been masked by other synchronous blocking
calls between the test thread and signaling thread.
The pattern was that the fake observer object was being polled from
the test thread until an operation completed on the signaling thread,
leading to tsan errors such as detected here:
https://chromium-swarm.appspot.com/task?id=735c37c9a2b00011&o=true&w=true
Brief (and trimmed) example stacks:
WARNING: ThreadSanitizer: data race (pid=259249)
Write of size 1 at 0x721000023d70 by thread T1:
...
#2 FakeSetLocalDescriptionObserver::OnSetLocalDescriptionComplete(...)
#3 SdpOfferAnswerHandler::DoSetLocalDescription(...)
...
#5 rtc_operations_chain_internal::OperationWithFunctor<...>::Run()
#6 ChainOperation<(lambda at ../../pc/sdp_offer_answer.cc:1678:7)>
#7 SdpOfferAnswerHandler::SetLocalDescription(...)
...
Previous read of size 1 at 0x721000023d70 by main thread:
...
#1 called pc/test/mock_peer_connection_observers.h:356:39
#2 operator() pc/peer_connection_wrapper.cc:183:3
#3 operator() test/wait_until.h:84:24
...
#6 WaitUntil(FunctionView<bool ()>, WaitUntilSettings)
#7 WaitUntil<(lambda at ../../pc/peer_connection_wrapper.cc:183:3)>
#8 PeerConnectionWrapper::SetLocalDescription(...)
...
Bug: none
Change-Id: Iadc4634fe78d5d1b252b1a3c05d7ae9c5b76922c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409340
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45651}1 parent 8e6e4b8 commit ac75f4c
File tree
2 files changed
+52
-22
lines changed- third_party/libwebrtc
- pc/test
2 files changed
+52
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
Lines changed: 50 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
354 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
355 | 363 | | |
356 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
357 | 373 | | |
| 374 | + | |
358 | 375 | | |
359 | 376 | | |
360 | 377 | | |
361 | 378 | | |
362 | | - | |
363 | | - | |
364 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
365 | 390 | | |
366 | 391 | | |
367 | 392 | | |
368 | | - | |
369 | | - | |
| 393 | + | |
| 394 | + | |
370 | 395 | | |
371 | 396 | | |
372 | | - | |
373 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
374 | 400 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 401 | + | |
380 | 402 | | |
381 | | - | |
382 | | - | |
383 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
384 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
385 | 414 | | |
386 | 415 | | |
387 | | - | |
388 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
389 | 419 | | |
390 | 420 | | |
391 | 421 | | |
| |||
0 commit comments