While investigating problems related to a sudden termination of the session, the Support Team could request to run the GDB debugger in the user's environment to examine what happened when the program terminated.
Prerequisite: the system is configured to generate core files.
Many Linux distributions (e.g. RHEL/CentOS) have it disabled by default. Ensure to turn on the creation of core files.
The following instructions should help in most cases, but we recommend to consult the official documentation of your Linux.
Edit the /etc/profile file and change the ulimit line as it follows:
ulimit -c unlimited >/dev/null 2>&1
Edit the /etc/sysctl.conf file and add the following lines to the end of the file:
kernel.core_uses_pid = 1
kernel.core_pattern = /tmp/core-%e--%u-%g-%p-%t
fs.suid_dumpable = 2
Reproduce the problem and proceed to analyze the core dump with GDB as explained below.
Run GDB with NoMachine
1. Install GDB if is it's not already installed: http://www.gnu.org/software/gdb/
2. Verify if a core file has been generated on the remote machine where you are connecting to and identify which program created it:
sudo gdb -c PATH_TO_CORE_FILE
The first line of its output provides information about the binary, for example:
sudo gdb -c /usr/NX/etc/core.1111
Core was generated by `/usr/NX/bin/nxserver.bin --daemon
In case of NoMachine, the core file can be generated by:
nxnode.bin
nxserver.bin
nxclient.bin
nxplayer.bin
3. If there is a core file, run GDB as root or as sudo user by specifying the binary that generated it:
gdb -core=<path_to_core_file> -se=/usr/NX/bin/nxnode.bin
or:
gdb -core=<path_to_core_file> -se=/usr/NX/bin/nxserver.bin
or:
gdb -core=<path_to_core_file> -se=/usr/NX/bin/nxclient.bin
or:
gdb -core=<path_to_core_file> -se=/usr/NX/bin/nxplayer.bin
4. in the GDB command line type:
set height 0
set logging file /tmp/NoMachineBacktrace.txt
set logging on
thr apply all bt
5. Send the /tmp/NoMachineBacktrace.txt file to the Support Team.