After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711865 - g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed
g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: ftp backend
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-11 21:24 UTC by Ross Lagerwall
Modified: 2013-12-21 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ftp: Always close the data connection when an error occurs (1.23 KB, patch)
2013-11-11 21:55 UTC, Ross Lagerwall
none Details | Review
ftp: Always close data connections when done (1.42 KB, patch)
2013-12-21 02:26 UTC, Benjamin Otte (Company)
committed Details | Review

Description Ross Lagerwall 2013-11-11 21:24:20 UTC
If an error occurs when opening a file for writing (e.g. opening a directory, which generates a 553 error), the following occurs and all further requests hang:

-- 0 ->  PASV
<- 0 --  227 Entering Passive Mode (127,0,0,1,235,239)

** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed
-- 0 ->  PASV
<- 0 --  227 Entering Passive Mode (127,0,0,1,61,5)

** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed

** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed
-- 0 ->  EPSV
<- 0 --  229 Extended Passive mode OK (|||20371|)

** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed

** (process:1555): CRITICAL **: g_vfs_ftp_connection_listen_data_connection: assertion 'conn->data == NULL' failed

** (process:1555): CRITICAL **: g_vfs_ftp_connection_listen_data_connection: assertion 'conn->data == NULL' failed


To reproduce (against a Pure-FTPd server):
$ gvfs-save -a ftp://ross@localhost/Public/data
Error opening file: Invalid filename

$ gvfs-save -a ftp://ross@localhost/Public/data
# ... hang
Comment 1 Ross Lagerwall 2013-11-11 21:55:04 UTC
Created attachment 259594 [details] [review]
ftp: Always close the data connection when an error occurs

If an error occurs when receiving an ftp code, close any potentially
open data connection to prevent the open data connection confusing
further operations.

When this happens warnings of the following form appear:
** (process:1555): CRITICAL **: g_vfs_ftp_connection_open_data_connection: assertion 'conn->data == NULL' failed

It can be reproduced against a Pure-FTPd server by running the following
command twice:
gvfs-save -a ftp://host/some/dir
Comment 2 Benjamin Otte (Company) 2013-12-21 02:26:55 UTC
Created attachment 264660 [details] [review]
ftp: Always close data connections when done

Opening data connections is a complex process and can fail in multiple
stages. Instead of requiring the code to close them manually and
throwing assertions when that doesn't work we just clean up after all
jobs automatically.
Comment 3 Ross Lagerwall 2013-12-21 05:25:46 UTC
Review of attachment 264660 [details] [review]:

LGTM. Thanks!
Comment 4 Benjamin Otte (Company) 2013-12-21 12:34:23 UTC
Comment on attachment 264660 [details] [review]
ftp: Always close data connections when done

Attachment 264660 [details] pushed as 28cf48f - ftp: Always close data connections when done