Bug 59255 - when createing a tar archive of a directory from the command line ark crashes
Summary: when createing a tar archive of a directory from the command line ark crashes
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Helio Castro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-02 15:36 UTC by geiseri
Modified: 2003-06-03 14:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description geiseri 2003-06-02 15:36:50 UTC
Version:           v2.1.9 (using KDE 3.1.9)
Compiler:          gcc version 3.2
OS:          Linux (i686) release 2.4.20-4GB-athlon

From the command line when i type:
ark --add-to  dcopwidgets.tar.gz dcopwidgets

I get the normal dialog to select what archive i desire, but then it crashes with the below backtrace:
[New Thread 1024 (LWP 22387)]
0x412e33a9 in wait4 () from /lib/i686/libc.so.6
#0  0x412e33a9 in wait4 () from /lib/i686/libc.so.6
#1  0x4135ecf0 in __DTOR_END__ () from /lib/i686/libc.so.6
#2  0x4113b983 in waitpid () from /lib/i686/libpthread.so.0
#3  0x40792b29 in KCrash::defaultCrashHandler(int) (sig=11)
    at /home/geiseri/kdebuild/cvs/kdelibs/kdecore/kcrash.cpp:240
#4  0x41139a7a in pthread_sighandler () from /lib/i686/libpthread.so.0
#5  <signal handler called>
#6  0x412a5637 in fwrite () from /lib/i686/libc.so.6
#7  0x41800d2f in TarArch::updateProgress(KProcess*, char*, int) (
    this=0x8175778, _proc=0x81c7378, _buffer=0xbfffe930 "BZh91AY&SYY{
Comment 1 Dominik Stadler 2003-06-02 21:33:02 UTC
I'm not sure if this is the reason for the crash, but "ark --help" from KDE 
3.2.0-0+cvs20030531+orth prints: 
 
ark [Qt-Optionen] [KDE-Optionen] [Optionen] [directory] [files] [archive] 
  --add-to                  Add 'files' to 'archive'. Quit when finished. 
                            'archive' will be created if it does not exist. 
 
that means you need to specify the arguments in different order: 
 ark --add-to dcopwidgets dcopwidgets.tar.gz  
  
It should, however, not crash either way. 
Comment 2 geiseri 2003-06-02 22:01:47 UTC
Yes I confirmed when I got the arguments correct it worked.  It seems we are 
missing a sanity check for stupid users here 8) 
 
Cheers 
	-ian reinhart geiser 
Comment 3 Georg Robbers 2003-06-03 14:44:47 UTC
Subject: kdeutils/ark

CVS commit by robbers: 

don't crash when an 'archive' is in fact a directory
CCMAIL:59255-done@bugs.kde.org


  M +1 -1      tar.cpp   1.21


--- kdeutils/ark/tar.cpp  #1.20:1.21
@@ -150,5 +150,5 @@ void TarArch::updateArch()
                this, SLOT(updateFinished(KProcess *)) );
 
-      if (kp->start(KProcess::NotifyOnExit, flag) == false)
+      if ( !fd || kp->start(KProcess::NotifyOnExit, flag) == false)
         {
           KMessageBox::error(0, i18n("Trouble writing to the archive..."));