By the way, here is the callstack when the exception is thrown from 
WebSession::doRecursiveEventLoop()

#0  0x00007ffff49eb1c0 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1  0x00007ffff7ad3436 in boost::unique_lock<boost::mutex>::unlock 
(this=0x77dc80) at /usr/include/boost/thread/locks.hpp:371
#2  wait<boost::unique_lock<boost::mutex> > (this=0x77dc80) at 
/usr/include/boost/thread/pthread/condition_variable.hpp:83
#3  Wt::WebSession::doRecursiveEventLoop (this=0x77dc80) at 
/chb/users/ginsburg/Downloads/wt-3.1.0/src/web/WebSession.C:665
#4  0x00007ffff799d021 in Wt::WDialog::exec (this=0x7fffe1ff9a40) at 
/chb/users/ginsburg/Downloads/wt-3.1.0/src/Wt/WDialog.C:214
#5  0x000000000048b793 in ScanBrowser::pipelineOverrideClicked (this=<value 
optimized out>) at 
/chb/users/ginsburg/workspaces/www/wt/src/pl_gui/ScanBrowser.cpp:418
#6  0x00007ffff7a98fc3 in boost::signal1<void, Wt::WMouseEvent, 
boost::last_value<void>, int, std::less<int>, boost::function1<void, 
Wt::WMouseEvent> >::operator()(Wt::WMouseEvent) () from 
/usr/local/lib/libwt.so.19
#7  0x00007ffff7a99750 in 
Wt::EventSignal<Wt::WMouseEvent>::processDynamic(Wt::JavaScriptEvent const&) () 
from /usr/local/lib/libwt.so.19
#8  0x00007ffff7ad01c6 in Wt::WebSession::processSignal (this=<value optimized 
out>, s=0x77f9e8, se=<value optimized out>, request=<value optimized out>, 
kind=<value optimized out>) at 
/chb/users/ginsburg/Downloads/wt-3.1.0/src/web/WebSession.C:1438
#9  0x00007ffff7ad711b in Wt::WebSession::notifySignal (this=0x77dc80, e=<value 
optimized out>) at 
/chb/users/ginsburg/Downloads/wt-3.1.0/src/web/WebSession.C:1412
#10 0x00007ffff7ad7b8d in Wt::WebSession::notify (this=0x77dc80, event=...) at 
/chb/users/ginsburg/Downloads/wt-3.1.0/src/web/WebSession.C:1183
#11 0x000000000049a54a in Wt::DispatchThread::doEvent (this=0x7fffe408ce20) at 
/chb/users/ginsburg/workspaces/www/wt/src/pl_gui/lib/DispatchThread.C:150
#12 0x000000000049b251 in Wt::DispatchObject::qt_metacall (this=0x7b8070, 
_c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=<value 
optimized out>) at 
/chb/users/ginsburg/workspaces/www/wt/build/src/pl_gui/lib/moccedDispatchThread.C:70
#13 0x00007ffff613e0f9 in QObject::event(QEvent*) () from 
/usr/lib/libQtCore.so.4
#14 0x00007ffff6b09efc in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/lib/libQtGui.so.4
#15 0x00007ffff6b111ce in QApplication::notify(QObject*, QEvent*) () from 
/usr/lib/libQtGui.so.4
#16 0x00007ffff612ec2c in QCoreApplication::notifyInternal(QObject*, QEvent*) 
() from /usr/lib/libQtCore.so.4
#17 0x00007ffff612f80a in QCoreApplicationPrivate::sendPostedEvents(QObject*, 
int, QThreadData*) () from /usr/lib/libQtCore.so.4
#18 0x00007ffff6157533 in ?? () from /usr/lib/libQtCore.so.4
#19 0x00007ffff276abce in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#20 0x00007ffff276e598 in ?? () from /lib/libglib-2.0.so.0
#21 0x00007ffff276e6c0 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#22 0x00007ffff61571a6 in 
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () 
from /usr/lib/libQtCore.so.4
#23 0x00007ffff612d532 in 
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/lib/libQtCore.so.4
#24 0x00007ffff612d904 in 
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/lib/libQtCore.so.4
#25 0x00007ffff60456cb in QThread::exec() () from /usr/lib/libQtCore.so.4
#26 0x000000000049a6c4 in Wt::DispatchThread::run (this=0x7fffe408ce20) at 
/chb/users/ginsburg/workspaces/www/wt/src/pl_gui/lib/DispatchThread.C:69
#27 0x00007ffff6048445 in ?? () from /usr/lib/libQtCore.so.4
#28 0x00007ffff5dd4a04 in start_thread (arg=<value optimized out>) at 
pthread_create.c:300
#29 0x00007ffff41f97bd in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#30 0x0000000000000000 in ?? ()

On Feb 3, 2010, at 11:07 AM, Ginsburg, Daniel wrote:

> Hi Koen,
> 
> Coming back to this problem:
> 
>> 
>> I found the problem, and pushed a fix to public git. The following is
>> a patch which you could also apply on 3.1.0.
>> 
>> Regards,
>> koen
>> 
>> diff --git a/src/Wt/WResource.C b/src/Wt/WResource.C
>> index c960b25..df8876e 100644
>> --- a/src/Wt/WResource.C
>> +++ b/src/Wt/WResource.C
>> @@ -86,7 +86,7 @@ void WResource::handle(WebRequest *webRequest,
>> WebResponse *webResponse,
>>  // lock
>>  if (!continuation) {
>>    WebSession::Handler *h = WebSession::Handler::instance();
>> -    if (h)
>> +    if (h && h->lock().owns_lock())
>>      h->lock().unlock();
>>  }
>> #endif // WT_THREADED
> 
> 
> 
> Although this fix seems to have partially fixed the problem, I am seeing an 
> issue that I did not notice before.  Now, when I create a modal WDialog and 
> call the dialog's exec() I get a boost::lock_error exception thrown:
> 
> 0.17.24.201 - - [2010-Feb-03 10:16:51.291922] "POST 
> /?wtd=YprzPnQp14Uuo2MY&rand=36635 HTTP/1.1" 200 0
> [2010-Feb-03 10:16:51.293761] 10621 [/ YprzPnQp14Uuo2MY] [error] "Error 
> during event handling: boost::lock_error"
> Qt has caught an exception thrown from an event handler. Throwing
> exceptions from an event handler is not supported in Qt. You must
> reimplement QApplication::notify() and catch all exceptions there.
> 
> terminate called after throwing an instance of 'boost::lock_error'
>  what():  boost::lock_error
> Aborted
> 
> I am assuming this has something to do with the WDialog::exec() spawning a 
> new thread?
> 
> Any help/fix would be appreciated.
> 
> Daniel Ginsburg / email: daniel.ginsb...@childrens.harvard.edu
> Principal Software Architect
> Fetal-Neonatal Neuroimaging and Development Science Center
> Children's Hospital Boston
> 300 Longwood Avenue
> Boston, MA 02115
> Phone: 857-218-5140
> 
> 
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest

Daniel Ginsburg / email: daniel.ginsb...@childrens.harvard.edu
Principal Software Architect
Fetal-Neonatal Neuroimaging and Development Science Center
Children's Hospital Boston
300 Longwood Avenue
Boston, MA 02115
Phone: 857-218-5140


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to