bugGNU patch - Bugs: bug #54845, patch segfaults if it can't write...

 
 

bug #54845: patch segfaults if it can't write *.orig

Submitter:  Jean Delvare <khali>
Submitted:  Tue 16 Oct 2018 09:46:32 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
   

Thu 27 Jun 2019 10:53:20 PM UTC, comment #3: 

I've pushed a fix for this bug:

commit b7b028a77bd855f6f56b17c8837fc1cca77b469d

Abort when cleaning up fails

When a fatal error triggers during cleanup, another attempt will be made to
clean up, which will likely lead to the same fatal error.  So instead, bail out
when that happens.
src/patch.c (cleanup): Bail out when called recursively.
(main): There is no need to call output_files() before cleanup() as cleanup()
already does that.

Andreas Gruenbacher <agruen>
Group administrator
Thu 27 Jun 2019 10:50:45 PM UTC, comment #2: 

Comment #1: The patch in file #47120 simply reverts commit 66fdcf0e, and there is no explanation why that might be desirable or acceptable, and there is no indication that the author even tried to understand what's going wrong.  This is not a useful contribution.

Andreas Gruenbacher <agruen>
Group administrator
Fri 21 Jun 2019 09:18:22 PM UTC, comment #1: 

I found and reverted the change which causes this repeated error output and segfault. Looks like the problem was caused by a small change to the cleanup function when an error is encountered. Patch to fix the crash is attached.

(file #47120)

Jesse <newguy>
Tue 16 Oct 2018 09:46:32 AM UTC, original submission:  

A regression in patch was reported in the openSUSE bugzilla:

https://bugzilla.opensuse.org/show_bug.cgi?id=1111572

The report includes a reproducer. I bisected the regression to this commit:

commit 66fdcf0e7c83a1e2eb4db97b9e24f224db656b65
Author: Andreas Gruenbacher
Date:   Tue Jul 19 22:40:40 2016 +0200

    Fix broken git-style patch behavior

The segfault only happens with git-style patches.

Jean Delvare <khali>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

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 newguy (Updated the item)
  • -email is unavailable- added by khali (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-27 agruen StatusNone Fixed
        Open/ClosedOpen Closed
    2019-06-21 newguy Attached File- Added 54845-patch-segfault-fix.txt, #47120

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code