|
From: Dan K. <da...@ke...> - 2003-09-13 22:00:39
|
When running latest? valgrind on openoffice, I see
a whole bunch of source/destination overlap errors
inside the glibc function realpath() (see below).
I looked at the code in glibc-2.3.2 for realpath(), and sure enough,
it has a path where it does a strcpy(x, x) for some reason. I wrote a
little test case for this:
main()
{
char buf[256];
char *p;
buf[0] = 0;
p = realpath("/doesnotexist", buf);
printf("p %p buf %s\n", p, buf);
}
When I prepend the source for realpath() to that fragment, and compile it
into my test, I get what I expect:
==12241== Source and destination overlap in strcpy(0xbfffdfd0, 0xbfffdfd0)
==12241== at 0x400226E7: strcpy (mac_replace_strmem.c:87)
==12241== by 0x8048ACF: __realpath (x.c:186)
==12241== by 0x8048B22: main (x.c:198)
==12241== by 0x4024C8C6: __libc_start_main (in /lib/libc-2.3.2.so)
p (nil) buf /doesnotexist
But when I use the copy of realpath() in red hat 9's glibc, my test
doesn't demonstrate the problem. This is odd, since it was on
that very red hat 9 system where I saw all those errors in realpath()
when running openoffice.
What gives?
- Dan
p.s. Here's the error summary from just starting up openoffice1.1.0rc4 with --skin=addrcheck:
4 errors in context 3 of 8:
Source and destination overlap in strcpy(0xbfffcc70, 0xbfffcc70)
at 0x40021277: strcpy (mac_replace_strmem.c:87)
by 0x414DBA4A: realpath@@GLIBC_2.3 (in /lib/libc-2.3.2.so)
by 0x414DBDE9: realpath@GLIBC_2.0 (in /lib/libc-2.3.2.so)
by 0x415F152E: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libpsp645li.so)
by 0x415F1A7C: psp::PrintFontManager::initialize(void*) (in /opt/OpenOffice.org1.1.0rc4-pre/program/libpsp645li.so)
by 0x415EC724: psp::PrintFontManager::get() (in /opt/OpenOffice.org1.1.0rc4-pre/program/libpsp645li.so)
...
5 errors in context 4 of 8:
Source and destination overlap in memcpy(0xbfffcc70, 0xbfffcc70, 53)
at 0x40021529: memcpy (mac_replace_strmem.c:95)
by 0x414DBBF9: realpath@@GLIBC_2.3 (in /lib/libc-2.3.2.so)
by 0x414DBDE9: realpath@GLIBC_2.0 (in /lib/libc-2.3.2.so)
by 0x415F152E: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libpsp645li.so)
by 0x415F1A7C: psp::PrintFontManager::initialize(void*) (in /opt/OpenOffice.org1.1.0rc4-pre/program/libpsp645li.so)
by 0x415EC724: psp::PrintFontManager::get() (in /opt/OpenOffice.org1.1.0rc4-pre/program/libpsp645li.so)
...
8 errors in context 5 of 8:
Source and destination overlap in memcpy(0x435cead0, 0x435cead0, 23)
at 0x40021529: memcpy (mac_replace_strmem.c:95)
by 0x414DBBF9: realpath@@GLIBC_2.3 (in /lib/libc-2.3.2.so)
by 0x414DBDE9: realpath@GLIBC_2.0 (in /lib/libc-2.3.2.so)
by 0x40DB3480: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
by 0x40DB3391: osl_openProfile (in /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
...
8 errors in context 6 of 8:
Source and destination overlap in strcpy(0xbfff8d50, 0xbfff8d50)
at 0x40021277: strcpy (mac_replace_strmem.c:87)
by 0x414DBA4A: realpath@@GLIBC_2.3 (in /lib/libc-2.3.2.so)
by 0x414DBDE9: realpath@GLIBC_2.0 (in /lib/libc-2.3.2.so)
by 0x40DBBD45: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
by 0x40DBBF52: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
by 0x40DBC19A: osl_getAbsoluteFileURL (in /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
...
25 errors in context 7 of 8:
Source and destination overlap in memcpy(0xbfffcfe0, 0xbfffcfe0, 52)
at 0x40021529: memcpy (mac_replace_strmem.c:95)
by 0x414DBBF9: realpath@@GLIBC_2.3 (in /lib/libc-2.3.2.so)
by 0x414DBDE9: realpath@GLIBC_2.0 (in /lib/libc-2.3.2.so)
by 0x40DBCF43: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
by 0x40DBD2EB: osl_getExecutableFile (in /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
...
236 errors in context 8 of 8:
Source and destination overlap in memcpy(0xbfff8e40, 0xbfff8e40, 2)
at 0x40021529: memcpy (mac_replace_strmem.c:95)
by 0x414DBBF9: realpath@@GLIBC_2.3 (in /lib/libc-2.3.2.so)
by 0x414DBDE9: realpath@GLIBC_2.0 (in /lib/libc-2.3.2.so)
by 0x40DBBD45: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
by 0x40DBBF52: (within /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
by 0x40DBC19A: osl_getAbsoluteFileURL (in /opt/OpenOffice.org1.1.0rc4-pre/program/libsal.so.3.1.0)
...
--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
|
|
From: Dirk M. <dm...@gm...> - 2003-09-14 21:10:09
|
On Sunday 14 September 2003 00:25, Dan Kegel wrote: > What gives? we added suppressions for realpath, it seems for some reason they're not completely working for you. If you can figure out what is wrong with them, please let me know. |
|
From: Dan K. <da...@ke...> - 2003-09-14 23:40:00
|
Dirk Mueller wrote: > we added suppressions for realpath, it seems for some reason they're not > completely working for you. > > If you can figure out what is wrong with them, please let me know. I think it might be because I'm using --skin=addrcheck. BTW --gen-suppressions=yes with --skin=addrcheck seems to generate suppressions that are rejected by valgrind when you try to use them; it doesn't like the adrcheck keyword for some reason. - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 |
|
From: Nicholas N. <nj...@ca...> - 2003-09-15 07:20:27
|
On Sun, 14 Sep 2003, Dan Kegel wrote: > I think it might be because I'm using --skin=addrcheck. I just updated the HEAD so they apply for Addrcheck too. > BTW --gen-suppressions=yes with --skin=addrcheck seems to > generate suppressions that are rejected by valgrind when you > try to use them; it doesn't like the adrcheck keyword for some reason. Can you give an example? I just tried and it worked ok for me. N |