This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: zcalloc: failed to allocate bytes error - RedBoot


On Thu, Dec 01, 2005 at 03:25:17PM +1000, Benny Chen wrote:
> Hi there,
> My RedBoot application when trying to write 64 bytes to a file (via
> write() call) in the jffs2 partition result in the following message
> being printed out.
> 
> zcalloc: failed to allocate 0x8000 items of 0x2 bytes == 0x10010 bytes
> zcalloc: failed to allocate 0x8000 items of 0x2 bytes == 0x10010 bytes
> zcalloc: failed to allocate 0x8000 items of 0x2 bytes == 0x10010 bytes
> zcalloc: failed to allocate 0x4000 items of 0x4 bytes == 0x10010 bytes
> <4>deflateInit failed
> 
> The actual file was created in the jffs2 partition but I am not sure why
> this message is appearing.

The file will of been created becasue it will have given up trying to
compress the file and written an uncompressed version.

RedBoot does not use the usual malloc infrastructure. Instead it
allocates a chunk of memory for zlib to use. You can find this code in
/packages/redboot/current/src/decompress.c. The size of this memory is
controlled by

#ifdef CYGOPT_REDBOOT_FIS_ZLIB_COMMON_BUFFER
# define ZLIB_COMPRESSION_OVERHEAD CYGNUM_REDBOOT_FIS_ZLIB_COMMON_BUFFER_SIZE
#else
# define ZLIB_COMPRESSION_OVERHEAD 0xC000
#endif

So you need to look at your configuration and either change the 0xc000
or CYGNUM_REDBOOT_FIS_ZLIB_COMMON_BUFFER_SIZE.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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