summaryrefslogtreecommitdiff
path: root/libc/stdio/stdio_ext.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2021-07-02 15:46:18 -0700
committerChristopher Ferris <cferris@google.com>2021-07-15 01:29:17 +0000
commite9b672b3e0f94f020689eb9df1195ef410c9c1f4 (patch)
treea1a5bfa23949cf21e41ae2acc9b7ef75c1c01fd6 /libc/stdio/stdio_ext.cpp
parent1986e6b936b1e49d42eb8c298ecdee71a2e27dce (diff)
Fix race when frees after main thread finishes.
When the main thread is exiting, the code deleted the g_debug global pointer and destroys the disable pthread key. Unfortunately, if malloc debug was enabled in a way that requires a header for the pointer, any frees that occur after the main thread is torn down result in calls to the underlying allocator with bad pointers. To avoid this, don't delete the g_debug pointer and don't destroy the disable pthread key. Added a new system test that allocates a lot of pointers and frees them after letting the main thread finish. Also, fix one test that can fail sporadically due to a lack of unwinding information on arm32. Bug: 189541929 Test: Passes new system tests. Change-Id: I1cfe868987a8f0dc880a5b65de6709f44a5f1988 Merged-In: I1cfe868987a8f0dc880a5b65de6709f44a5f1988 (cherry picked from commit 33d73379aad3ed7dcbb9b10f945d3bc6264b79bd)
Diffstat (limited to 'libc/stdio/stdio_ext.cpp')
0 files changed, 0 insertions, 0 deletions