Closed jtsiomb closed 6 years ago
Hi, thanks for reporting. It is looks like a OpenGL environment related problem. I don't have a linux environment which could cause the crash, and it's not crashing in the VirtualBox guest linux. Could you help to trace this issue when you have time please? maybe try other Qt versions. Thanks in advance.
It would be helpful if you examined the state at the time of the crash using the core dump I attached, before trying random desperate things like different Qt versions. If you find something strange in the core dump and you want me to try something specific that will help you further, let me know.
Thanks, there is no strange things could found in the crash point. I will make a minimized project including the OpenGL stuff to limit the possible range of issue and ping you for help once it's done.
Hi, @jtsiomb may I know your qt version please? According to this qt blog post, qt have introduced threaded OpenGL since 4.8, and before that version, the OpenGL related Qt class is not thread safe.
Unfortunately that wasn’t possible because those Qt classes were not thread-safe. With Qt 4.8, this has changed and we have now added support for a few of the most common scenarios.
Dust3D is using a separate thread to do the offline rendering of parts, that could be a problem on Qt less than 4.8 version.
Also I have made a minimized threaded GL example project minimizedthreadedgl.zip, could you help me to test it and see if it still crash, thanks.
Usage:
Unzip minimizedthreadedgl.zip
$ cd minimizedthreadedgl
$ qmake
$ make
Run generated minimizedthreadedgl to see if it crash in none-threaded mode.
Change the define to 1 in main.cpp
#define ENABLE_THREADED_OPENGL 1
Make and run again to see if it crash in threaded mode.
If everything works fine, you should see a red triangle showed in the window.
If crash happened, that could be some Qt OpenGL bug, and we could look into it further. Thanks in advance.
I have Qt 5.10.1 installed, and the program you gave me crashes regardless of whether ENABLE_THREADED_OPENGL is 0 or 1, in exactly the same manner, in the call to QOpenGLContext::shareGroup(), like the original backtrace above.
Thanks, so it's not thread safe related problem. There is another example code which come from Qt official website: textureinthread.zip Could you help to see if it runs on your machine when you have time please?
That's a QtQuick/QML example program. Are you using QML? If not, I don't think this is going to help. Furthermore it tries to include private Qt headers which I don't have.
I am not using QML, but QOpenGLFramebufferObject, the same as the official example. Actually, my offline render code was modified from this example.
Please remove those lines from main.cpp, it should not affect the result but skip the check.
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
if (!QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::ThreadedOpenGL)) {
QQuickView view;
view.setSource(QUrl("qrc:///scenegraph/textureinthread/error.qml"));
view.show();
return app.exec();
}
If this example runs on your machine without problem, than we can compare this example with my code line by line, otherwise it's a Qt bug.
It works fine, doesn't crash.
Thanks, that's a good news. I will compare the difference of QOpenGLFramebufferObject using with the example.
Hi, @jtsiomb I guess the problem is lack of QOpenGLContext::shareContext()
in my code. Could you help to test again when you have time please, thanks in advance.
Code is here, in the parttree branch, this branch will merge back in the near future. https://github.com/huxingyi/dust3d/archive/805d0418995fb1edce839fc63933ecc7a27aefd2.zip
Unfortunately it stil crashes in exactly the same way. Also I grepped for shareContext in your code and I can't find it. Unless it's implicitly called somewhere by some constructor.
My bad, should grep setShareContext
, change is here, setShareContext
from a QOpenGLWidget.
May I known what exactly version of GNU/Linux are you using please? I want install a VirtualBox guest to reproduce it instead of guessing :-)
Thanks.
I'm running debian sid (unstable), on a pc with an intel core i5 6600 processor, and an nvidia geforce 1060 graphics card, using the nvidia proprietary drivers v390.67.
I also tried it on my laptop with an intel GPU, also running debian sid, and it works fine. It might be some interaction with the nvidia driver, which probably means you won't reproduce it in a VM.
You are right, it works fine in my debian VM. However, the official example code runs well on your machine, so there must be also some problem in my code.
Hi, @jtsiomb I have removed the offline parts render, instead, I show the parts preview directly using OpenGL widget. So, the crash should gone because the code where crash happened has been removed. Could you help to verify if it still crash on the latest master branch please? Thanks in advance.
Indeed it no longer crashes when adding a node.
Thanks for verify!
I'm trying dust3d on a GNU/Linux 64bit system, and it just crashes when I click on the "+" tool and click on the screen to place it. Here's a stack trace when that happens:
I attached a gzipped core dump core.gz