https://www.ultimatepp.org/redmine/https://www.ultimatepp.org/redmine/redmine/favicon.ico2013-01-24T20:30:50ZRedmineU++ - Bug #429: MT app hangs on main threadhttps://www.ultimatepp.org/redmine/issues/429?journal_id=8332013-01-24T20:30:50ZMassimo Del Fedelemax@veneto.com
<ul></ul><p>(gdb) bt<br />#0 0x00007ffff47c7303 in <i>GI</i><em>poll (fds=<optimized out>, nfds=<optimized out>, <br /> timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87<br /><a class="issue tracker-2 status-1 priority-4 priority-default" href="https://www.ultimatepp.org/redmine/issues/1" title="Check and apply TreeCtrl improvement (New)">#1</a> 0x00007ffff1e67972 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1<br /><a class="issue tracker-2 status-8 priority-4 priority-default closed" href="https://www.ultimatepp.org/redmine/issues/2" title="TheIDE: Codebrowser should be moved out of split (Approved)">#2</a> 0x00007ffff1e68e47 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1<br /><a class="issue tracker-1 status-1 priority-4 priority-default" href="https://www.ultimatepp.org/redmine/issues/3" title="Report scrolling with Painter content - scroll artifacts (New)">#3</a> 0x00007ffff1e6906b in xcb_wait_for_reply () from /usr/lib/x86_64-linux-gnu/libxcb.so.1<br /><a class="issue tracker-1 status-6 priority-4 priority-default closed" href="https://www.ultimatepp.org/redmine/issues/4" title="TheIDE: investigate speed when switching files (Rejected)">#4</a> 0x00007ffff6992289 in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6<br /><a class="issue tracker-1 status-8 priority-5 priority-high3 closed" href="https://www.ultimatepp.org/redmine/issues/5" title="Linux: fix menu (and/or bar) colors in dark themes (Approved)">#5</a> 0x00007ffff698dd3d in XSync () from /usr/lib/x86_64-linux-gnu/libX11.so.6<br /><a class="issue tracker-1 status-8 priority-5 priority-high3 closed" href="https://www.ultimatepp.org/redmine/issues/6" title="Linux: fix appearance of scrollbars (Approved)">#6</a> 0x00000000008e5b22 in Upp::Ctrl::TimerAndPaint ()<br /> at /home/massimo/sources/upp-svn/uppsrc/CtrlCore/X11Wnd.cpp:341<br /><a class="issue tracker-1 status-8 priority-4 priority-default closed" href="https://www.ultimatepp.org/redmine/issues/7" title="Posix: Check Socket (Approved)">#7</a> 0x00000000008e615f in Upp::Ctrl::EventLoop0 (ctrl=0x7fffffffb230)<br /> at /home/massimo/sources/upp-svn/uppsrc/CtrlCore/X11Wnd.cpp:444<br /><a class="issue tracker-1 status-8 priority-5 priority-high3 closed" href="https://www.ultimatepp.org/redmine/issues/8" title="Web: Refactor Socket error handling (Approved)">#8</a> 0x0000000000914c95 in Upp::CallbackActionCallArg<void (<strong>)(Upp::Ctrl</strong>), Upp::Ctrl*, unsigned long>::Execute (this=0x7fffd76fd440)<br /> at /home/massimo/sources/upp-svn/uppsrc/Core/Callback1.h:48<br /><a class="issue tracker-1 status-8 priority-4 priority-default closed" href="https://www.ultimatepp.org/redmine/issues/9" title="TheIDE: Add SSE2 flag to main package config (Approved)">#9</a> 0x00000000009be259 in Upp::Callback::Execute (this=0x7fffffffa100)<br /> at /home/massimo/sources/upp-svn/uppsrc/Core/Callback.cpp:7<br /><a class="issue tracker-2 status-1 priority-4 priority-default" href="https://www.ultimatepp.org/redmine/issues/10" title="XML: support different encodings (New)">#10</a> 0x00000000004cff1e in Upp::Callback::operator() (this=0x7fffffffa100)<br /> at /home/massimo/sources/upp-svn/uppsrc/Core/Cbgen.h:32<br /><a class="issue tracker-4 status-8 priority-7 priority-highest closed" href="https://www.ultimatepp.org/redmine/issues/11" title="Document ClipData, Clipboard and D&D (Approved)">#11</a> 0x00000000008bf31f in Upp::Ctrl::Call (cb=...)<br /> at /home/massimo/sources/upp-svn/uppsrc/CtrlCore/CtrlMt.cpp:71<br /><a class="issue tracker-1 status-8 priority-6 priority-high2 closed" href="https://www.ultimatepp.org/redmine/issues/12" title="SMTP - character encoding (Approved)">#12</a> 0x00000000008bf938 in Upp::Ctrl::EventLoop (ctrl=0x7fffffffb230)<br /> at /home/massimo/sources/upp-svn/uppsrc/CtrlCore/CtrlMt.cpp:157<br /><a class="issue tracker-2 status-1 priority-4 priority-default" href="https://www.ultimatepp.org/redmine/issues/13" title="Sqlite3 character encoding (New)">#13</a> 0x00000000008d87d4 in Upp::TopWindow::Run (this=0x7fffffffb230, appmodal=false)<br /> at /home/massimo/sources/upp-svn/uppsrc/CtrlCore/TopWindow.cpp:327<br /><a class="issue tracker-2 status-8 priority-4 priority-default closed" href="https://www.ultimatepp.org/redmine/issues/14" title="Add Assist support for CLOB/BLOB columns (as String) (Approved)">#14</a> 0x0000000000416bc3 in GuiMainFn</em> ()<br /> at /home/massimo/sources/upp-svn/TimberStruct/TimberStruct/TimberStruct.cpp:976<br />#15 0x00000000009aa278 in Upp::AppExecute__ (app=0x4162c7 <GuiMainFn_()>)<br /> at /home/massimo/sources/upp-svn/uppsrc/Core/App.cpp:322<br /><a class="issue tracker-1 status-8 priority-7 priority-highest closed" href="https://www.ultimatepp.org/redmine/issues/16" title="Attempt to implement better line positions for .sch conversions (Approved)">#16</a> 0x00000000004162b6 in main (argc=1, argv=0x7fffffffe088, envptr=0x7fffffffe098)<br /> at /home/massimo/sources/upp-svn/TimberStruct/TimberStruct/TimberStruct.cpp:829</p>
<p>Hangs on same x11 code.</p> U++ - Bug #429: MT app hangs on main threadhttps://www.ultimatepp.org/redmine/issues/429?journal_id=8342013-01-25T12:52:37ZMassimo Del Fedelemax@veneto.com
<ul><li><strong>File</strong> <a href="/redmine/attachments/download/116/GuiLock.zip">GuiLock.zip</a> added</li><li><strong>File</strong> <a href="/redmine/attachments/download/117/GuiLock_GTK.png">GuiLock_GTK.png</a> added</li><li><strong>File</strong> <a href="/redmine/attachments/download/118/GuiLock_WithoutGTK.png">GuiLock_WithoutGTK.png</a> added</li></ul><p>A small testcase with output results; attached is the complete package, here just a couple of notes :</p>
<pre>
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <GuiLock/GuiLock.lay>
#include <CtrlCore/lay.h>
class GuiLockTest : public WithGuiLockLayout<TopWindow>
{
void threadCb(void);
int i;
Thread th;
public:
typedef GuiLockTest CLASSNAME;
GuiLockTest();
};
void GuiLockTest::threadCb(void)
{
GuiLock __;
docEdit.Set(docEdit.Get() + Format("\n%d", i++));
}
GuiLockTest::GuiLockTest()
{
CtrlLayout(*this, "Window title");
i = 0;
for(int j = 0; j < 2; j++)
th.Start(THISBACK(threadCb));
}
GUI_APP_MAIN
{
GuiLockTest().Run();
}
</pre>
<p>The app should run 2 threads which fill the DocEdit control with sequential numbers; the GuiLock there should do the serialization too.<br />Result without GTK flag is ok, it shows numbers 0 and 1; with GTK flag it shows just number 0 and then the second thread is waiting in GuiLock to be freed.<br />The same if I increase the number of threads; it runs correctly all of them but last one, probably because then the main thread (after the constructor) locks<br />gui and don't free it.</p>
<p>Result with GTK flag is the same as my app; without GTK flag my app crashes, here is all ok, but I suppose that's because the example il too simple.</p> U++ - Bug #429: MT app hangs on main threadhttps://www.ultimatepp.org/redmine/issues/429?journal_id=8352013-01-25T18:46:43ZMassimo Del Fedelemax@veneto.com
<ul></ul><p>Adding a<br /><pre>
Sleep(10)
</pre><br />at thread function start makes the bug more evident; ALL threads are then stopped at GuiLock in GTK mode probably<br />because main thread don't release the lock.<br />Without GTK the app seems work ok.</p> U++ - Bug #429: MT app hangs on main threadhttps://www.ultimatepp.org/redmine/issues/429?journal_id=8362013-01-25T19:48:15ZMassimo Del Fedelemax@veneto.com
<ul></ul><p>Another backtrace, now crashing (sometimes hangs, sometimes crash, always in X11 code) :</p>
<p>Starting program: /home/massimo/sources/upp-svn/out/TimberStruct/GCC.Debug.Debug_Full.Gui.Mt.Shared/TimberStruct <br />[Thread debugging using libthread_db enabled]<br />Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".<br />[New Thread 0x7fffde3ff700 (LWP 26633)]<br />[New Thread 0x7fffdcecb700 (LWP 26634)]<br />[New Thread 0x7fffd723a700 (LWP 26638)]<br />[New Thread 0x7fffd61b6700 (LWP 26639)]<br />[Thread 0x7fffd61b6700 (LWP 26639) exited]<br />[New Thread 0x7fffd51e8700 (LWP 26643)]<br />[xcb] Unknown sequence number while processing queue<br />[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called<br />[xcb] Aborting, sorry about that.<br />TimberStruct: ../../src/xcb_io.c:273: poll_for_event: asserzione "!xcb_xlib_threads_sequence_lost" non riuscita.</p>
<p>Program received signal SIGABRT, Aborted.</p>
<p>Really weird....</p> U++ - Bug #429: MT app hangs on main threadhttps://www.ultimatepp.org/redmine/issues/429?journal_id=8372013-01-25T19:55:27ZMassimo Del Fedelemax@veneto.com
<ul></ul><p>As suggested by last crash report, I added<br /><pre>
XInitThreads();
</pre></p>
<p>in an INITBLOCK (so it's called before any gui stuff...) just to test and... now it's all ok, no crash anymore.<br />Shouldn't be there ? I didn't find it in Upp code.</p> U++ - Bug #429: MT app hangs on main threadhttps://www.ultimatepp.org/redmine/issues/429?journal_id=8402013-01-26T19:24:24ZMiroslav Fidlercxl@ntllib.org
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Ready for QA</i></li><li><strong>Assignee</strong> changed from <i>Miroslav Fidler</i> to <i>Massimo Del Fedele</i></li></ul><p>I believe that both modes should be now fixed.</p> U++ - Bug #429: MT app hangs on main threadhttps://www.ultimatepp.org/redmine/issues/429?journal_id=8442013-02-05T21:29:58ZMassimo Del Fedelemax@veneto.com
<ul><li><strong>Status</strong> changed from <i>Ready for QA</i> to <i>Approved</i></li><li><strong>Assignee</strong> changed from <i>Massimo Del Fedele</i> to <i>Miroslav Fidler</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul>