bugGNU Octave - Bugs: bug #42429, @ftp/dir crashes Octave

 
 

bug #42429: @ftp/dir crashes Octave

Submitter:  Allan Jacobs <allanjacobs>
Submitted:  Mon 26 May 2014 03:54:56 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  3 - Low Item Group:  Segfault, Bus Error, etc.
Status:  Confirmed Assigned to:  None
Originator Name:  allanjacobs Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 26 Jan 2023 01:17:15 AM UTC, comment #5: 

This bug is still alive.  I recently filed bug #63706 which is a duplicate of this one.  This test code produces a segfault in Octave.


f = ftp ('ftp.gnu.org');
cd (f, "nodir");   # directory does not exist
cd (f, "/")


Rik <rik5>
Group administrator
Tue 05 Feb 2019 06:56:46 PM UTC, comment #4: 

Confirmed that this still exists (2/5/19).

Running the code under Matlab,


f=ftp('ftp.gnu.org','anonymous','testpw@test.com')
cd(f,'/gnu/Licenses')
dir(f)
cd(f,'Licenses')
dir(f)


I get an error when trying to cd in to the non-existent directory 'Licenses', and dir(f) does not produce a segfault.

That said, there are tons of ftp programs available and it is probably better to use one of them, rather than Octave, for any serious work.

Rik <rik5>
Group administrator
Mon 08 Aug 2016 06:04:51 PM UTC, comment #3: 

Downgrading severity to 3, this bug will not gate the 4.2 release.

Rik <rik5>
Group administrator
Tue 29 Mar 2016 04:47:04 PM UTC, comment #2: 

I hit this again recently and traced it a bit. The most obvious problem seems to be that the curl_transfer class does not have any way to recover from errors. When a libcurl error occurs, it simply returns and leaves the class in an inconsistent state. Changing to a nonexistent directory should probably throw an error and restore the state of the connection to the last valid directory. No patch yet, but I'll assign this to me with the intention of working on it soon-ish (but feel free to take it from me if someone wants to work on it).

Mike Miller <mtmiller>
Group Member
Thu 29 May 2014 04:17:53 PM UTC, comment #1: 

Confirmed.  I traced this back through gdb and the segfault is happening in curl library code.  It's possible that Octave is not using the library correctly, but it appears to be the case that the library itself is fragile.

Rik <rik5>
Group administrator
Mon 26 May 2014 03:54:56 PM UTC, original submission:  

@ftp/dir applied to a directory that does not exist crashes Octave.


f=ftp('ftp.gnu.org','anonymous','testpw@test.com')
cd(f,'/gnu/Licenses')
dir(f)
cd(f,'Licenses')
dir(f)


$ hg summary
parent: 18782:5556ddfb841b tip
 spdiags.m: Treat sub/super-diagonals the same as Matlab.
branch: default
bookmarks: *@
commit: 7477 unknown (clean)
update: (current)


Allan Jacobs <allanjacobs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by allanjacobs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-26 rik5 Dependencies- bugs #63706 is dependent
    2019-09-03 mtmiller Dependencies- bugs #56842 is dependent
    2019-02-18 mtmiller Assigned tomtmiller None
    2019-02-05 mtmiller Carbon-CopyRemoved 80942 -
    2018-04-27 mtmiller Priority5 - Normal 3 - Low
        Release3.8.1 dev
    2016-08-08 rik5 Severity4 - Important 3 - Normal
    2016-07-01 rik5 Severity3 - Normal 4 - Important
    2016-03-29 mtmiller Assigned toNone mtmiller
    2014-05-29 rik5 StatusNone Confirmed
        Releasedev 3.8.1

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code