You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Rasco

Unregistered

1

Thursday, September 30th 2004, 10:23pm

KArchive::copyTo crashes

arc = new KTar(fullpath);

if(arc)
{
if(arc->open(IO_ReadOnly))
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
const KArchiveDirectory *adir = arc->directory();

try{
adir->copyTo(fullextracteddir);
}
catch(const char *message)
{
fprintf(stderr, " \"%s\"\n", message);
}

QApplication::restoreOverrideCursor();
}
}

On broken tarballs "copyTo" crashes, and my app crashes too. Can I test archive is broken on not, or just handle this exeption ?
Thanks.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Friday, October 1st 2004, 10:50am

I think you won't get an exception even if you have compiled kdelibs with exceptions enabled (usually they are compiled without exceptions), as the code won't throw one.

If KTar crashes on a broken archive, check if bugs.kde.org already has a bug report for this, if not, create one and attach a sample archive (as small as possible) that triggers the crash.

Alternatively you could try to find and fix the bug yourself, bugfixes are highly welcomed :D

Cheers,
_
Qt/KDE Developer
Debian User

Rasco

Unregistered

3

Friday, October 1st 2004, 1:53pm

Hmm, copyTo segfaults on unsupported archives too, for example on zip6. About broken tarballs - that was my fault, now copyTo doesn't fails.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

4

Friday, October 1st 2004, 3:54pm

A segfault is still a bug, even if the cause is an unsupported archive type.

Maybe KArchive::open should already fail if it can't handle it

Cheers,
_
Qt/KDE Developer
Debian User

Rasco

Unregistered

5

Friday, October 1st 2004, 9:32pm

No :((
open() goes OK.

Rasco

Unregistered

6

Friday, October 1st 2004, 9:40pm

BTW, my system is Mandrake 9.1 with KDE 3.1.0