platform_bionic/libc/stdio
Yabin Cui 76144aaa63 Change _stdio_handles_locking into _caller_handles_locking.
It is reported by tsan that funlockfile() can unlock an unlocked mutex.
It happens when printf() is called before fopen() or other stdio stuff.
As FLOCKFILE(fp) is called before __sinit(), _stdio_handles_locking is false,
and _FLOCK(fp) will not be locked. But then cantwrite(fp) in __vfprintf()
calls__sinit(), which makes _stdio_handles_locking become true, and
FUNLOCKFILE(fp) unlocks _FLOCK(fp).

Change _stdio_handles_locking into _caller_handles_locking,
so __sinit() won't change its value. Add test due to my previous fault.

Bug: 25392375
Change-Id: I483e3c3cdb28da65e62f1fd9615bf58c5403b4dd
2015-11-20 17:44:26 -08:00
..
findfp.c Make struct FILE opaque. 2015-10-12 12:53:42 -07:00
fread.c Fix fread returning bad data. 2015-02-27 18:22:45 -08:00
glue.h Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC. 2015-10-23 12:32:52 -07:00
local.h Change _stdio_handles_locking into _caller_handles_locking. 2015-11-20 17:44:26 -08:00
refill.c Fix stdio read after EOF behavior. 2015-10-09 17:57:26 -07:00
snprintf.c Remove _FORTIFY_SOURCE in implementation files. 2013-10-01 15:02:07 -07:00
sprintf.c Remove _FORTIFY_SOURCE in implementation files. 2013-10-01 15:02:07 -07:00
stdio.c Don't use TEMP_FAILURE_RETRY on close in bionic. 2015-05-15 16:20:07 -07:00
stdio_ext.cpp Change _stdio_handles_locking into _caller_handles_locking. 2015-11-20 17:44:26 -08:00
wcio.h Fix flockfile(3) and friends for stdin/stdout/stderr too. 2014-11-19 15:16:51 -08:00