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

 
 

bug #40049: Segmentation fault during cleanup

Submitted by:  Martin von Gagern <gagern>
Submitted on:  Tue 17 Sep 2013 09:56:41 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by agruen (Posted a comment)
  • -unavailable- added by gagern (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 24 Sep 2013 10:03:01 PM UTCagruenStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1