On 05/25/2011 12:36 AM, Rich Felker wrote:
Are you claiming the freeze always happens, or only under certain
circumstances?
I've put vsnwprintf in a loop that would call it with a growing amount
of alloc
size_t written = vsnwprintf( ptr, alloc/sizeof(wchar_t), format, ap );
until the string fits. When it loops, it freezes.
erdgeist at
ubuntu:~/base-wrt.git/branches/backfire/build_dir/toolchain-arm_v5te_gcc-4.3.3+cs_uClibc-0.9.30.1_eabi/uClibc-0.9.30.1/libc/stdio$
grep OUTPUT _vfprintf.c
1215:#define OUTPUT(F,S) fputs_unlocked(S,F)
1248:#define OUTPUT(F,S) fputws(S,F)
The locks are supposed to be recursive, so this should not cause
deadlock.
I do not really care about possible bugs in uclibcs threading
implementation that might in the end cause this freeze. I was, after
browsing through the code, pointing out the obvious difference in the
macro declaration of OUTPUT in the char* case in line 1215 which uses
fputs_unlocked and the one for wchar_t* case in line 1248 which reads
fputws. After fixing this the freeze never occurred again.
Are you sure you haven't corrupted the FILE object?
I am not quite sure how I might accomplish this, the FILE object is a
temporary on stack fake structure with f.__filedes set to
__STDIO_STREAM_FAKE_VSWPRINTF_FILEDES in libc/stdio/vswprintf.c. You
noticed the 's' in
#7 0x4116ecfc in vswprintf () from /lib/libc.so.0
of my stack dump? No files involved.
erdgeist
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc