Bug 192798 - Ark crashes when opening ZIP archives
Summary: Ark crashes when opening ZIP archives
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Harald Hvaal
URL:
Keywords:
: 192739 193536 194443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-15 18:44 UTC by Michal Ziabkowski
Modified: 2009-05-28 18:09 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A test archive with three zero-byte files (412 bytes, application/zip)
2009-05-15 22:08 UTC, Michal Ziabkowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Ziabkowski 2009-05-15 18:44:05 UTC
Version:           2.13 (using 4.2.85 (KDE 4.2.85 (KDE 4.3 Beta1)), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.29-gentoo-r3

After upgrading to KDE 4.2.85, I noticed a regression when opening ZIP files in Ark.

Long story short, most ZIP archives I throw at it result in a crash. This behaviour seems semi-random. Sometimes the archive will open, albeit with mismatched fields and some garbage in some columns.

After recompiling with debug enabled I get this:
ASSERT failure in QList<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qlist.h, line 403

Just about the only archives which don't trigger the bug are ones with single files inside. Those, however, display as if they were blank. This seems to be a related issue.

Steps to reproduce:
1) Create any ZIP archive with multiple files, using the zip command or whatever.
2) Try to open it with Ark.

Qt: 4.5.1
KDE: 4.2.85 (KDE 4.2.85 (KDE 4.3 Beta1))
Comment 1 Dario Andres 2009-05-15 19:30:51 UTC
Can you try to generate a backtrace? (do you get the DrKonqi window?) Thanks
I'm going to try to reproduce it later.
Comment 2 Dario Andres 2009-05-15 20:03:31 UTC
Here using:

Qt: 4.5.1 (qt-copy  958974)
KDE: 4.2.85 (KDE 4.2.85 (KDE 4.3 Beta1))
kdelibs svn rev. 967040 / kdebase svn rev. 967041
kdeutils svn rev. 968429
libzip 0.9
zip 3.0
on ArchLinux i686 - Kernel 2.6.29.2

I could reproduce the crash.

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb43acb90 (LWP 22275)]
0xb6a67a38 in QProcess::d_func (this=0x0) at io/qprocess.h:184
184         Q_DECLARE_PRIVATE(QProcess)
(gdb) bt
#0  0xb6a67a38 in QProcess::d_func (this=0x0) at io/qprocess.h:184
#1  0xb6a64ddf in QProcess::terminate (this=0x0) at io/qprocess.cpp:1643
#2  0xb80c4705 in Kerfuffle::CliInterface::failOperation (this=0x95910e8)
    at /home/kde-devel/kde/src/KDE/kdeutils/ark/kerfuffle/cliinterface.cpp:419
#3  0xb80c4f80 in Kerfuffle::CliInterface::list (this=0x95910e8)
    at /home/kde-devel/kde/src/KDE/kdeutils/ark/kerfuffle/cliinterface.cpp:73
#4  0xb80b1e55 in Kerfuffle::ListJob::doWork (this=0x95d6a38)
    at /home/kde-devel/kde/src/KDE/kdeutils/ark/kerfuffle/jobs.cpp:144
#5  0xb80b54b5 in Kerfuffle::ThreadExecution::run (this=0x95db1f8)
    at /home/kde-devel/kde/src/KDE/kdeutils/ark/kerfuffle/threading.cpp:41
#6  0xb69ca77f in QThreadPrivate::start (arg=0x95db1f8) at thread/qthread_unix.cpp:189
#7  0xb693a4c5 in start_thread () from /lib/libpthread.so.0
#8  0xb6786f9e in clone () from /lib/libc.so.6
Comment 3 Dario Andres 2009-05-15 20:06:07 UTC
Bug 192739 could be related to this. Thanks
Comment 4 Dario Andres 2009-05-15 20:35:30 UTC
*** Bug 192739 has been marked as a duplicate of this bug. ***
Comment 5 Dario Andres 2009-05-15 20:39:50 UTC
I'm about to commit a fix to this bug.
As a workaround, ensure you have the "zipinfo" command in your path. If this application isn't found Ark will crash.
(in ArchLinux, this application is inside the "unzip" package)
Thanks
Comment 6 Dario Andres 2009-05-15 20:40:13 UTC
SVN commit 968443 by darioandres:

Check the m_process object before calling the terminate() method.
In some situations (when the helper app isn't found), the m_process 
object is not even created and this will lead to a crash

BUG: 192798


 M  +2 -1      cliinterface.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=968443
Comment 7 Michal Ziabkowski 2009-05-15 21:14:24 UTC
Actually, I do have a zipinfo binary. Also, it seems there have been some other changes to cliinterface.cpp since 4.2.85 was tagged. I've backported those to my build. Didn't help. The bug is still there.
Comment 8 Dario Andres 2009-05-15 21:15:40 UTC
Mh, so my backtrace was unrelated to your crash
Try to get a full backtrace and we will look at it. Thanks
Comment 9 Michal Ziabkowski 2009-05-15 21:55:04 UTC
I'm having some problems with building a proper debug build on Gentoo. Not sure why. Anyway, the best info I can get at the moment is:
ark(12222)/kio (KDirListerCache) KDirListerCache::forgetDirs: KDirLister(0x8eceff8)  item moved into cache:  KUrl("file:///tmp")
ark(12222)/ark (kdeutils) Kerfuffle::factory:
ark(12222)/kdecore (trader) KMimeTypeTrader::query: query for mimeType  "application/zip" ,  "Kerfuffle/Plugin"  : returning  2  offers
ark(12222)/ark (kdeutils) Kerfuffle::factory: Loading library  "kerfuffle_clizip"
ark(12222)/ark (kdeutils) Part::setBusyGui:
ark(12222)/ark (kdeutils) Kerfuffle::ThreadExecution::run: Run
ark(12222)/ark (kdeutils) Kerfuffle::CliInterface::createProcess:
ark(12222)/ark (kdeutils) Kerfuffle::CliInterface::executeProcess: Executing  "/usr/bin/unzip" ("-l", "-v", "/tmp/1.zip")
ASSERT failure in QList<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qlist.h, line 403
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = ark path = <unknown> pid = 12222

I'll see if I can fix the problem I'm having. Something awry with the ebuilds from Gentoo's kde-testing, I think. Will look into this.

Some more info about the packages I have installed:
ZipInfo 2.42 of 28 February 2005, by Greg Roelofs and the Info-ZIP group.
Zip 2.32 (June 19th 2006)
UnZip 5.52 of 28 February 2005, by Info-ZIP.
Comment 10 Dario Andres 2009-05-15 21:56:47 UTC
Could you append a test zip file ? Thanks. I wonder if this could be related to locales...
Thanks
Comment 11 Michal Ziabkowski 2009-05-15 22:08:05 UTC
Created attachment 33697 [details]
A test archive with three zero-byte files
Comment 12 Dario Andres 2009-05-15 22:09:48 UTC
Works for me here... let's wait for Harald to investigate.
Sorry about mixing different crashes :\
Comment 13 Raphael Kubo da Costa 2009-05-15 22:28:09 UTC
(In reply to comment #7)
> Actually, I do have a zipinfo binary. Also, it seems there have been some other
> changes to cliinterface.cpp since 4.2.85 was tagged. I've backported those to
> my build. Didn't help. The bug is still there.
Did you backport only the changes to cliinterface.cpp? IIRC there have been some changes to clizipplugin itself too. If possible, could you try trunk or backport all the changes?
Comment 14 Michal Ziabkowski 2009-05-15 22:59:05 UTC
Right, I was cherry-picking the fixes. Just tried backporting the bulk of commits to Ark since 4.2.85 and I can confirm the bug is no more :) Thanks.
Comment 15 Raphael Kubo da Costa 2009-05-22 04:22:37 UTC
*** Bug 193536 has been marked as a duplicate of this bug. ***
Comment 16 Raphael Kubo da Costa 2009-05-28 18:09:19 UTC
*** Bug 194443 has been marked as a duplicate of this bug. ***