This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem with d2b called from sprintf


 
I'm using Newlib 1.8.1.
I'm having a problem with some data in low memory being overwritten when calling sprintf.  The calling sequence is as follows:
 
1. Sprintf calls d2b in mprec.c
2. d2b calls balloc also in mprec.c
3. balloc calls calloc
4. calloc fails, returns a null pointer to balloc
5. balloc returns a null pointer to d2b
4. d2b uses the null pointer as the base address of a structure located at address zero
 
Apparently sprintf requires more heap space than what is available.  My embedded system has approximately 6K bytes available for the heap.  What are the minimum requirements for available heap space for using sprintf?