[mudflap] __mf_strlen + nl_langinfo false positive
Sergei Trofimovich
st@anti-virus.by
Fri Oct 31 13:45:00 GMT 2008
Sample session: (sources are below)
$ make
g++ main.o -g -O0 -fmudflapth -lmudflapth -pthread -o bug
$ LANG=C ./bug
*******
mudflap violation 1 (check/read): time=1225460499.358020 ptr=0x7fe182d90300 size=15
pc=0x7fe183996779 location=`(strlen region)'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/libmudflapth.so.0(__mf_check+0x59) [0x7fe183996779]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/libmudflapth.so.0(__mfwrap_strlen+0x87) [0x7fe183999017]
./bug(main+0x2e) [0x400aaa]
number of nearby objects: 0
<ANSI_X3.4-1968[14]>
Thanks!
--
sources:
// $ cat main.cpp
#include <langinfo.h>
#include <string.h>
#include <locale.h>
#include <stdio.h>
int main ()
{
setlocale (LC_ALL, "");
char * codeset = nl_langinfo (CODESET);
printf ("<%s[%u]>\n", codeset, (unsigned)strlen (codeset));
fflush (stdout); //mudflap goes crazy here too
return 0;
}
#make:
TARGET = bug
CXXFLAGS = -g -O0 -fmudflapth -lmudflapth -pthread
all: $(TARGET)
$(TARGET): main.o
$(CXX) $^ $(CXXFLAGS) -o $@ $(LIBS)
clean:
@rm $(TARGET)
---
g++ -v:
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured
with: /var/tmp/portage/sys-devel/gcc-4.3.2/work/gcc-4.3.2/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
--disable-altivec --enable-nls --without-included-gettext
--with-system-zlib --disable-checking --disable-werror
--enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-cld --disable-libgcj
--enable-languages=c,c++,treelang,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.2
p1.0'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20081031/39a6bfe7/attachment.sig>
More information about the Gcc-bugs
mailing list