http://redmine.emweb.be/http://redmine.emweb.be/favicon.ico?16934085252011-09-12T08:44:51ZRedmineWt - Bug #976: segmentation fault when creating a WMessageBox when not executed on a session threadhttp://redmine.emweb.be/issues/976?journal_id=26292011-09-12T08:44:51ZKoen Deforchekoen@emweb.be
<ul><li><strong>Assignee</strong> set to <i>Koen Deforche</i></li></ul><p>Hey Arjan,</p>
<p>I've tried some scenarios for this and indeed it fails. I do not readily see a single problem that causes this, it might be more than one :-)</p>
<p>How are you doing this actually, using server push with UpdateLock or with WServer::post() ?</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #976: segmentation fault when creating a WMessageBox when not executed on a session threadhttp://redmine.emweb.be/issues/976?journal_id=26302011-09-12T08:45:12ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>InProgress</i></li></ul> Wt - Bug #976: segmentation fault when creating a WMessageBox when not executed on a session threadhttp://redmine.emweb.be/issues/976?journal_id=57372013-07-01T16:51:18ZPierluigi Vicinanzapierv@carallon.com
<ul></ul><p>Hi,</p>
<p>I think I have a several repro for this bug:</p>
<p>1) create a custom WDialog dialog (e.g. MyDialog), with a WFileUpload widget inside<br><br>
2) connect WFileUpload::onFileTooLarge signal to a MyDialog method (e.g. MyDialog::onLargeFileUploaded())<br><br>
3) make "MyDialog::onLargeFileUploaded()" display an error message by calling "Wt::WMessageBox::show("Error", "file too large\");<br><br>
4) start you wt app and make it start a <strong>blocking</strong> MyDialog by calling MyDialog::exec()<br><br>
5) upload a large file using the WFileUpload widget provided by MyDialog<br><br>
6) wait for upload to finish and error message to be displayed.... BOOM!!</p>
<p>Alternatively, you can use these steps:<br><br>
1) create a custom WDialog dialog (e.g. MyDialog)<br><br>
2) create a method "MyDialog::displayError()" that displays an error message by calling "Wt::WMessageBox::show("Error", "Blah!");<br><br>
4) start you wt app and make a session execute a <strong>blocking</strong> MyDialog by calling MyDialog::exec()<br><br>
5) from your main app, post an event (e.g. via WServer::post()) to your wt session started in step 5, this function will have to execute the "MyDialog::displayError()\" on<br><br>
6) wait for event to be notified and error message to be displayed.... BOOM!!</p>
<p>Key elements to trigger this bug are:<br><br>
a) having a <strong>blocking</strong> dialog running<br><br>
b) starting another <strong>blocking</strong> dialog (WMessageBox::show) on top of the previous one, but <strong>from a different session</strong></p>
<p>I've done a (very brief) debugging session and the problem seems to be one of the two recursive event loops that is clearing the connection handler after having "consumed" it and while the other event loop is still referencing it.</p>
<p>Now, considering what Wt docs say about the topic (ref. <a href="http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WDialog.html):" class="external">http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WDialog.html):</a><br><br>
"A thread that is locked by a recursive event loop cannot be used to process requests from another sessions",<br><br>
and that blocking/synchronous dialogs are somehow deprecated, I'm not sure this can still be considered a "valid" bug (assuming that the "incorrect usage" explained above is the only one that it's able to trigger it).</p>
<p>Hope this helps.</p>
<p>Regards,</p>
<p>Pierluigi Vicinanza</p>
Wt - Bug #976: segmentation fault when creating a WMessageBox when not executed on a session threadhttp://redmine.emweb.be/issues/976?journal_id=103442014-10-22T14:19:08ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>InProgress</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>3.3.4</i></li></ul><p>Hey,</p>
<p>This is indeed not supported and would be hard to implement. Given the workaround of not using blocking APIs all-together, we've updated the documentation to indicate this limitation.</p>
<p>Koenr</p>
Wt - Bug #976: segmentation fault when creating a WMessageBox when not executed on a session threadhttp://redmine.emweb.be/issues/976?journal_id=110492015-03-17T07:25:54ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>