[Qt-interest] Segfault with an opengl widget

Trond Kjernåsen trond.kjernasen at nokia.com
Fri Sep 3 10:35:38 CEST 2010


On 09/02/2010 05:13 PM, Damien R. wrote:
> On 09/02/2010 10:31 AM, Trond Kjernåsen wrote:
>  > You're right, this is a bug in Qt which has already been corrected for
>  > 4.7. QGLContext::makeCurrent() should call internalWinId() instead of
>  > winId() in that particular case. Could you try to change that and see if
>  > it gets rid of the crash?
>
> I tried to patch the debian version of qt but I have a problem in the
> package generation.
>
> So, I have updated to Qt 4.7.0~beta2-3 and I do not have the segfault
> but I have the following warning:
> QGLContext::makeCurrent(): Cannot make invalid context current.
>
> So, an another modification in the source make that the current test is
> evaluate to true:
> if (!d->valid) {
> qWarning("QGLContext::makeCurrent(): Cannot make invalid context
> current.");
> return;
> }
>
> while it is evaluate to false in qt 4.6.3.
>
> So I will try to find why the test evaluation change between the two
> versions. Currently, I do not understand why d->valid is false.

That is probably caused by other fixes that has gone into 4.7. It would 
be helpful if you could show us some code that causes this to happen. 
Are you using multiple rendering threads or similar?

--
Trond K.



More information about the Qt-interest-old mailing list