bugAVR Downloader/UploaDEr - Bugs: bug #42056, Current SVN version: double free...

 
 

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

bug #42056: Current SVN version: double free or corruption triggered at exit

Submitted by:  None
Submitted on:  Sat 05 Apr 2014 05:17:30 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Rene Liebscher <rliebscher>Originator Name: Rok Mandeljc
Originator Email: -unavailable-Open/Closed: Closed
Release: NoneProgrammer hardware: 
Device type: 

Mon 14 Apr 2014 09:47:13 PM UTC, comment #3:

I applied the patch for svn revision 1298.

valgrind also shows no further problems for this part (still some findings regarding libusb usage.)

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.
Sun 13 Apr 2014 03:49:44 PM UTC, comment #2:

The attached patch fixes the problem for me. It copies the usbpid list and its entries in pgm_dup().

Rainer Müller <raimue>
Sat 05 Apr 2014 05:44:58 PM UTC, comment #1:

Thanks for the analysis! I've seen the error before, but didn't
find the culprit so far.

Joerg Wunsch <joerg_wunsch>
Project Administrator
Sat 05 Apr 2014 05:17:30 PM UTC, original submission:

The current SVN version (r1295) of avrdude causes a double free or corruption at exit.

The problem seems to be introduced by the following commit: r1290: "pgm.c (pgm_free): Cleanup police: destroy the p->usbpid list when freeing the programmer struct." Reverting it fixes the issue.

However, the actual culprit is the code for duplication of programmer definitions, pgm_dup(). In line 165, information from source structure is copied to the new structure using memcpy(). pgm->id is then reinitialized, but pgm->usbpid is not, and remains a shallow copy. Therefore, when programmers are destroyed at exit, the usbpid entries in those duplicated programmer definitions end up being freed multiple times...

Anonymous

 

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rliebscher (Posted a comment)
  • -unavailable- added by raimue (Updated the item)
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by None (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
    Mon 14 Apr 2014 09:47:13 PM UTCrliebscherStatusConfirmed=>Fixed
      Assigned tojoerg_wunsch=>rliebscher
      Open/ClosedOpen=>Closed
    Sun 13 Apr 2014 03:47:06 PM UTCraimueAttached File-=>Added 0001-bug-42056-double-free-or-corruption-triggered-at-exi.patch, #31164
    Sat 05 Apr 2014 05:44:58 PM UTCjoerg_wunschStatusNone=>Confirmed
      Assigned toNone=>joerg_wunsch

    Back to the top


    Powered by Savane 3.1-cleanup1