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

 
 

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

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

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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>
Project AdministratorIn charge of this item.
Thu 03 Dec 2015 09:14:11 AM UTC, comment #3:

The crash prevention went into SVN, r5473.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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:

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>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by bens (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 Jul 2016 03:04:40 PM UTCbensStatusReady For Test=>Fixed
    Thu 14 Jan 2016 04:46:43 PM UTCbensOpen/ClosedOpen=>Closed
    Thu 03 Dec 2015 09:14:11 AM UTCbensStatusIn Progress=>Ready For Test
    Wed 02 Dec 2015 04:24:02 PM UTCbensAttached File-=>Added avoid-crash.patch, #35618
      StatusNone=>In Progress
    Wed 02 Dec 2015 03:45:25 PM UTCbensAssigned toNone=>bens

    Back to the top


    Powered by Savane 3.1-cleanup1