bugGNU nano - Bugs: bug #45531, out-of-memory when undoing an add...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #45531: out-of-memory when undoing an add after a ^J

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 12 Jul 2015 06:44:03 PM UTC
   
 
Severity:  4 - Important Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 14 Jan 2016 04:46:43 PM UTC, comment #4: 

A request for the general undo system to also cover the justification mechanism has been posted as bug #46900.

Benno Schulenberg <bens>
Group administrator
Thu 03 Dec 2015 09:14:11 AM UTC, comment #3: 

The crash prevention went into SVN, r5473.

Benno Schulenberg <bens>
Group administrator
Wed 02 Dec 2015 04:24:02 PM UTC, comment #2: 

Attached patch avoids the crash by sacrificing the undo stack.

(file #35618)

Benno Schulenberg <bens>
Group administrator
Wed 02 Dec 2015 03:45:25 PM UTC, comment #1: 

Okay, the given recipe does not cause any failure any more.  But obviously things will go wrong when justification has changed the layout of the file so that it no longer corresponds to what is stored in the undo items.

A new reproduction recipe is this:

head NEWS | sed 's/\t\t//' >scrap
src/nano --fill=111  +7  scrap

Then type: wah! followed by ^J and M-U.
The result:

  nano is out of memory!
  Buffer written to scrap.save

Benno Schulenberg <bens>
Group administrator
Sun 12 Jul 2015 06:44:03 PM UTC, original submission:  

When undoing a text add after having justified the very same paragraph, nano crashes, complaining it is out of memory.

To reproduce, start 'nano anna' (where anna is nonexistent file) and type these two lines into it, exactly:


Wordsoup.
--  Anna


Save the file and exit.  Then reopen the file, and place the cursor before the double dash, and type "WWW" (without the quotes), then ^J and M-U.  Depending on the compilation, nano will then either report:

[ Internal error: can't match line 2.  Please save your work. ]

or it will crash, saying:

nano is out of memory!
Buffer written to anna.save

Benno Schulenberg <bens>
Group administrator

 

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

Attached Files
file #35618:  avoid-crash.patch added by bens (2KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-22 bens StatusReady For Test Fixed
    2016-01-14 bens Open/ClosedOpen Closed
    2015-12-03 bens StatusIn Progress Ready For Test
    2015-12-02 bens Attached File- Added avoid-crash.patch, #35618
        StatusNone In Progress
    2015-12-02 bens Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code