bugGNU nano - Bugs: bug #47129, memory leak w/position history...

 
 

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

bug #47129: memory leak w/position history update

Submitter:  Mike Frysinger <vapier>
Submitted:  Sat 13 Feb 2016 07:40:25 AM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sat 04 Jun 2016 10:06:53 AM UTC, comment #5: 

Considering this fixed.

Benno Schulenberg <bens>
Group administrator
Mon 15 Feb 2016 07:49:19 PM UTC, comment #4: 

Okay.  Another small reason to start using gnulib.  Will look into that further when 2.5.3. is out.

But the code now uses getcwd(NULL, PATH_MAX + 1), which should work on the BSDs, Cygwin, and glibc.  So most terrains are covered.

Benno Schulenberg <bens>
Group administrator
Mon 15 Feb 2016 05:15:19 PM UTC, comment #3: 

getcwd(NULL, 0) is a GNU extension, but that feature is included in gnulib too ;)
https://www.gnu.org/software/gnulib/manual/gnulib.html#getcwd

Mike Frysinger <vapier>
Group Member
Mon 15 Feb 2016 04:29:14 PM UTC, comment #2: 

This was a little hard to reproduce.  It required deleting the directory in which nano was started.

I was going to ask: can I assume that all implementations of getcwd() allow the first parameter to be NULL?  But... in fact nano already assumes this, because when the first getcwd() fails, it will try again in a higher directory, with the passed buffer being NULL.

So... should be fixed in SVN, r5647.

Benno Schulenberg <bens>
Group administrator
Sat 13 Feb 2016 07:41:20 AM UTC, comment #1: 

probably related as i can just open this file and close it:

=================================================================
==20999==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4097 byte(s) in 1 object(s) allocated from:
    #0 0x7f254b97700a in malloc (.../libasan.so.2+0x9d00a)
    #1 0x455dde in nmalloc .../utils.c:388
    #2 0x415b7e in get_full_path .../files.c:1416
    #3 0x413d6a in open_file .../files.c:999
    #4 0x411654 in open_buffer .../files.c:471
    #5 0x43411d in main .../nano.c:2631
    #6 0x7f254ac995ef in __libc_start_main (/lib64/libc.so.6+0x205ef)

SUMMARY: AddressSanitizer: 4097 byte(s) leaked in 1 allocation(s).

Mike Frysinger <vapier>
Group Member
Sat 13 Feb 2016 07:40:25 AM UTC, original submission:  

=================================================================
==20392==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4097 byte(s) in 1 object(s) allocated from:
    #0 0x7fcb1068700a in malloc (.../libasan.so.2+0x9d00a)
    #1 0x455dde in nmalloc .../utils.c:388
    #2 0x415b7e in get_full_path .../files.c:1416
    #3 0x41d4ac in update_poshistory .../files.c:3197
    #4 0x42ca73 in finish .../nano.c:624
    #5 0x42e4ae in close_and_go .../nano.c:1169
    #6 0x42e391 in do_exit .../nano.c:1150
    #7 0x42ff69 in do_input .../nano.c:1724
    #8 0x434412 in main .../nano.c:2680
    #9 0x7fcb0f9a95ef in __libc_start_main (/lib64/libc.so.6+0x205ef)

SUMMARY: AddressSanitizer: 4097 byte(s) leaked in 1 allocation(s).

Mike Frysinger <vapier>
Group Member

 

(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 (Posted a comment)
  • -email is unavailable- added by vapier (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-20 bens Open/ClosedOpen Closed
    2016-06-04 bens StatusReady For Test Fixed
    2016-02-15 bens StatusNone Ready For Test
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code