On 11/29/2011 01:01 PM, Moritz Moeller wrote:
> On 11/29/2011 12:38 PM, Moritz Moeller wrote:
>> This works perfect the 1st time my node is evaluated. The entire loop go
>> through, all threads return, my data is perfect.
>> The 2nd time when the node must update, I always get a crash with some
>> memory corruption.
>
> Correction, it also sometimes works twice before going haywire. :)
> So this seems threading-related. Here is another typical crash:
>
> *** glibc detected *** /opt/Nuke6.3v4/Nuke6.3: munmap_chunk(): invalid
> pointer: 0x00000000037d9990 ***
> ======= Backtrace: =========
> /lib64/libc.so.6(+0x72f15)[0x7ffff395bf15]
> /opt/Nuke6.3v4/libDDImage.so(_ZN2DD5Image6Memory15deallocate_voidEPvm+0x14)[0x7ffff7824fea]
> /opt/Nuke6.3v4/libDDImage.so(_ZN2DD5Image3Row11free_bufferEPKfii+0x38)[0x7ffff787a9a4]
> /opt/Nuke6.3v4/libDDImage.so(_ZN2DD5Image3Row4freeENS0_7ChannelE+0x5f)[0x7ffff787ac21]
> /opt/Nuke6.3v4/libDDImage.so(_ZN2DD5Image3Iop3getEiiiRKNS0_10ChannelSetERNS0_3RowE+0xa2a)[0x7ffff77d2a50]
> /opt/Nuke6.3v4/libDDImage.so(_ZN2DD5Image3Iop3getEiiiRKNS0_10ChannelSetERNS0_3RowE+0x7c9)[0x7ffff77d27ef]
I got it to work by clamping all coordinates to the request()ed region
before calling get() myself.
I absolutely do not understand why I have to do this. The docs say get()
does this itself, automagically. quote from Iop::get()s documentation:
"The region is clamped to the requested() box before being
passed to the engine, and the pixels at the edges of this
area are replicated to fill the rest of the region."
This behavior is exactly what I need and very convenient as I am
filtering over the resp region.
With the code I am now forced to use, instead, I need to account for the
missing pixels myself (instead of leaving this to get() to handle).
someQueryFunc( ... ) {
Box filterArea(
int( bounds.min.x * width ),
int( bounds.min.y * height ),
int( bounds.min.x * width ) + 1,
int( bounds.min.y * height ) + 1 );
filterArea.intersect( _node->requestedBox() );
Row row( filterArea.x(), filterArea.r() );
for ( int scanLine( filterArea.y() );
scanLine < filterArea.t();
++scanLine )
{
_node->get( scanLine, filterArea.x(), filterArea.r(), rgb, row );
...
}
So I am still very interested in making the original case work (more
than once or twice b4 crashing, that is). :)
.mm
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev