Segmentation fault (core dumped)

I seem not to be able to start debugging a simple opengl application.

My system:
Graphics: Nvidia GeForce 1060
Driver: 390.48

The application i m trying to debug can be found on: https://github.com/JoeyDeVries/LearnOpenGL

Here is the status log from the debugger launcher:

[Status] Connecting localhost:0 …
[Status] localhost is connected.
[Status] Remote debugger has been installed successfully.
[Status] Detected target device running SHELL /bin/bash

[Status] /home/ilir/coding/cpp/LearnOpenGL/build/bin/1.getting_started/1.getting_started__2.1.hello_triangle is launched.
[Status] Searching processes …
[1.getting_started__2.1.hello_triangle] Segmentation fault (core dumped)
[1.getting_started__2.1.hello_triangle]
[Status] Searching is canceled.
[Status] Target process exits.

Any help or hint very much appreciated

Thnx

Hi ilirkoskija,

Could you please provide more information?

  • OS and its version
  • LGD version
  • detailed reproduce steps

Thanks!

I don’t know if it’s related, but I also have debugged apps segfaulting if they run “too fast” (even glxgears crashes if vertical refresh is disabled).

Try to preload libSegFault.so along with libNvidia_gfx_debugger.so, and attach the debugger to the running app. If it crashes in the nvidia lib and not in your app, perhaps you could try to add a glfwSwapInterval(1) in your app.

It worked in my case.

thanks for your replies guys,

i m running the “NVIDIA Linux Graphics Debugger” version 2.3 on ubuntu 16.04 LTS. Regarding the reproduction steps, i can say that i doing nothing special really, just compiling the code from https://github.com/JoeyDeVries/LearnOpenGL as instructed from the website. Doesnt take longer than 10 min to setup.

These are the steps in detail:

  1. compile the source code like instructed in the link above
  2. start the LGD with this command: sudo ./nvidia-gfx-debugger
  3. select “Linux Desktop (GLX) - x64” in the “Select your target platform” dialog box
  4. in the “Edit Target” fill in only the “IP/Host Name” text field with “localhost”, the “Enable SSH” checkbox is checked and the rest leave blank
  5. clicked “Install Debugger” on he right
  6. in the “Launch” tab select the application to debug

The status log in my first comment was printed after launching the “x64 target platform” debugger. Now after i launch the “x86 target platform” debugger, it starts the executable but it fails to debug it and prints this status log:

[Status] Connecting localhost:0 …
[Status] localhost is connected.
[Status] Remote debugger has been installed successfully.
[Status] Detected target device running SHELL /bin/bash

[Status] /home/ilir/coding/cpp/LearnOpenGL/build/bin/1.getting_started/1.getting_started__2.1.hello_triangle is launched.
[Status] Searching processes …
[1.getting_started__2.1.hello_triangle] ERROR: ld.so: object ‘/home/ilir/.tgd/libs/libNvidia_gfx_debugger.so’ from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[1.getting_started__2.1.hello_triangle] ERROR: ld.so: object ‘/home/ilir/.tgd/libs/libNvidia_gfx_debugger.so’ from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[1.getting_started__2.1.hello_triangle]
[Status] Searching is canceled.
[Status] Target process exits.

Which is, i guess some mismatch between the executable compiled as x64 and the LGD “x86 target platform”. I added the glfwSwapInterval(1) call but it didnt help much.

Hi,

Thanks for the detailed information. I tried your sample from github on my local machine, it works fine.

How did you installed the graphics driver?

Do you get the same issue on other graphics samples? (you can try glxgears, Nvidia Gameworks graphics sample, etc.)

Thanks.

Hi thanks for your effort and time,

I can run the same executable that i m trying to debug without any problem when i start it directly, but the LGC fails to start it.

I installed the latest graphics linux driver 390.48 following the steps described in this link http://www.linuxandubuntu.com/home/how-to-install-latest-nvidia-drivers-in-linux . I tried to install the latest driver myself but it didnt work. The OS was constantly looping in the login screen and i couldnt get past to it. So i used the link above, which seems to be working fine.

Do you think the issue is my driver? if so could you provide me with some link or steps how to install the linux graphics driver 390.48 myself and avoid the login looping ( which seems to be a common issue when installing the latest nvidia driver) ?

How did you actually install your driver? Which driver have you installed and which version of LGD are you using ?

Thanks in advance

Hi,

I followed this https://askubuntu.com/questions/841876/how-to-disable-nouveau-kernel-driver; to install driver.
Additionally, you need to remove existing nvidia driver before installation. The driver should be downloaded from nvidia official site. As the driver from Ubuntu PPA is not officially supported by LGD.
I am using 390.25 driver and LGD 2.3 release.

Hi,
many thanks to codym_nv for his assistence… i finally managed to install a functional LGD by using some of the instructions from codym_ny. i have to stress the fact that actually only driver 390.25 worked.

here are all my steps to the success, but i think some of them (3, 4 and 6) are unnecessary i guess:

  1. installed ubuntu 16.04.4
  2. install all system updates
  3. install the default nvidia driver listed in the “System Settings/Software & Updates”
  4. sudo apt-get install libsoil-dev libglm-dev libassimp-dev libglew-dev libglfw3-dev libxinerama-dev libxcursor-dev libxi-dev
  5. follow the link from codym_nv https://askubuntu.com/questions/841876/how-to-disable-nouveau-kernel-driver
    here are the concrete steps:
    I. sudo apt-get remove nvidia* && sudo apt autoremove
    II. sudo apt-get install dkms build-essential linux-headers-generic
    III. sudo vim /etc/modprobe.d/blacklist.conf
    IV. blacklist nouveau
    blacklist lbm-nouveau
    options nouveau modeset=0
    alias nouveau off
    alias lbm-nouveau off
    V. echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
    VI. sudo update-initramfs -u
    VII. reboot
  6. remove nvidia drivers:
    here are the concrete steps:
    I. sudo apt-get remove --purge nvidia-*
    II. sudo apt-get install ubuntu-desktop
    III. sudo rm /etc/X11/xorg.conf
    IV. echo ‘nouveau’ | sudo tee -a /etc/modules
  7. download Nvidia driver 390.25 (only this worked) from nvidia site.
  8. CTRL + ALT + F1 and login
  9. sudo service lightdm stop
  10. navigate to the downloaded nvidia 390.35 driver and change mode to execuatable
  11. follow the installation steps

Hope this will help others.

p.s. when running the “Linux Graphics Debugger” for the fist time it might complain for missing libs. so i had to install this one: sudo apt-get install libgstreamer-plugins-base0.10-0

Thanks ilirkoskija, it worked for me…