bugGNU nano - Bugs: bug #60104, sometimes some memory leaks when...

 
 

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

bug #60104: sometimes some memory leaks when unindenting

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 23 Feb 2021 11:02:18 AM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Open

Fri 05 Mar 2021 05:53:26 PM UTC, comment #2: 

Fixed in git, commit f6357a73, by fixing an off-by-one error: the number of lines is the difference in line numbers plus one.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 23 Feb 2021 11:20:15 AM UTC, comment #1: 

Reproduction recipe:

src/nano --ignore +11 README

Then type: <Shift+Tab> M-U <Shift+Tab> ^X ^Q
Result:

==7350== 5 bytes in 1 blocks are definitely lost in loss record 14 of 424
==7350==    at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7350==    by 0x12ED1D: nmalloc (utils.c:295)
==7350==    by 0x12EE64: measured_copy (utils.c:337)
==7350==    by 0x12A2E2: update_multiline_undo (text.c:1132)
==7350==    by 0x12A592: do_unindent (text.c:270)
==7350==    by 0x12101B: process_a_keystroke (nano.c:1633)
==7350==    by 0x10E23B: main (nano.c:2557)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 23 Feb 2021 11:02:18 AM UTC, original submission:  

I cannot figure out a reproduction recipe yet, but I've hit this now three times (twice while using the LeakSanitizer, and once with Valgrind):

==7111== 15 bytes in 2 blocks are definitely lost in loss record 23 of 431
==7111==    at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7111==    by 0x12ED1D: nmalloc (utils.c:295)
==7111==    by 0x12EE64: measured_copy (utils.c:337)
==7111==    by 0x12A2E2: update_multiline_undo (text.c:1132)
==7111==    by 0x12A592: do_unindent (text.c:270)
==7111==    by 0x12101B: process_a_keystroke (nano.c:1633)
==7111==    by 0x10E23B: main (nano.c:2557)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

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 bens (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-05 bens StatusNone => Fixed

    Back to the top


    Powered by Savane 3.6