[ECOS] Re: dlmalloc-2.6.4.c MALLOC_COPY broken?
Thu Jan 3 09:11:00 GMT 2008
Ãyvind Harboe wrote:
> Where does dlmalloc come from?
> eCos seems to be lacking some upstream bugfixes...
> memcpy does not support overlapping memory ranges, which causes problems with
> optimized versions of memcpy.
Correct, according to ANSI the behavior of memcpy is undefined if the
source and destination overlap, and I have definitely used an optimized
memcpy that fails in this situation.
> I haven't analyzed it enough to tell whether eCos is bitten by this.
Try putting some asserts in memcpy to trap any occurances of this... you
will find the realloc breaks the rules. It should use memmove instead.
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss