-
-
Notifications
You must be signed in to change notification settings - Fork 7k
avr-libc 1.6.4 dynamic memory (malloc, free) bug [imported] #857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am getting users of my libraries reporting multiple definition compile problems due to this addition of the memory allocation functions in the Arduino core conflicting with the same functions in avrclib. Sorry for double post on comit history, should have checked here first. |
What the user reported: c:/users/lbaynum/downloads/arduino-1.5.2-windows/arduino-1.5.2/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr5\libc.a(malloc.o): In function |
Nevermind, seems the problem is in the current version of SDFATLib. http://code.google.com/p/beta-lib/issues/detail?id=9 |
This is Issue 857 moved from a Google Code project.
Added by 2012-03-12T01:31:54.000Z by jbrazio.
Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Defect, Priority-High, Milestone-1.0.2, Component-Core, Component-Build
Original description
Arduino 1.0 uses WinAVR-20081205 that comes with avr-libc 1.6.4.
There is a documented bug on avr-libc (#27235, #28135) related with malloc() and free() that affects the current avr-libc version used by arduino; WinAVR-20100110's avr-libc 1.6.7 is still affected. Proven not to be affected is Atmel's native libc from AVR Studio 5.1.208 and wiring's avr-libc 1.7.1.
The solution would be to update arduino's avr-libc from 1.6.4 to the latest 1.7 branch.
Attached is a program to prove the bug existence, when run it outputs used/free/large after each allocation call, then repeats the test when doing de-allocation. The expected behavior is at the end of the program the amount of used/free/large to be the same as at the start.. which is not the case using arduino's avr-libc 1.6.4. The original code comes from Andy Brown (http://j.mp/yGnTwT) I have just ported it to compile under Arduino's IDE.
Links:
Forum topic which lead to this bug report:
Note: Nick Gammon mentioned that since Strings uses malloc() and free() this could be the explanation for some people complaining about random program crash when using the library.
The text was updated successfully, but these errors were encountered: