Menu

#27 curlftpfs segfaults when trying to modify files

closed-wont-fix
None
5
2014-08-28
2007-08-01
Anonymous
No

The curlftpfs version 0.9.1-1+b1 (debian lenny/testing) successfully connects to the FTP server, lists the files correctly, but terminates with a segfault when trying to modify (e.g. delete) a file:

server:/mnt/ftpbackup# rm TMP.outpost.new
rm: remove regular empty file `TMP.outpost.new'? y
rm: cannot remove `TMP.outpost.new': Software caused connection abort

When running in verbose debug mode, the following output can be observed:

unique: 25, opcode: GETATTR (3), nodeid: 1, insize: 40
unique: 25, error: 0 (Success), outsize: 112
unique: 26, opcode: LOOKUP (1), nodeid: 1, insize: 56
LOOKUP /TMP.outpost.new
NODEID: 3
unique: 26, error: 0 (Success), outsize: 136
unique: 27, opcode: ACCESS (34), nodeid: 1, insize: 48
ACCESS / 01
unique: 27, error: -38 (Function not implemented), outsize: 16
unique: 28, opcode: LOOKUP (1), nodeid: 1, insize: 56
LOOKUP /TMP.outpost.new
NODEID: 3
unique: 28, error: 0 (Success), outsize: 136
unique: 29, opcode: UNLINK (10), nodeid: 1, insize: 56
UNLINK /TMP.outpost.new
* Couldn't find host server in the .netrc file, using defaults
* Re-using existing connection! (#0) with host server
* Connected to server (192.168.0.1) port 21 (#0)
> CWD /
< 250 Directory successfully changed.
> SIZE (nil)
< 550 Could not get file size.
> REST 0
< 350 Restart position accepted (0).
./mount_ftpbackup.sh: line 2: 2825 Segmentation fault curlftpfs -d -v -o ftp_port=- ftp://user:password@server /mnt/ftpbackup

---------------------------------------------
As you can see, we have already tried to avoid passive mode with no success - it has no effect on the issue.

Eagerly awaiting your response,
Sincerely
Daniel

Discussion

  • Robson Braga Araujo

    Logged In: YES
    user_id=307089
    Originator: NO

    This seems to be an issue related to this debian package, since I've been getting lots of reports of failure from debian users and none from other users. Can you recompile from souces and see if it works?

     
  • Robson Braga Araujo

    • assigned_to: nobody --> braga
     
  • Robson Braga Araujo

    Logged In: YES
    user_id=307089
    Originator: NO

    I found it to be a bug with curl 7.16.3 and 7.16.4. You can workaround it by using 7.16.2 or by setting ftpfs.safe_nobody = 0 in ftpfs.c if you're compiling curlftpfs.

     
  • Nobody/Anonymous

    Logged In: NO

    Hi braga,

    thanks for your answer. We will try to recompile and try again. Might take a few days though.
    Thanks again,
    Daniel

     
  • Nobody/Anonymous

    Logged In: NO

    Hi braga,

    we recompiled the debian package source with your given code change and the resulting package works perfectly within its limitations. The bug is fixed/workarounded with that.

    For other readers, a brief summary of steps:
    - Obtain the debian source for curlftpfs
    - Change the given line in the source code
    - Build the (binary) debian package using dpkg-buildpackage
    - Install the new package
    Some help is available in the Debian FAQ for this: http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html
    Paragraphs 6.13 and 6.14

    Thank you for the help!
    Daniel

     
  • Robson Braga Araujo

    Logged In: YES
    user_id=307089
    Originator: NO

    Thanks a lot for all the testing, Daniel.

    Another option is to downgrade libcurl to version 7.16.2. This is a bug with the newest versions (7.16.3 and 7.16.4). I'll send them a patch so that it will be fixed for their next release.

     
  • Robson Braga Araujo

    • status: open --> closed-wont-fix
     

Log in to post a comment.