One of my wiretap-based programs always gives malloc errors creating a clip node on Mac OS X (Intel). To be specific:
tether(6126,0xa00a7fa0) malloc: *** error for object 0x1237010c: pointer being reallocated was not allocated
*** set a breakpoint in malloc_error_break to debug
tether(6126,0xa00a7fa0) malloc: *** error for object 0xa5a0c: pointer being reallocated was not allocated
*** set a breakpoint in malloc_error_break to debug
<several more just like that>
tether(6126,0xa00a7fa0) malloc: *** error for object 0xa5a0c: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
If I link against the debug version of wiretap and set a breakpoint as suggested, I find the following stack trace:
#0 0x90677131 in malloc_error_break ()
#1 0x9067211f in szone_error ()
#2 0x9059acbd in szone_realloc ()
#3 0x9059ac0e in malloc_zone_realloc ()
#4 0x9059ab81 in realloc ()
#5 0x000706c3 in WireTapStr::reallocBuff (this=0xbfffd0e4, len=56) at WireTapTypes.C:529
#6 0x00070737 in WireTapStr::operator= (this=0xbfffd0e4, str=0x255ac0 "/stonefs/Test/Default/H_-1463806974_S_1219584576_U_8268") at WireTapTypes.C:378
#7 0x000707eb in WireTapNodeId::operator= (this=0xbfffd0e0, src=@0xbfffd018) at WireTapTypes.C:446
#8 0x0006a494 in WireTapNodeClientAPI::createNode (this=0x255a10, node=@0x255ca0, displayName=0x23ed0c "V12_test3shortened", type=WireTapNodeInterface::TYPE_CLIP, extendedType=0xbfffd160 "6", format=@0x23f72c, newChild=@0xbfffd0e0) at WireTapNodeClientAPI.C:126
#9 0x00060937 in WireTapServerImp::createNode (this=0x255810, node=@0x255ca0, displayName=0x23ed0c "V12_test3shortened", type=WireTapNodeInterface::TYPE_CLIP, extendedType=0xbfffd160 "6", format=@0x23f72c, newChild=@0xbfffd0e0) at WireTapClientAPI.C:270
#10 0x121e1588 in WireTapNodeHandle::createClipNode (this=0x255c20, displayName=0x23ed0c "V12_test3shortened", format=@0x23f72c, extendedType=0xbfffd160 "6", newNode=@0x255740) at WireTapClientAPI.C:1132
#11 0x121e17dc in WireTapNodeHandle::createClipNode (this=0x255c20, displayName=0x23ed0c "V12_test3shortened", format=@0x23f72c, extendedType=6, newNode=@0x255740) at WireTapClientAPI.C:1123
"format", by the way, is as follows:
clip format: w=1280, h=800, bpp=32, nc=3, bs=0, fr=24, tag=rgb, ar=1, mdt=none, md=
Ultimately, whatever is happening here leads to a failure. Although createClipNode returns success, if I subsequently get the format of the new clip node (which is also successful, but shows a bunch more malloc errors) I end up with all zeroes. (Eventually I get an error when I try to set the number of frames: "Only RGB formats are supported".)
Any idea what might be going on? (This is with WT 2009.1 on Mac OS 10.5.4 Intel.)