DGtal-team / DGtal

Digital Geometry Tools and Algorithm Library
https://dgtal.org
GNU Lesser General Public License v3.0
370 stars 115 forks source link

Execution pb when using qglviewer QT 4 and QT5 installed #1246

Closed kerautret closed 3 years ago

kerautret commented 7 years ago

On linux when QT4 and QT 5 are installed and when the cmake option WITH_QT5 is not set (by default) then the execution of program using qglviewer fails: like that:


*** Error in `graphViewer': realloc(): invalid pointer: 0x00007f75a17aa820 ***

======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x77725)[0x7f75a01ad725]
/lib/x86_64-linux-gnu/libc.so.6(+0x85350)[0x7f75a01bb350]
/lib/x86_64-linux-gnu/libc.so.6(realloc+0x22f)[0x7f75a01b9e6f]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(_ZN9QListData7reallocEi+0x1f)[0x7f759cacc9cf]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(_ZN9QListData6appendEi+0x81)[0x7f759caccaa1]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x1d6d78)[0x7f759cb98d78]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(_Z21qRegisterResourceDataiPKhS0_S0_+0x2e6)[0x7f759cb94b16]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x7bcc3)[0x7f759ca3dcc3]
/lib64/ld-linux-x86-64.so.2(+0x104ea)[0x7f75a2d9b4ea]
/lib64/ld-linux-x86-64.so.2(+0x105fb)[0x7f75a2d9b5fb]
/lib64/ld-linux-x86-64.so.2(+0xcfa)[0x7f75a2d8bcfa]
.....
======= Memory map: ========
00400000-00557000 r-xp 00000000 08:07 2765641                            /usr/local/bin/graphViewer
00756000-00757000 r--p 00156000 08:07 2765641                        

               /lib/x86_64-linux-gnu/libdl-2.23.so
7f759fc70000-7f759fc71000 r--p 00002000 08:07 791575                     /lib/x86_64-linux-gnu/libdl-2.23.so
7f759fc71000-7f759fc72000 rw-p 00003000 08:07 791575                     /lib/x86_64-linux-gnu/libdl-2.23.so
7f759fc72000-7f759fd16000 r-xp 00000000 08:07 2631361                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1Abandon (core dumped) ```
cgurps commented 6 years ago

Hi,

did you install libqglviewer with qt5 ?

kerautret commented 6 years ago

If I well remember it was using qt4 (the compilation was fine). But it could be perhaps complicated to reproduce the pb (the student were updating their system with only qt4 and that was fine).

cgurps commented 6 years ago

Yeah, qglviewer is compiled with qt4, then you must use qt4 in DGtal otherwise it creates segfaults (and the same for qt5). I had the same issue !

akrah commented 6 years ago

Hi,

With Ubuntu and Debian, if you choose an installation of QGLViewer with a packet manager, you have now two packages : libqglviewer-dev-qt4 and libqglviewer-dev-qt5. So you can have both installed and link the good library depending on the WITH_QT5 option status. Note that the names of installed libraries are libQGLViewer-qt5.so and libQGLViewer-qt4.so. Maybe you need to make a symbolic link with libQGLViewer.so ?