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

 
 

bug #47129: memory leak w/position history update

Submitted by:  Mike Frysinger <vapier>
Submitted on:  Sat 13 Feb 2016 07:40:25 AM UTC  
 
Severity: 3 - NormalStatus: 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.

 

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

Considering this fixed.

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

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by vapier (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 20 Jun 2016 09:37:12 AM UTCbensOpen/ClosedOpen=>Closed
    Sat 04 Jun 2016 10:06:53 AM UTCbensStatusReady For Test=>Fixed
    Mon 15 Feb 2016 04:29:14 PM UTCbensStatusNone=>Ready For Test
      Assigned toNone=>bens

    Back to the top


    Powered by Savane 3.1-cleanup1