No description
Find a file
Taylor Brandstetter 7b69a44c8b Fix ABA problem when iterating epoll events.
Original patch contributed by andrey.semashev@gmail.com.

In PhysicalSocketServer::WaitEpoll(), the loop verifies that the
signalled dispatcher is in dispatchers_ set. It does so by looking up
the dispatcher pointer in the set. This is vulnerable to the ABA
problem because one dispatcher may be removed and destroyed and another
created and added with the same address before epoll reports an event
for the old dispatcher. The same issue exists for other Wait
implementations, if a dispatcher is removed and a new one added with
the same socket handle is the old.

This is avoided by using a 64-bit key for looking up the dispatcher
in the set. The key is set from a running counter which gets incremented
when a dispatcher is added to the set, so even if the same dispatcher
pointer is added, removed and added again, the key value will be
different.

This changes the storage of dispatchers_ from a set to a flat_hash_map,
which uses a bit more memory but has faster lookup (O(1) as opposed to
O(log n)).

Bug: webrtc:11124
Change-Id: I6d206e1a367b58ba971edca9b48af7664384b797
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181027
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32019}
2020-08-31 20:26:37 +00:00
api Move ABSL_MUST_USE_RESULT at the beginning of the method decl. 2020-08-31 08:19:29 +00:00
audio DTMF Event Sub-API on VoIP API 2020-08-20 17:10:02 +00:00
build_overrides set perfetto flag to default value of false 2020-07-22 10:14:53 +00:00
call Move FrameCounts and FrameCountObserver to common_video/frame_counts.h 2020-08-27 09:53:18 +00:00
common_audio Support AVX2/FMA intrinsics in audio FIR filter 2020-08-19 10:21:31 +00:00
common_video Move FrameCounts and FrameCountObserver to common_video/frame_counts.h 2020-08-27 09:53:18 +00:00
data Remove old data files. 2018-10-05 14:40:21 +00:00
docs Updated IOS documentation with correct build_ios_libs.py path 2020-08-17 09:37:59 +00:00
examples Update gradle wrapper & gradle plugin. 2020-08-28 08:58:57 +00:00
logging Ensure RtcEventLogEncoderNewFormat::EncodeRemoteEstimate handles infite 2020-08-25 09:22:49 +00:00
media [adaptation] Expose target pixels and max framerate in VideoAdapter 2020-08-31 09:46:21 +00:00
modules Move ABSL_MUST_USE_RESULT at the beginning of the method decl. 2020-08-31 08:19:29 +00:00
p2p Add WebRTC-IceFieldTrial send_ping_on_selected_ice_controlling 2020-08-27 12:07:04 +00:00
pc Call SetVideoCodecSwitchingEnabled on every video media channel. 2020-08-27 21:08:28 +00:00
resources iSAC API wrapper unit test fix 2020-02-27 14:27:23 +00:00
rtc_base Fix ABA problem when iterating epoll events. 2020-08-31 20:26:37 +00:00
rtc_tools Use non-deprecated EncodedImageCallback::OnEncodedImage in rtc_tools 2020-08-12 09:17:15 +00:00
sdk update JavaAudioDeviceModule.Builder.build() to return JavaAudioDeviceModule 2020-08-26 17:43:37 +00:00
stats Reland "Implement packets_(sent | received) for RTCTransportStats" 2020-07-10 11:50:59 +00:00
style-guide Add style guide rule about paired .h and .cc files 2018-03-14 13:02:35 +00:00
system_wrappers Reland "Support AVX2/FMA intrinsics in Audio Resampler module" 2020-08-17 10:40:44 +00:00
test Revert "Make cricket::SctpTransportInternalFactory injectable through PeerConnectionFactory Deps" 2020-08-27 13:59:57 +00:00
tools_webrtc Fix missing isolated output directory. 2020-08-31 11:40:10 +00:00
video Reland "[Adaptation] Remove QualityScalerResource when disabled." 2020-08-26 06:33:43 +00:00
.clang-format Tune ObjC clang-format configuration 2017-05-11 09:14:18 +00:00
.git-blame-ignore-revs Let git-hyper-blame ignore new format cleanup. 2019-07-11 16:18:51 +00:00
.gitignore Add .clangd to .gitignore 2019-10-28 12:27:50 +00:00
.gn Reenable libaom decoder by default 2020-03-18 18:04:41 +00:00
.vpython Add source-side perf upload script for WebRTC. 2019-11-18 14:37:01 +00:00
abseil-in-webrtc.md Use absl_deps in order to preapre to the Abseil component build release. 2020-06-08 12:59:40 +00:00
AUTHORS Changed AndroidVideoDecoder to also handle IllegalArgumentException and IllegalStateException during the init of the decoder and fallback to a software decoder 2020-08-05 09:41:49 +00:00
BUILD.gn Delete unneeded dependencies on deprecated build target webrtc_common 2020-08-25 07:33:12 +00:00
CODE_OF_CONDUCT.md Add code of conduct to WebRTC repo 2017-05-16 12:09:13 +00:00
codereview.settings Don't add webrtc-reviews@ to CC, it can be added globally on Gerrit 2018-10-25 08:19:53 +00:00
common_types.h Move FrameCounts and FrameCountObserver to common_video/frame_counts.h 2020-08-27 09:53:18 +00:00
DEPS Roll chromium_revision 4bf6d39883..a50ca66bb1 (802598:802712) 2020-08-28 18:42:54 +00:00
ENG_REVIEW_OWNERS Enforce LGTM from owners of depends-on paths in DEPS via presubmit. 2018-09-28 12:49:54 +00:00
LICENSE Moving src/webrtc into src/. 2017-09-15 04:25:06 +00:00
license_template.txt Update template to follow chromium copyright style 2013-04-24 01:01:28 +00:00
native-api.md Make transient suppression optionally excludable via defines 2020-04-02 11:44:07 +00:00
OWNERS Remove phoglund as root owner. 2020-03-30 12:15:56 +00:00
PATENTS Moving src/webrtc into src/. 2017-09-15 04:25:06 +00:00
PRESUBMIT.py Inclusive language in PRESUBMIT.py. 2020-07-22 10:01:23 +00:00
presubmit_test.py Use source_sets in component builds and static_library in release builds. 2019-10-17 21:17:18 +00:00
presubmit_test_mocks.py Inclusive language in PRESUBMIT.py. 2020-07-22 10:01:23 +00:00
pylintrc Fixing py lint errors 2018-07-23 15:28:48 +00:00
README.chromium Add CPEPrefix. 2020-07-13 11:42:07 +00:00
README.md Fix link in documentation. (take 2) 2020-04-16 11:08:43 +00:00
style-guide.md C++ style: We don't allow designated initializers 2020-06-03 09:11:09 +00:00
WATCHLISTS Remove benwright@webrtc.org from WATCHLISTS 2020-01-31 18:46:52 +00:00
webrtc.gni Reland "Support AVX2/FMA intrinsics in Audio Resampler module" 2020-08-17 10:40:44 +00:00
webrtc_lib_link_test.cc Rewrite the lib link test to just be a binary. 2019-10-18 07:42:20 +00:00
whitespace.txt Trigger CI bots. 2020-07-15 17:50:55 +00:00

WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.

Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.

The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.

Development

See here for instructions on how to get started developing with the native code.

Authoritative list of directories that contain the native API header files.

More info