I am evaluating parts of the node tree connected to my node myself. This
is from within engine(). During this I have a few threads spwaned from
engine() that fire a request()s using someSetupFunc(), each, on the same
Iop upstream and then each thread fires bunch of get() calls on it using
someQueryFunc().


  someSetupFunc( ... ) {

    _node->validate( true );

    unsigned width(  _node->info().format().width()  );
    unsigned height( _node->info().format().height() );

    _node->request(
        int( _bounds.min.x * width  ),
        int( _bounds.min.y * height ),
        int( _bounds.max.x * width  ) + 1,
        int( _bounds.max.y * height ) + 1,
        _channels, 0 );
  }

  someQueryFunc( ... ) {

    // the box x0, x1 - x1, y1 is always contained in the above
    // bounds
    ...
    ChannelSet rgb( Mask_RGB );

    Row row( x0, x1 );
    for ( unsigned scanLine( y0 ); scanLine < y1; ++scanLine ) {

        _node->get( scanLine, x0, x1, rgb, row );

        ...
    }
    ...
  }


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.

This always happens in this line:

  _node->get( scanLine, x0, x1, _channelMask, row );


Any ideas? Should I rather call engine(), instead of get(), on that
upstream Iop?

Below is the gdb output.

.mm

--

*** glibc detected *** /opt/Nuke6.3v4/Nuke6.3: double free or corruption
(!prev): 0x00007fffd461ea90 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x72f15)[0x7ffff395bf15]
/lib64/libc.so.6(cfree+0x6c)[0x7ffff3960d8c]
/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]
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to