https://bugzilla.novell.com/show_bug.cgi?id=385634 Summary: vsnprintf() returns empty buffer when size argument is large Product: openSUSE 11.0 Version: Factory Platform: i686 OS/Version: openSUSE 11.0 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: shawn.bohrer@gmail.com QAContact: qa@suse.de Found By: Beta-Customer Created an attachment (id=211765) --> (https://bugzilla.novell.com/attachment.cgi?id=211765) Code sample that reproduces the issue On my machine I noticed I was getting an empty buffer when I passed INT32_MAX as the size to vsnprintf(). From my testing smaller sizes work as expected, so I narrowed it down to numbers less than 1079009912 seem to always work, and greater always fail. However I suspect there is a race condition since at exactly 1079009912 it is about 50/50 work/fail and I don't see anything special about that number. To reproduce try the attached vsnprintf.cpp which is currently set to INT32_MAX: g++ vsnprintf.cpp /a.out relevant info: rpm -qa | grep gcc gcc43-c++-4.3.1_20080425-2 gcc-c++-4.3-32 gcc42-4.2.1_20070724-17 gcc-4.3-32 gcc-gij-4.3-32 gcc43-4.3.1_20080425-2 gcc43-gij-4.3.1_20080425-2 gcc42-gij-4.2.1_20070724-26 gcc42-c++-4.2.1_20070724-17 libgcc43-4.3.1_20080425-2 rpm -qa | grep glibc glibc-devel-2.8-6 glibc-2.8-6 glibc-i18ndata-2.8-8 glibc-locale-2.8-8 g++ --version g++ (SUSE Linux) 4.3.1 20080425 (prerelease) [gcc-4_3-branch revision 134659] Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. cat /proc/cpuinfo | grep "model name" model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.