From kde-cygwin Sun Aug 21 18:20:10 2005 From: Andreas Hausladen Date: Sun, 21 Aug 2005 18:20:10 +0000 To: kde-cygwin Subject: Bug in Qt4's rcc.exe Message-Id: <4308C5DA.1080309 () gmx ! de> X-MARC-Message: https://marc.info/?l=kde-cygwin&m=112464834622060 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------000602080206020207000408" This is a multi-part message in MIME format. --------------000602080206020207000408 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit There is a bug in src/tools/rcc.cpp which raises a float point division by zero (appears as access violation). This does not happen if rcc is compiled with QT_NO_COMPRESS. The bug is in Qt 4.0.0 and 4.0.1. And there seems to be a buffer overflow in moc.exe but I'm not sure if it is really moc or another bug in the Borland C++ Compiler 5.5.1/5.6.4. The synthom is that moc.exe sometimes crashes while allocating memory. But this "sometimes" means that if I change my PATH enviroment variable (add some stupid chars or remove some entries) moc.exe processes the files. If I add a Preprocessor::Macros["blabla"] = "nonsens"; then I have to make other changes (or even non) to the PATH envvar. Another solution is to change to a subdirectory and start the makefile. Adding further DEFINEs to the command line change moc's behaviour, too. But all these solutions are not garanteed to work. That really looks like a buffer overflow. And it only happens with Borland's memory manager (and that one is not the problem as it is the MM from C++Builder. And there are lots of programs in productive use, using this MM). "Unfortunatelly" moc.exe does not crash while debugging so finding the bug (may it a bug in moc or bcc32) is not really easy. I can only identify the location where it crashes because the memory was overwritten but that code is not the problem. Regards, Andreas Hausladen --------------000602080206020207000408 Content-Type: text/plain; name="rcc.cpp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rcc.cpp.patch" Index: src/tools/rcc/rcc.cpp =================================================================== RCS file: d:\CVS\Qt4/qt-4.0.1/src/tools/rcc/rcc.cpp,v retrieving revision 1.1 diff -u -r1.1 rcc.cpp --- src/tools/rcc/rcc.cpp 20 Aug 2005 00:09:57 -0000 1.1 +++ src/tools/rcc/rcc.cpp 21 Aug 2005 17:49:39 -0000 @@ -140,7 +140,7 @@ #ifndef QT_NO_COMPRESS // Check if compression is useful for this file - if (mCompressLevel != 0) { + if (mCompressLevel != 0 && data.size() > 0) { QByteArray compressed = qCompress(reinterpret_cast(data.data()), data.size(), mCompressLevel); int compressRatio = int(100.0f * (float(data.size() - compressed.size()) / float(data.size()))); --------------000602080206020207000408 Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline _______________________________________________ kde-cygwin mailing list kde-cygwin@kde.org https://mail.kde.org/mailman/listinfo/kde-cygwin --------------000602080206020207000408--