Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qtbase unstable on Windows #10

Open
kaisernahid opened this issue Aug 16, 2013 · 12 comments
Open

qtbase unstable on Windows #10

kaisernahid opened this issue Aug 16, 2013 · 12 comments

Comments

@kaisernahid
Copy link
Contributor

Following unstable behavior has been detected for qtbase in Windows platform:

  1. qtbase example demo/characterWidget crashes at the beginning or after some left mouse button click on the characters
  2. qtpaint fails when test->repaint() in function qanviz_painter_test in file TestWidget.cpp gets called several times
  3. cranvas fails when moving the mouse button fast in a qscatter plot; Similar crashes can be observed for key press for qscatter as well as for qhist or other plots.

qtpaint and cranvas both depend on qtbase package, and although both of these packages show warnings such as "recursive repaint detected", I believe all the above 3 crashes are happening due to lack of synchronization between single-threaded R's event-loop and Qt's event-loop.

EventLoop.cpp file in qtbase has an effort to perform the eventloop synchronization between R and Qt for linux platform but nothing corresponding to Windows, specially because of the absence of "addInputHandler" type of mechanism in Windows.

One possible approach for making the Windows version stable could be to mimic the eventloop synchronization in linux by creating a dummy window in Windows and sending message to it.

Test Platform: Windows 7 64 bit
R version: 3.0.1
Qt version: 4.8.4

@lawremi
Copy link
Member

lawremi commented Aug 17, 2013

I'm pretty sure that the R Windows GUI is iterating the Windows event loop from multiple threads and Qt is somehow being driven by both/all of them. Typically, event loops in GUI toolkits like Qt are single-threaded for the benefit (simplicity) of the application (but applications can run multiple event loops, like with dialogs). The "recursive repaint detected" is an indicator that Qt does not expect to have multiple threads painting the same widget.

One possible solution is to abandon the R Windows GUI. This means either R batch mode, or a Qt-based R GUI. The latter already exists: R Studio. But R Studio does not run 64bit on Windows yet, because of the Qt binary availability. That was supposed to have changed with Qt 5.1. I am making good progress on a Qt 5.x qtbase.

Thanks for your hard work this summer.

kaisernahid added a commit to kaisernahid/qtbase that referenced this issue Aug 20, 2013
@yihui
Copy link
Member

yihui commented Oct 10, 2013

Hi Michael, how is your Qt 5.x qtbase going?

@lawremi
Copy link
Member

lawremi commented Oct 10, 2013

It compiles... just need to get it to link...

On Thu, Oct 10, 2013 at 12:31 PM, Yihui Xie notifications@github.comwrote:

Hi Michael, how is your Qt 5.x qtbase going?


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-26083664
.

@lawremi
Copy link
Member

lawremi commented Oct 14, 2013

Update: tweaked linker flags, got further, hit bug in Qt 5.1. Will report.

On Thu, Oct 10, 2013 at 12:33 PM, Michael Lawrence michafla@gene.comwrote:

It compiles... just need to get it to link...

On Thu, Oct 10, 2013 at 12:31 PM, Yihui Xie notifications@github.comwrote:

Hi Michael, how is your Qt 5.x qtbase going?


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-26083664
.

@yihui
Copy link
Member

yihui commented Oct 14, 2013

Awesome!

@lawremi
Copy link
Member

lawremi commented Oct 14, 2013

Update: Qt will fix the bug; currently figuring out a work-around for now.

On Mon, Oct 14, 2013 at 10:38 AM, Yihui Xie notifications@github.comwrote:

Awesome!


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-26273831
.

@deepayan
Copy link
Contributor

On Mon, Oct 14, 2013 at 11:14 PM, lawremi notifications@github.com wrote:

Update: Qt will fix the bug; currently figuring out a work-around for now.

Is this applicable to both Linux and Windows, or just Windows? What's
the status with Qt5 on Linux?

@lawremi
Copy link
Member

lawremi commented Oct 15, 2013

This applies to all platforms; sorry, sort of abusing this ticket.

On Tue, Oct 15, 2013 at 4:13 AM, deepayan notifications@github.com wrote:

On Mon, Oct 14, 2013 at 11:14 PM, lawremi notifications@github.com
wrote:

Update: Qt will fix the bug; currently figuring out a work-around for
now.

Is this applicable to both Linux and Windows, or just Windows? What's
the status with Qt5 on Linux?


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-26325807
.

@lawremi
Copy link
Member

lawremi commented Oct 25, 2013

Qt 5.2 beta released with fix; grabbing now.

@yihui
Copy link
Member

yihui commented Oct 25, 2013

Awesome! Thanks!

@lawremi
Copy link
Member

lawremi commented Oct 31, 2013

With some bug fixes to Qt (so obvious I won't bother reporting) and tweaks
to the generator, I was able to open a window with Qt 5.2. I'll merge the
stuff from Amazon, and start testing more complex examples. The class
extension stuff is going to be tricky, because they made some significant
changes to the meta object compiler, which I had managed to reverse
engineer. Then it's time for qtpaint. The OpenGL support in Qt has been
totally reworked, so that will take some time, as well. There's also the
option of using the new scene graph designed for QtQuick.

Michael

On Fri, Oct 25, 2013 at 4:01 PM, Yihui Xie notifications@github.com wrote:

Awesome! Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-27132203
.

@yihui
Copy link
Member

yihui commented Nov 1, 2013

Sounds great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants