Bug 310410 - kio_ftp crashes with assert, "entry.count() == 0" in ftp.cpp line 1298
Summary: kio_ftp crashes with assert, "entry.count() == 0" in ftp.cpp line 1298
Status: RESOLVED DUPLICATE of bug 310039
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: ftp (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-20 15:34 UTC by Jonathan Marten
Modified: 2012-11-20 16:43 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 Jonathan Marten 2012-11-20 15:34:35 UTC
Trying to access any FTP site, whether anonymous or with username/password, crashes with the above assert.

Partial log output for 'konqueror ftp://ftp.kde.org':

kdeinit4: Got EXEC_NEW 'kio_ftp' from launcher.
kdeinit4: preparing to launch /usr/home/ws/trunk/inst-16may2012/lib/kde4/kio_ftp.so
klauncher(6328)/kio (KLauncher) KLauncher::processRequestReturn: "kio_ftp" (pid 12815) up and running.
kio_ftp(12815) kdemain: Starting  12815
kio_ftp(12815) Ftp::setHost: "ftp.kde.org" port= 0 user= ""
kio_ftp(12815) Ftp::setHost: proxy urls: ()
kio_ftp(12815) Ftp::listDir: KUrl("ftp://ftp.kde.org")
kio_ftp(12815) Ftp::ftpOpenConnection: host= "ftp.kde.org" , port= 0 , user= "" 
password= [password hidden]
kio_ftp(12815) Ftp::ftpResponse:     >  220 Welcome to kde.org ftp.
kio_ftp(12815) Ftp::ftpResponse: resp>  220 Welcome to kde.org ftp.
kded(6330)/KPasswdServer KPasswdServer::checkAuthInfoAsync: User = "" , WindowId = 92274708
kio_ftp(12815) Ftp::ftpLogin: Sending Login name:  "USER anonymous"
kio_ftp(12815) Ftp::ftpSendCmd: send>  USER anonymous
kio_ftp(12815) Ftp::ftpResponse:     >  331 Please specify the password.
kio_ftp(12815) Ftp::ftpResponse: resp>  331 Please specify the password.
kio_ftp(12815) Ftp::ftpLogin: Sending Login password:  [protected]
kio_ftp(12815) Ftp::ftpSendCmd: send> pass [protected]
kio_ftp(12815) Ftp::ftpResponse:     >  230 Login successful.
kio_ftp(12815) Ftp::ftpResponse: resp>  230 Login successful.
kio_ftp(12815) Ftp::ftpLogin: Login OK
kio_ftp(12815) Ftp::ftpSendCmd: send>  SYST
kio_ftp(12815) Ftp::ftpResponse:     >  215 UNIX Type: L8
kio_ftp(12815) Ftp::ftpResponse: resp>  215 UNIX Type: L8
kio_ftp(12815) Ftp::ftpLogin: Searching for pwd
kio_ftp(12815) Ftp::ftpSendCmd: send>  PWD
kio_ftp(12815) Ftp::ftpResponse:     >  257 "/"
kio_ftp(12815) Ftp::ftpResponse: resp>  257 "/"
kio_ftp(12815) KRemoteEncoding::setEncoding: setting encoding "UTF-8" for name=
kio_ftp(12815) Ftp::ftpLogin: Initial path set to:  "/"
kio_ftp(12815) Ftp::listDir: REDIRECTION to  "ftp://ftp.kde.org/"
kded(6330) Mollet::KioSlaveNotifier::onDirectoryLeft: "ftp://ftp.kde.org"
kded(6330) Mollet::KioSlaveNotifier::onDirectoryEntered: "ftp://ftp.kde.org/"
kio_ftp(12815) Ftp::listDir: KUrl("ftp://ftp.kde.org/")
kio_ftp(12815) Ftp::listDir: hunting for path "/"
kio_ftp(12815) Ftp::ftpDataMode: want I has 
kio_ftp(12815) Ftp::ftpSendCmd: send>  TYPE I
kio_ftp(12815) Ftp::ftpResponse:     >  200 Switching to Binary mode.
kio_ftp(12815) Ftp::ftpResponse: resp>  200 Switching to Binary mode.
kio_ftp(12815) Ftp::ftpSendCmd: send>  PASV
kio_ftp(12815) Ftp::ftpResponse:     >  227 Entering Passive Mode (138,246,255,180,148,143).
kio_ftp(12815) Ftp::ftpResponse: resp>  227 Entering Passive Mode (138,246,255,180,148,143).
kio_ftp(12815) Ftp::ftpSendCmd: send>  list -la
kio_ftp(12815) Ftp::ftpResponse:     >  150 Here comes the directory listing.
kio_ftp(12815) Ftp::ftpResponse: resp>  150 Here comes the directory listing.
kio_ftp(12815) Ftp::ftpOpenCommand: connected with remote.
kio_ftp(12815) Ftp::ftpOpenDir: Starting of list was ok
kio_ftp(12815) Ftp::ftpReadDir: dir >  drwxr-xr-x    3 0        0              72 Jul 01  2010 .
kio_ftp(12815) Ftp::ftpReadDir: dir >  drwxr-xr-x    3 0        0              72 Jul 01  2010 ..
ASSERT: "entry.count() == 0" in file /ws/trunk/kdelibs/kioslave/ftp/ftp.cpp, line 1298
kioslave: ####### CRASH ###### protocol = ftp pid = 12815 signal = 6

Backtrace when this happens:

#0  0xb5c98e40 in abort () from /lib/libc.so.6
#1  0xb6bf0ffa in qt_message_output (msgType=<optimized out>, buf=0x8f85ea8 "ASSERT: \"entry.count() == 0\" in file /ws/trunk/kdelibs/kioslave/ftp/ftp.cpp, line 1298") at global/qglobal.cpp:2266
#2  0xb6bf1197 in qt_message (msgType=QtFatalMsg, msg=0xb6d99a60 "ASSERT: \"%s\" in file %s, line %d", ap=0xbfcbbfc4 "\324\257\031\264\304\242\031\264\022\005") at global/qglobal.cpp:2312
#3  0xb6bf12b9 in qFatal (msg=0xb6d99a60 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2495
#4  0xb6bf1355 in qt_assert (assertion=0xb419afd4 "entry.count() == 0", file=0xb419a2c4 "/ws/trunk/kdelibs/kioslave/ftp/ftp.cpp", line=0x512) at global/qglobal.cpp:2013
#5  0xb4195a70 in Ftp::ftpCreateUDSEntry (this=0xbfcbc328, filename=..., ftpEnt=..., entry=..., isDir=0x0) at /ws/trunk/kdelibs/kioslave/ftp/ftp.cpp:1298
#6  0xb419627a in Ftp::listDir (this=0xbfcbc328, url=...) at /ws/trunk/kdelibs/kioslave/ftp/ftp.cpp:1580
#7  0xb4076c68 in KIO::SlaveBase::dispatch (this=0xbfcbc330, command=0x47, data=...) at /ws/trunk/kdelibs/kio/kio/slavebase.cpp:1092
#8  0xb407440e in KIO::SlaveBase::dispatchLoop (this=0xbfcbc330) at /ws/trunk/kdelibs/kio/kio/slavebase.cpp:295
#9  0xb4192d64 in kdemain (argc=0x4, argv=0x8f11158) at /ws/trunk/kdelibs/kioslave/ftp/ftp.cpp:186
#10 0x0804f1b6 in launch (argc=0x4, _name=0x8f112f4 "kio_ftp", args=<optimized out>, cwd=0x0, envc=0x0, envs=<optimized out>, reset_env=0x0, tty=0x0, avoid_loops=0x0, startup_id_str=0x8053c45 "0") at /ws/trunk/kdelibs/kinit/kinit.cpp:726
#11 0x0804faa5 in handle_launcher_request (sock=<optimized out>, who=0x0) at /ws/trunk/kdelibs/kinit/kinit.cpp:1218
#12 0x08050117 in handle_requests (waitForPid=0x0) at /ws/trunk/kdelibs/kinit/kinit.cpp:1411
#13 0x08050e53 in main (argc=0x0, argv=0x0, envp=0x0) at /ws/trunk/kdelibs/kinit/kinit.cpp:1899



Reproducible: Always

Steps to Reproduce:
Attempt to view ftp.kde.org, or any other FTP site, in Konqueror.

Actual Results:  
Crash as above


Expected Results:  
No crash, directory listing should be displayed


This seems to be a consequence of commit 014e8f3c to kdelibs/kioslave/ftp/ftp.cpp.  Reverting this commit fixes the problem.

Restoring the deleted 'entry.clear()' at line 1559 alone also fixes the problem, at least for the test cases that I have tried.
Comment 1 Jekyll Wu 2012-11-20 16:43:48 UTC

*** This bug has been marked as a duplicate of bug 310039 ***