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

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

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>
Group administrator
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>
Group administrator
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>
Group administrator

 

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

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)
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-30 bens Open/ClosedOpen Closed
    2021-03-05 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code