bugGNU patch - Bugs: bug #40049, Segmentation fault during cleanup

 
 

bug #40049: Segmentation fault during cleanup

Submitter:  Martin von Gagern <gagern>
Submitted:  Tue 17 Sep 2013 09:56:41 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 24 Sep 2013 10:03:01 PM UTC, comment #1: 

Thanks, this bug has been fixed in commit "Initialize data structures early enough" already.

Andreas Gruenbacher <agruen>
Group administrator
Tue 17 Sep 2013 09:56:41 AM UTC, original submission:  

GNU patch 2.7.1 will crash if the -d command line switch requests a change to a non-existing directory.

$ patch -d no-such-dir
patch: ** Can't change to directory no-such-dir : No such file or directory
Segmentation fault

With gdb, the backtrace looks like this:

Program received signal SIGSEGV, Segmentation fault.
gl_list_iterator_inline (list=0x0) at ../lib/gl_list.h:762
762              ->iterator (list);
(gdb) bt
#0  gl_list_iterator_inline (list=0x0) at ../lib/gl_list.h:762
#1  forget_output_files () at patch.c:1935
#2  cleanup () at patch.c:1978
#3  0x0000000000407128 in fatal_exit (sig=sig@entry=0) at patch.c:1953
#4  0x000000000040d358 in pfatal (
    format=format@entry=0x419319 "Can't change to directory %s") at util.c:952
#5  0x0000000000403016 in get_some_switches () at patch.c:875
#6  main (argc=<optimized out>, argv=<optimized out>) at patch.c:156

Seems like forget_output_files should check whether or not files_to_output has been initialized. Not sure whether comparing it to NULL is appropriate or not.

Martin von Gagern <gagern>

 

(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

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by agruen (Posted a comment)
  • -email is unavailable- added by gagern (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 logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-24 agruen StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code