No description. Add one?
  • Java 78%
  • Kotlin 11.8%
  • AIDL 4.4%
  • C++ 3.7%
  • C 1.5%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Zuklie e8a769f2c3 Fix deadlock from outside Perfetto mutex
Fixes the deadlock described by the below two thread states:

Thread 1:
- ConsumeAll() (takes mBufferMutex)
- perfetto::DataSource::Trace() (takes Perfetto mutex)

Thread 2:
- StartDataSourceImpl() (takes Perfetto mutex)
- NetworkTracePoller::Start() (takes mBufferMutex)

Locks should always be taken in the same order. To achieve this,
ConsumeAll only locks mBufferMutex while accessing the buffer, and
releases it before calling the callback (which under typical use calls
DataSource::Trace() as in "Thread 1").

As a fun side note, Start() always calls ConsumeAll(), so there exists a
lock sequence of perfetto mutex -> mBufferMutex -> perfetto mutex, thus
this order was always "exercised". However, Perfetto uses a recursive
mutex, so the second lock was a no-op, making this hard to catch.

Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: If8c5e0e218666ec53a287ec56333a6d3b8cfe08f
2024-09-18 18:41:11 +00:00
bpf BPF: rename bpf_defaults to bpf_cc_defaults 2024-09-13 18:41:24 +00:00
clatd [DON'T BLOCK] Test ownership migration rules 2024-01-31 12:34:50 +00:00
common Merge "Add flag for collecting tethering active sessions metrics" into main 2024-08-30 03:10:53 +00:00
Cronet Move Cronet's MTS/CTS to external/cronet 2024-05-02 11:54:56 +00:00
DnsResolver Add firewall chains for HAPPY_BOX and user/admin PENALTY_BOX 2024-04-23 15:04:28 +09:00
framework Merge "Fix comment" into main 2024-09-12 15:51:40 +00:00
framework-t Merge "No-op refactoring for TrafficStats APIs" into main 2024-09-11 01:56:42 +00:00
nearby Make java_sdk_library dependencies explicit 2024-09-10 00:01:31 +00:00
networksecurity Merge "Make java_sdk_library dependencies explicit" into main 2024-09-10 19:12:45 +00:00
remoteauth Merge "Use LazyLock rather than lazy_static macro." into main 2024-09-11 17:46:22 +00:00
service Import translations. DO NOT MERGE ANYWHERE 2024-09-11 12:57:11 -07:00
service-t Fix deadlock from outside Perfetto mutex 2024-09-18 18:41:11 +00:00
staticlibs Remove assert for R+ 2024-09-12 04:32:59 +00:00
tests Merge "Enable secondary_user_on_secondary_display for CtsNetApi23TestCases" into main 2024-09-17 07:55:02 +00:00
Tethering Merge "Make java_sdk_library dependencies explicit" into main 2024-09-10 19:12:45 +00:00
thread [Thread] rename requestThreadNetwork to registerThreadNetworkCallback 2024-09-12 05:44:56 +00:00
tools Update aospify_device for T device 2024-05-22 13:10:19 +09:00
.gitignore Ignores vim temporary files from git 2023-12-23 17:45:32 +08:00
OWNERS Move the owner of xfrm netlink source code to its own directory. 2023-11-22 18:50:00 +09:00
OWNERS_core_networking Update OWNERS to reflect reorg. 2024-04-10 23:24:14 +00:00
OWNERS_core_networking_xts Add "no-op refactors" reviews for delegated reviewers 2024-06-20 06:29:09 +00:00
PREUPLOAD.cfg Enable builtin formatting hooks 2024-07-17 11:51:08 +09:00
TEST_MAPPING Add CtsHostsideNetworkTests to postsubmit. 2024-09-09 20:03:03 +09:00