bugAVR C Runtime Library - Bugs: bug #22567, malloc() can occasionally run into...

 
 

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

bug #22567: malloc() can occasionally run into an infinite loop

Submitter:  Joerg Wunsch <joerg_wunsch>
Submitted:  Wed 12 Mar 2008 09:54:19 AM UTC
   
 
Category:  Library Severity:  4 - Important
Priority:  5 - Normal Item Group:  None
Status:  Duplicate Assigned to:  joerg_wunsch
Percent Complete:  0% Open/Closed:  Closed
Release:  Any Fixed Release:  1.6.6

Mon 29 Jun 2009 02:33:45 AM UTC, comment #3: 

Yet another testcase,

I found out the first was because I freed a ptr twice. I think free should be robust to that but I don't know what ANSI-C specified in that case.

The first <<bugAcc()>> trigger the double free bug (infinite loop in malloc)


the second <<bugTim>> triggers the another infinite loop, quite possibly because of bug #25723. Yet, I still don't know the current cvs head includes the patch, I checked with the most recent branches (1.6-6) and haven't found significant differences with my version (v 1.5 2009/03/04)



(file #18338)

Maxime Lemonnier <maxlem>
Fri 26 Jun 2009 05:05:41 AM UTC, comment #2: 

Hi,

I'm using the cvs head.

Is the fix supposed to be applied?

In case not, here's a test case to reproduce the bug (see attachment)

I'm using a mega128, default memory layout.

The addresses won't fit, these are from my real application.

Thank you for this precious library.

I'm willing to help further.


(file #18325)

Maxime Lemonnier <maxlem>
Wed 04 Mar 2009 09:41:51 PM UTC, comment #1: 

After talking with one of the people whose reports made me
file this bug, I'm now reasonably convinced this has been the
same thing as bug #25723.

Joerg Wunsch <joerg_wunsch>
Group administrator
Wed 12 Mar 2008 09:54:19 AM UTC, original submission:  

I've seen two reports so far where malloc() eventually ran
into an infinite loop.  This is caused by the freelist
becoming cyclically linked.  So far, there's no test case
that would reliably reproduce this situation, but it should
be investigated what might cause that behaviour so it can
be fixed (and hopefully, a regression test could be written
as well for it).

Joerg Wunsch <joerg_wunsch>
Group administrator

 

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

Attached Files
file #18338:  main.cpp added by maxlem (4KiB - text/x-c++src - now with two test cases)
file #18325:  main.cpp added by maxlem (2KiB - text/x-c++src - TestCase to have malloc running in an infinite loop)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by maxlem (Updated the item)
  • -email is unavailable- added by arcanum (Updated the item)
  • -email is unavailable- added by joerg_wunsch (Submitted the item)
  •  

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-06-29 maxlem Attached File- Added main.cpp, #18338
    2009-06-26 maxlem Attached File- Added main.cpp, #18325
    2009-03-04 joerg_wunsch StatusNone Duplicate
        Assigned toNone joerg_wunsch
        Open/ClosedOpen Closed
        Fixed ReleaseNone 1.6.6
    2008-08-11 arcanum ReleaseNone Any
    2008-03-16 arcanum CategoryNone Library

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code