filcuc / nimqml

Qt Qml bindings for the Nim programming language
Other
164 stars 20 forks source link

Examples produce Segmentation Faults #28

Closed KnorrFG closed 3 years ago

KnorrFG commented 3 years ago

Hey, using DOtherSide 0.6 and and the latest nimqml, I am able to compile all examples, but when I try to run them, they will crash with a segmentation fault. I assume it's due to the installed QT version, I'm not sure. Here is a list of all installed QT-packages on my system:

libdbusmenu-qt5-2/now 0.9.3+16.04.20200111-1ubuntu3 amd64 [installed,local]
libphonon4qt5-4/focal,now 4:4.11.1-3build1 amd64 [installed,automatic]
libphonon4qt5-data/focal,focal,now 4:4.11.1-3build1 all [installed,automatic]
libpolkit-qt5-1-1/focal,now 0.113.0-0ubuntu2 amd64 [installed,automatic]
libqscintilla2-qt5-15/focal,now 2.11.2+dfsg-6 amd64 [installed,automatic]
libqscintilla2-qt5-l10n/focal,focal,now 2.11.2+dfsg-6 all [installed,automatic]
libqt5concurrent5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5core5a/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5dbus5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5designer5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5designercomponents5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5gui5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5help5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5network5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5opengl5-dev/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5opengl5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5positioning5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5printsupport5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5qml5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quick5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quickcontrols2-5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed]
libqt5quickparticles5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quickshapes5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quicktemplates2-5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5quicktest5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quickwidgets5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5sensors5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5sql5-sqlite/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5sql5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5svg5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5test5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5texttospeech5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5waylandclient5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5waylandcompositor5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5webchannel5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5webkit5/focal,now 5.212.0~alpha4-1ubuntu2 amd64 [installed,automatic]
libqt5widgets5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5x11extras5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5xml5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqtermwidget5-0/focal,now 0.14.1-3ubuntu1 amd64 [installed,automatic]
obconf-qt-l10n/focal,focal,now 0.14.1-1ubuntu1 all [installed,automatic]
obconf-qt/focal,now 0.14.1-1ubuntu1 amd64 [installed,automatic]
phonon4qt5-backend-vlc/focal,now 0.11.1-1build1 amd64 [installed,automatic]
phonon4qt5/focal,now 4:4.11.1-3build1 amd64 [installed,automatic]
pinentry-qt/focal,now 1.1.0-3build1 amd64 [installed,automatic]
qdoc-qt5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qhelpgenerator-qt5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qml-module-qtgraphicaleffects/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qml-module-qtquick-controls2/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed]
qml-module-qtquick-controls/focal,now 5.12.8-0ubuntu2 amd64 [installed]
qml-module-qtquick-layouts/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qml-module-qtquick-templates2/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qml-module-qtquick-window2/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qml-module-qtquick2/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qt5-assistant/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qt5-default/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed]
qt5-gtk-platformtheme/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-image-formats-plugins/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qt5-qmake-bin/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-qmake/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-qmltooling-plugins/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qtattributionsscanner-qt5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qtbase5-dev-tools/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qtbase5-dev/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qtchooser/focal,now 66-2build1 amd64 [installed,automatic]
qtdeclarative5-dev-tools/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qtdeclarative5-dev/focal,now 5.12.8-0ubuntu1 amd64 [installed]
qterminal-l10n/focal,focal,now 0.14.1-0ubuntu2 all [installed,automatic]
qterminal/focal,now 0.14.1-0ubuntu2 amd64 [installed]
qtermwidget5-data/focal,focal,now 0.14.1-3ubuntu1 all [installed,automatic]
qtquickcontrols2-5-dev/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed]
qttools5-dev-tools/focal,now 5.12.8-0ubuntu1 amd64 [installed]
qttranslations5-l10n/focal,focal,now 5.12.8-0ubuntu1 all [installed]
qtwayland5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]

Are there any known incompatibilities? Am I missing something?

filcuc commented 3 years ago

Without a stack trace the only thing i can do it's trying to replicate the issue. What kind of system are you using? I need:

KnorrFG commented 3 years ago

Im sorry. I use Ubuntu 20.04.1 LTS

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) 
$ nim -v
Nim Compiler Version 1.4.0 [Linux: amd64]
Compiled at 2020-10-18
Copyright (c) 2006-2020 by Andreas Rumpf

git hash: bdcd87afca238a0a7b2c70971827cf9172817b12
active boot switches: -d:release

the problem occurs with multiple versions of DOtherSide, the last one I tried with was: f5bb30f78d8aa4a048d2533342ad32583b26cd2e (0.6.3)

A few stack traces:

Simpledata:

Traceback (most recent call last)
/home/felix/tmp/nimqml/examples/simpledata/main.nim(32) main
/home/felix/tmp/nimqml/examples/simpledata/main.nim(29) mainProc
/home/felix/tmp/nimqml/src/nimqml/private/qapplication.nim(8) exec
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)

Hello World:

Traceback (most recent call last)
/home/felix/tmp/nimqml/examples/helloworld/main.nim(16) main
/home/felix/tmp/nimqml/examples/helloworld/main.nim(13) mainProc
/home/felix/tmp/nimqml/src/nimqml/private/qapplication.nim(8) exec
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)

Contactapp:

Traceback (most recent call last)
/home/felix/tmp/nimqml/examples/contactapp/main.nim(22) main
/home/felix/tmp/nimqml/examples/contactapp/main.nim(19) mainProc
/home/felix/tmp/nimqml/src/nimqml/private/qapplication.nim(8) exec
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
QObject::~QObject: Timers cannot be stopped from another thread
Segmentation fault (core dumped)
filcuc commented 3 years ago

Ok, if you want to help furthermore can you recompile and install dotherside in debug? you just need to invoke cmake as follow

cmake -DCMAKE_BUILD_TYPE=Debug /path/to/dotherside/sources
make
make install

From the stack traces it seems an access to a nullptr. This could be also caused my something on the Nim side. Honestly i haven't tested the 1.4.0 release lately. Another test (if you have time and will) is to check with Nim 1.2.X

KnorrFG commented 3 years ago

I rebuild DOtherSide in debug mode, but it didn't change the stack traces. I built it with the cmake flag, then ran make, make install and ldconfig, and then recompiled the examples via nim c -rf main.

I also tested it with nim 1.2.0 and 1.2.8 still producing the same error and the same stack trace.

filcuc commented 3 years ago

I'm unable to reproduce and after:

i've the following qt packages

libqt5concurrent5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5core5a/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5dbus5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5gui5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5network5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5opengl5-dev/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5opengl5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5printsupport5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5qml5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quick5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quickcontrols2-5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5quickparticles5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quickshapes5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quicktemplates2-5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5quicktest5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5quickwidgets5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5sql5-sqlite/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5sql5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5svg5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5test5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5widgets5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5xml5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qml-module-qtgraphicaleffects/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qml-module-qtquick-controls2/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed]
qml-module-qtquick-controls/focal,now 5.12.8-0ubuntu2 amd64 [installed]
qml-module-qtquick-layouts/focal,now 5.12.8-0ubuntu1 amd64 [installed]
qml-module-qtquick-templates2/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qml-module-qtquick-window2/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qml-module-qtquick2/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qt5-gtk-platformtheme/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-qmake-bin/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-qmake/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-qmltooling-plugins/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qtbase5-dev-tools/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qtbase5-dev/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qtchooser/focal,now 66-2build1 amd64 [installed,automatic]
qtdeclarative5-dev-tools/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
qtdeclarative5-dev/focal,now 5.12.8-0ubuntu1 amd64 [installed]
qtquickcontrols2-5-dev/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed]
qttranslations5-l10n/focal,focal,now 5.12.8-0ubuntu1 all [installed,automatic]
filcuc commented 3 years ago

@KnorrFG can please double check if you have multiple version of dotherside library installed?

KnorrFG commented 3 years ago

I have only manually installed it by cloning it and running make install. I checked the lib dir, and indeed there were still other versions around and the link to libDOtherSide.so.0.6 was still pointing to the 6.4 version. But I've corrected that, and it does not change anything. But I just added -d:debug to the compilation command for the hello word. So now it is ~/tmp/nimqml/examples$ nim c -rf -d:debug helloworld/main and that changed the output a little to (and this time I'll give you the complete output in case I miss something):

~/tmp/nimqml/examples$ nim c -rf -d:debug helloworld/main
Hint: used config file '/home/felix/.choosenim/toolchains/nim-1.4.0/config/nim.cfg' [Conf]   
Hint: used config file '/home/felix/.choosenim/toolchains/nim-1.4.0/config/config.nims' [Conf]                                                                                            
Hint: used config file '/home/felix/tmp/nimqml/examples/helloworld/main.nim.cfg' [Conf]      
.................                                                                            
/home/felix/tmp/nimqml/examples/helloworld/main.nim(3, 8) Warning: imported and not used: 'typeinfo' [UnusedImport]                                                                       
/home/felix/tmp/nimqml/examples/helloworld/main.nim(2, 8) Warning: imported and not used: 'macros' [UnusedImport]                                                                         
CC: stdlib_assertions.nim
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: stdlib_math.nim
CC: stdlib_tables.nim
CC: ../../src/nimqml.nim
CC: main.nim
Hint:  [Link]
Hint: 42522 lines; 1.066s; 61.188MiB peakmem; Debug build; proj: /home/felix/tmp/nimqml/examples/helloworld/main; out: /home/felix/tmp/nimqml/examples/helloworld/main [SuccessX]
Hint: /home/felix/tmp/nimqml/examples/helloworld/main  [Exec]
NimQml: QMetaObject: newQObjectMetaObject
NimQml: QMetaObject: newQAbstractItemModelMetaObject
NimQml: QMetaObject: newQAbstractListModelMetaObject
NimQml: QMetaObject: newQAbstractItemTableMetaObject
Traceback (most recent call last)
/home/felix/tmp/nimqml/examples/helloworld/main.nim(16) main
/home/felix/tmp/nimqml/examples/helloworld/main.nim(13) mainProc
/home/felix/tmp/nimqml/src/nimqml/private/qapplication.nim(8) exec
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
Error: execution of an external program failed: '/home/felix/tmp/nimqml/examples/helloworld/main '
KnorrFG commented 3 years ago

To provide you some more information, I just ran the hello world program through Valgrind. To be honest, I know nothing about Valgrind, but it was given to me as a tip to investigate mysterious crashes.

This was the output:

==34159== Memcheck, a memory error detector
==34159== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==34159== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==34159== Command: ./main
==34159== 
NimQml: QMetaObject: newQObjectMetaObject
NimQml: QMetaObject: newQAbstractItemModelMetaObject
NimQml: QMetaObject: newQAbstractListModelMetaObject
NimQml: QMetaObject: newQAbstractItemTableMetaObject
--34159-- WARNING: unhandled amd64-linux syscall: 315
--34159-- You may be able to write your own handler.
--34159-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--34159-- Nevertheless we consider this a bug.  Please report
--34159-- it at http://valgrind.org/support/bug_reports.html.
==34159== Thread 8 QSGRenderThread:
==34159== Invalid read of size 4
==34159==    at 0x11753E27: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x1175437B: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x117570EA: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x7C37E92: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0)
==34159==    by 0x7C38466: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0)
==34159==    by 0x7C39C57: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0)
==34159==    by 0x116909D0: ??? (in /usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so)
==34159==    by 0x5F16E2D: QOpenGLContext::makeCurrent(QSurface*) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.12.8)
==34159==    by 0x5AAF373: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.12.8)
==34159==    by 0x693A9D1: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.12.8)
==34159==    by 0x72DA608: start_thread (pthread_create.c:477)
==34159==    by 0x4991292: clone (clone.S:95)
==34159==  Address 0x98c is not stack'd, malloc'd or (recently) free'd
==34159== 
Traceback (most recent call last)
/home/felix/tmp/nimqml/examples/helloworld/main.nim(16) main
/home/felix/tmp/nimqml/examples/helloworld/main.nim(13) mainProc
/home/felix/tmp/nimqml/src/nimqml/private/qapplication.nim(8) exec
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
==34159== Invalid read of size 8
==34159==    at 0x1175B561: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x117BA277: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x4011F7C: _dl_fini (dl-fini.c:143)
==34159==    by 0x48B8A26: __run_exit_handlers (exit.c:108)
==34159==    by 0x48B8BDF: exit (exit.c:139)
==34159==    by 0x1184E5: signalHandler (in /home/felix/tmp/nimqml/examples/helloworld/main)
==34159==    by 0x48B520F: ??? (in /usr/lib/x86_64-linux-gnu/libc-2.31.so)
==34159==    by 0x11753E26: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x1175437B: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x117570EA: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x7C37E92: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0)
==34159==    by 0x7C38466: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0)
==34159==  Address 0x68 is not stack'd, malloc'd or (recently) free'd
==34159== 
==34159== 
==34159== Process terminating with default action of signal 11 (SIGSEGV)
==34159==  Access not within mapped region at address 0x68
==34159==    at 0x1175B561: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x117BA277: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x4011F7C: _dl_fini (dl-fini.c:143)
==34159==    by 0x48B8A26: __run_exit_handlers (exit.c:108)
==34159==    by 0x48B8BDF: exit (exit.c:139)
==34159==    by 0x1184E5: signalHandler (in /home/felix/tmp/nimqml/examples/helloworld/main)
==34159==    by 0x48B520F: ??? (in /usr/lib/x86_64-linux-gnu/libc-2.31.so)
==34159==    by 0x11753E26: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x1175437B: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x117570EA: ??? (in /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.435.21)
==34159==    by 0x7C37E92: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0)
==34159==    by 0x7C38466: ??? (in /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0)
==34159==  If you believe this happened as a result of a stack
==34159==  overflow in your program's main thread (unlikely but
==34159==  possible), you can try to increase the size of the
==34159==  main thread stack using the --main-stacksize= flag.
==34159==  The main thread stack size used in this run was 8388608.
==34159== 
==34159== HEAP SUMMARY:
==34159==     in use at exit: 6,759,097 bytes in 27,182 blocks
==34159==   total heap usage: 338,776 allocs, 311,594 frees, 4,909,333,749 bytes allocated
==34159== 
==34159== LEAK SUMMARY:
==34159==    definitely lost: 9,408 bytes in 55 blocks
==34159==    indirectly lost: 79,767 bytes in 433 blocks
==34159==      possibly lost: 364,919 bytes in 200 blocks
==34159==    still reachable: 6,239,699 bytes in 25,960 blocks
==34159==                       of which reachable via heuristic:
==34159==                         length64           : 3,504 bytes in 63 blocks
==34159==                         newarray           : 83,072 bytes in 90 blocks
==34159==                         multipleinheritance: 1,168 bytes in 5 blocks
==34159==         suppressed: 0 bytes in 0 blocks
==34159== Rerun with --leak-check=full to see details of leaked memory
==34159== 
==34159== For lists of detected and suppressed errors, rerun with: -s
==34159== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)

So I don't get a lot from this, but it seems it has to do with my NVidia card. So i changed to the Intel GPU. And suddenly the examples ran. I toggled back to NVIdia and it crashes again. So that is definitely the reason, for what it's worth.

filcuc commented 3 years ago

If that's the reason i would aspect to see the same problem with any Qt application and not only with those created through the NimQml or DOtherSide. Can you please elaborate what you do mean with toggling the Nvidia card? are you using bumblebee?

KnorrFG commented 3 years ago

I have QT applications installed (QTerminal for example) and those work fine. I use an Alienware 13 R2, which's HDMI port is wired to the nvidia card. So to be able to use an external monitor I have to run the X-session through the nvidia card, and consequently everything else too. I use nvidia prime to toggle between the nvidia and the intel gpu

filcuc commented 3 years ago

QTerminal probably doesn't trigger any OpenGL stuff during rendering. QtQuick istead is a primary user of OpenGL. Can you please install qtquickcontrols2-5-examples are run any demo with the nvidia card and give a feedback. Thank you

KnorrFG commented 3 years ago

I compiled and ran the contactlist example (through the nvidia GPU). It started and I could add a contact. The Gallery examples didn't run due to: QQmlApplicationEngine failed to load component qrc:/gallery.qml:56 module "Qt.labs.settings" is not installed

filcuc commented 3 years ago

Previously we had same issues. See https://github.com/filcuc/nimqml/issues/22

KnorrFG commented 3 years ago

I see, so nothing can be done here, and I have to switch drivers, if I want to use nimqml. Too bad :(

But thanks for your help :+1:

filcuc commented 3 years ago

without the proper hardware is hard to investigate further. i would need to look at the stack trace inside Qt itself. Probably everything would work with never versions of Qt. Honestly it could have been solved already in 5.15