[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-cygwin
Subject:    Bug in Qt4's rcc.exe
From:       Andreas Hausladen <Andreas.Hausladen () gmx ! de>
Date:       2005-08-21 18:20:10
Message-ID: 4308C5DA.1080309 () gmx ! de
[Download RAW message or body]

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

["rcc.cpp.patch" (text/plain)]

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<uchar *>(data.data()), \
data.size(), mCompressLevel);  
         int compressRatio = int(100.0f * (float(data.size() - compressed.size()) / \
float(data.size())));



_______________________________________________
kde-cygwin mailing list
kde-cygwin@kde.org
https://mail.kde.org/mailman/listinfo/kde-cygwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic