[libdispatch-dev] failed assertions when DISPATCH_DEBUG enabled

Martin Nowack martin.nowack at inf.tu-dresden.de
Wed Dec 23 02:09:25 PST 2009


On Tuesday 22 December 2009 06:06:28 am Mark Heily wrote:
> When I define DISPATCH_DEBUG=1 and build the library under Linux, almost
>  all of the test programs fail. I checked a couple of them, and they both
>  fail a dispatch_assert() test at the same place: in
>  _dispatch_ccache_init().

The reason is that the current implementation of malloc_zone for linux 
(src/shims/malloc_zone.h) is just a dummy implementation and returns always a 
null-pointer. Therefore, this assertion will always fail.

The current dummy implementation just dispatches the zone_malloc calls to the 
normal malloc routine. The attached "patch" circumvents the problem with the 
assertion by allocating a zone and returning a pointer to it. The behavior of 
the zone_malloc remains the same.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: malloc_zone.patch
Type: text/x-patch
Size: 598 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/libdispatch-dev/attachments/20091223/ed8ea810/attachment.bin>


More information about the libdispatch-dev mailing list