There are numerous Op-level calls that are guaranteed to be in the main thread, 
including ‘open’, ‘validate’, and ‘Knob’.  The ‘engine’ call is pretty much 
guaranteed to not be on the main thread. You crashed in new_undo.  I’m 
wondering if you passed a valid pointer for the knob.  Are you perhaps passing 
a value instead of a pointer?  This is difficult without knowing what you are 
doing, exactly.

As far as docs, the only stuff that’s available is what you get with your 
distro.

Steve


From: [email protected] 
[mailto:[email protected]] On Behalf Of Chishing Yip
Sent: Wednesday, March 21, 2012 8:31 AM
To: Nuke plug-in development discussion
Subject: Re: [Nuke-dev] Nuke crashes randomly

Hi Steve,

I changed the knob value manually -- not from the API level but just simply 
mouse + keyboard.

About thread-safe, is there any API that guaranteed to happen only in the main 
thread? Any docs I could read?

So far I learned is, knob(<whatever_name>) method is not available within 
replace_knobs() callback.

Thanks a lot for your reply,
Shing
On Wed, Mar 21, 2012 at 10:40 PM, Steven Booth 
<[email protected]<mailto:[email protected]>> wrote:
How are you changing the value of one of the knobs?  Are you using knob(<nob 
name>)->setValue, or are you simply updating the knob’s referenced value 
location?  Be aware, that you can only modify UI elements from the primary 
thread.  If you wish to change a knob value from a dependent thread, you should 
issue an event to the primary thread to do such.

Steve


From: 
[email protected]<mailto:[email protected]>
 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Chishing Yip
Sent: Wednesday, March 21, 2012 2:09 AM
To: Nuke plug-in development discussion
Subject: [Nuke-dev] Nuke crashes randomly

Hi all,

I have a plugin which create knobs dynamically, Nuke sometime crashes when I 
change a value of one of the dynamic knobs( see backtrace_1 ); sometime the 
crash happens when I click on my plugin's panel ( see backtrace_2 ). This looks 
like a threading problem, because this does not happen always, is there any 
thing I should be aware of? e.g. avoid calling certain Nuke APIs to keep thread 
safe?

Best regards,
Shing

--------------   backtrace_1 -------------------
(gdb) bt
#0  0x0000000000eb1960 in ?? ()
#1  0x0000000000eb1127 in ?? ()
#2  0x0000000000eb308d in ?? ()
#3  0x00007ffff78133fe in DD::Image::Knob::new_undo(void const*) () from 
/usr/local/Nuke6.3v6/libDDImage.so
#4  0x0000000000aa5182 in ?? ()
#5  0x00007ffff63eac8a in QMetaObject::activate(QObject*, QMetaObject const*, 
int, void**) () from /usr/local/Nuke6.3v6/libQtCore.so.4
#6  0x00007ffff6cb9831 in QComboBox::activated(int) () from 
/usr/local/Nuke6.3v6/libQtGui.so.4
#7  0x00007ffff6cbb576 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#8  0x00007ffff6cbdff8 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#9  0x00007ffff6cc3c16 in QComboBox::qt_metacall(QMetaObject::Call, int, 
void**) () from /usr/local/Nuke6.3v6/libQtGui.so.4
#10 0x0000000000aa50ed in ?? ()
#11 0x00007ffff63eac8a in QMetaObject::activate(QObject*, QMetaObject const*, 
int, void**) () from /usr/local/Nuke6.3v6/libQtCore.so.4
#12 0x00007ffff6f85b52 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#13 0x00007ffff6cbc575 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#14 0x00007ffff63d7d7f in 
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () 
from /usr/local/Nuke6.3v6/libQtCore.so.4
#15 0x00007ffff68e6450 in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/local/Nuke6.3v6/libQtGui.so.4
#16 0x00007ffff68ebdb7 in QApplication::notify(QObject*, QEvent*) () from 
/usr/local/Nuke6.3v6/libQtGui.so.4
#17 0x0000000000ba56e8 in ?? ()
#18 0x00007ffff63d7a84 in QCoreApplication::notifyInternal(QObject*, QEvent*) 
() from /usr/local/Nuke6.3v6/libQtCore.so.4
#19 0x00007ffff68e9286 in QApplicationPrivate::sendMouseEvent(QWidget*, 
QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/local/Nuke6.3v6/libQtGui.so.4
#20 0x00007ffff6968b95 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#21 0x00007ffff6967bf7 in QApplication::x11ProcessEvent(_XEvent*) () from 
/usr/local/Nuke6.3v6/libQtGui.so.4
#22 0x00007ffff6990852 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#23 0x00007ffff1bdcbcd in g_main_context_dispatch () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007ffff1bdd3a8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007ffff1bdd639 in g_main_context_iteration () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007ffff6402255 in 
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () 
from /usr/local/Nuke6.3v6/libQtCore.so.4
#27 0x00007ffff699067f in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#28 0x00007ffff63d6c15 in 
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/local/Nuke6.3v6/libQtCore.so.4
#29 0x00007ffff63d6f6d in 
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/local/Nuke6.3v6/libQtCore.so.4
#30 0x00007ffff63d8bb6 in QCoreApplication::exec() () from 
/usr/local/Nuke6.3v6/libQtCore.so.4
#31 0x0000000000ba6d9f in ?? ()
#32 0x0000000000fcadc5 in ?? ()
#33 0x00007ffff38d1eff in __libc_start_main (main=0xfc9af4, argc=1, 
ubp_av=0x7fffffffe1c8, init=<value optimized out>, fini=<value optimized out>,
    rtld_fini=<value optimized out>, stack_end=0x7fffffffe1b8) at 
libc-start.c:226
#34 0x00000000008f9841 in ?? ()


--------------   backtrace_2 -------------------
(gdb) bt
#0  0x0000000000eb1927 in ?? ()
#1  0x0000000000eb1127 in ?? ()
#2  0x0000000000eb3f5e in ?? ()
#3  0x0000000000a81b0b in ?? ()
#4  0x00007ffff694104f in QWidget::event(QEvent*) () from 
/usr/local/Nuke6.3v6/libQtGui.so.4
#5  0x00007ffff7406f1a in QGLWidget::event(QEvent*) () from 
/usr/local/Nuke6.3v6/libQtOpenGL.so.4
#6  0x0000000000a885c9 in ?? ()
#7  0x00007ffff68e647f in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/local/Nuke6.3v6/libQtGui.so.4
#8  0x00007ffff68ebdb7 in QApplication::notify(QObject*, QEvent*) () from 
/usr/local/Nuke6.3v6/libQtGui.so.4
#9  0x0000000000ba56e8 in ?? ()
#10 0x00007ffff63d7a84 in QCoreApplication::notifyInternal(QObject*, QEvent*) 
() from /usr/local/Nuke6.3v6/libQtCore.so.4
#11 0x00007ffff68e9286 in QApplicationPrivate::sendMouseEvent(QWidget*, 
QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/local/Nuke6.3v6/libQtGui.so.4
#12 0x00007ffff6968d89 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#13 0x00007ffff6967bf7 in QApplication::x11ProcessEvent(_XEvent*) () from 
/usr/local/Nuke6.3v6/libQtGui.so.4
#14 0x00007ffff6990852 in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#15 0x00007ffff1bdcbcd in g_main_context_dispatch () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff1bdd3a8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff1bdd639 in g_main_context_iteration () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff6402255 in 
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () 
from /usr/local/Nuke6.3v6/libQtCore.so.4
#19 0x00007ffff699067f in ?? () from /usr/local/Nuke6.3v6/libQtGui.so.4
#20 0x00007ffff63d6c15 in 
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/local/Nuke6.3v6/libQtCore.so.4
#21 0x00007ffff63d6f6d in 
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/local/Nuke6.3v6/libQtCore.so.4
#22 0x00007ffff63d8bb6 in QCoreApplication::exec() () from 
/usr/local/Nuke6.3v6/libQtCore.so.4
#23 0x0000000000ba6d9f in ?? ()
#24 0x0000000000fcadc5 in ?? ()
#25 0x00007ffff38d1eff in __libc_start_main (main=0xfc9af4, argc=1, 
ubp_av=0x7fffffffe1c8, init=<value optimized out>, fini=<value optimized out>,
    rtld_fini=<value optimized out>, stack_end=0x7fffffffe1b8) at 
libc-start.c:226
#26 0x00000000008f9841 in ?? ()

(CONFIDENTIALITY NOTICE: The information contained in this email may be 
confidential and/or privileged. This email is intended to be reviewed by only 
the individual or organization named above. If you are not the intended 
recipient, or an authorized representative of the intended recipient, you are 
hereby notified that any review, dissemination or copying of this email, or the 
information contained herein is strictly prohibited. If you have received this 
communication in error, please notify the sender by return email and delete 
this email from your system. Thank You.)



_______________________________________________
Nuke-dev mailing list
[email protected]<mailto:[email protected]>, 
http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev


(CONFIDENTIALITY NOTICE: The information contained in this email may be 
confidential and/or privileged. This email is intended to be reviewed by only 
the individual or organization named above. If you are not the intended 
recipient, or an authorized representative of the intended recipient, you are 
hereby notified that any review, dissemination or copying of this email, or the 
information contained herein is strictly prohibited. If you have received this 
communication in error, please notify the sender by return email and delete 
this email from your system. Thank You.)

_______________________________________________
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