VUKOZ-OEL / 3d-forest-classic

software for analysis of Lidar data from forest environment.
GNU General Public License v3.0
84 stars 26 forks source link

3D Forest doesn't start on Linux Ubuntu #33

Closed Loris-L closed 1 year ago

Loris-L commented 1 year ago

Hi, after several problems solved previously and during 3D Forest compiling, i managed to compile it on Ubuntu 22.04. But when i start the executable, sometimes it crashes with the message "Segmentation fault (core dump)" and sometimes starts normally. I used gdb and the backtrace output of segmentation fault is this:

gdb 3DForest
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from 3DForest...
(No debugging symbols found in 3DForest)
(gdb) r
Starting program: /home/loris/Scaricati/3d-forest-classic-052/build/3DForest 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe5804640 (LWP 549918)]
[New Thread 0x7fffdfcb5640 (LWP 549919)]
[New Thread 0x7fffdf4b4640 (LWP 549920)]
[New Thread 0x7fffdeb3e640 (LWP 549921)]

Thread 1 "3DForest" received signal SIGSEGV, Segmentation fault.
XDisplayKeycodes (dpy=dpy@entry=0x820, min_keycode_return=min_keycode_return@entry=0x555555a73e64, max_keycode_return=max_keycode_return@entry=0x555555a73e68) at ../../src/Misc.c:53
53  ../../src/Misc.c: File o directory non esistente.
(gdb) bt
#0  XDisplayKeycodes (dpy=dpy@entry=0x820, 
    min_keycode_return=min_keycode_return@entry=0x555555a73e64, 
    max_keycode_return=max_keycode_return@entry=0x555555a73e68)
    at ../../src/Misc.c:53
#1  0x00007fffefbc5ebc in InitPerDisplay (dpy=dpy@entry=0x820, 
    app=app@entry=0x555555a13a80, name=name@entry=0x7ffff5e14f6f "VTK", 
    classname=0x7ffff5e14f6b "vtk") at ../../src/Display.c:201
#2  0x00007fffefbc63fb in XtDisplayInitialize (app=0x555555a13a80, dpy=0x820, 
    name=0x7ffff5e14f6f "VTK", classname=<optimized out>, urlist=0x0, 
    num_urs=0, argc=0x7fffffffc34c, argv=0x0) at ../../src/Display.c:394
#3  0x00007ffff5dea5dc in vtkXRenderWindowInteractor::Initialize (
    this=0x5555559e7130)
    at /home/loris/Scaricati/vtk-v8.1.0/Rendering/OpenGL2/vtkXRenderWindowInteractor.cxx:329
#4  0x00007ffff2f024c4 in pcl::visualization::PCLVisualizer::createInteractor (
    this=0x555555b2a050) at /usr/local/include/vtk-8.1/vtkSmartPointer.h:128
#5  0x00007ffff2f02f78 in pcl::visualization::PCLVisualizer::PCLVisualizer (
    this=0x555555b2a050, ren=..., wind=..., name="data viewer", 
    create_interactor=<optimized out>)
    at /home/loris/Scaricati/pcl-pointpicking/visualization/src/pcl_visualizer.cpp:202
#6  0x000055555567fd45 in MainWindow::MainWindow() ()
#7  0x00005555555c8240 in main ()
(gdb) frame 5
#5  0x00007ffff2f02f78 in pcl::visualization::PCLVisualizer::PCLVisualizer (
    this=0x555555b2a050, ren=..., wind=..., name="data viewer", 
    create_interactor=<optimized out>)
    at /home/loris/Scaricati/pcl-pointpicking/visualization/src/pcl_visualizer.cpp:202
202     createInteractor ();
(gdb) frame 4
#4  0x00007ffff2f024c4 in pcl::visualization::PCLVisualizer::createInteractor (
    this=0x555555b2a050) at /usr/local/include/vtk-8.1/vtkSmartPointer.h:128
128   T* operator->() const
(gdb) frame 3
#3  0x00007ffff5dea5dc in vtkXRenderWindowInteractor::Initialize (
    this=0x5555559e7130)
    at /home/loris/Scaricati/vtk-v8.1.0/Rendering/OpenGL2/vtkXRenderWindowInteractor.cxx:329
329       XtDisplayInitialize(vtkXRenderWindowInteractor::App,this->DisplayId,

I'm not sure if the problem that causes the segmentation fault is generated whether by pcl visualizer or by vtkXRenderWindowInteractor.

EDIT Solved this issue, see #35.