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: dlmalloc-2.6.4.c MALLOC_COPY broken?


Ø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.




See:

http://sourceware.org/ml/libc-hacker/2000-12/msg00096.html
http://sourceware.org/ml/libc-hacker/2000-12/msg00115.html
http://ecos.sourceware.org/ml/ecos-patches/2007-12/msg00031.html





--
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]