I am using Quazip for my project and it works great, but now that I am moving my source code from Qt4 to Qt5, my program terminates abnormally, getting this message from console:
QIODevice::open: File access not specified
*** Error in `/usr/local/tupi/bin/tupi.bin': free(): invalid pointer: 0x00007ffff4270d20 ***
I was debugging my code and I found this:
10 0x00007ffff3e6fdd5 in QObject::~QObject() () from /home/xtingray/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Core.so.5
11 0x00007ffff3d7fe82 in QFile::remove(QString const&) () from /home/xtingray/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Core.so.5
12 0x00007ffff014fc98 in JlCompress::compressDir(QString, QString, bool) () from /usr/lib/x86_64-linux-gnu/libquazip.so.0
13 0x00007ffff2ea1034 in TupPackageHandler::makePackage(QString const&, QString const&) () from /usr/local/tupi/lib64/tupi/libtupi.so.1
It seems there's an issue within the method JlCompress::compressDir(QString, QString, bool) and Qt 5.2.x
Thanks!
Hmm... I've just tested on fresh Ubuntu 14.04 install using the bundled Qt 5.2.1. Worked fine. My version is 32 bit, though (got no VT-x, can't run 64-bit VM). Could it be that you already had some sort of memory corruption by that point, and that this crash was a side effect of that?
Try running under Valgrind, preferably with debugging symbols included. That usually does wonders.
This is my story:
So, summarizing:
Last 2 days I have been going crazy testing and trying options. Now that I found the right way, I'm a little sad about the complexity of the settings to compile my project from Ubuntu 14.04 :/
The million dollar question is: Why the Quazip packages from Ubuntu give me 2 bugs but the compiled binaries don't if we are talking of the same version (0.6.2) ?
A real million dollar question. I just apt-get source libquazip0, and it found out that their .orig package is bitwise identical to the one published on my SF.net project page, and that the debian package contains only two minor patches: one removes the ABI version 1.0.0 (which kind of makes sense since the QuaZIP version is 0.6.2) and disables the qztest build (which is obviously not necessary to build a package).
I can only suggest again that you use Valgrind instead of gdb. It can catch an earlier memory error while gdb only caches the later random crash.
I've just tried to run my test suite on the Ubuntu quazip 0.6.2. It crashes on the very first test when trying to create a test archive. This is ridiculous. Something is terribly wrong with the Ubuntu package, but I'm not feeling like doing maintainer's job. I can only advise to build it from sources if in doubt. Even better use the SVN version, the trunk is usually very stable.
Thank you for the feedback! I understand your point about the "maintainer's job" because I suffer from the same problem with my package. Anyway, I would like to learn how to run your test suite, I'm very interested in to report this issue to the Ubuntu community. Could you give me some hint?
Something along these lines:
Well, now the Ubuntu guys know that something is wrong with your project's package ;)
https://bugs.launchpad.net/ubuntu/+source/libquazip/+bug/1317551