NoMachine Support

Your questions answered

Knowledge Base

Searching in: Articles & FAQs
Filter the search results
Applies to:
Last update:
Searching in: Articles & FAQs
ID: AR09L00810
Applies to: NoMachine Software
Added on: 2014-09-19
Last update: 2021-01-27
Using GDB to debug a core file on Linux

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:

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:

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

gdb  -core=<path_to_core_file>  -se=/usr/NX/bin/nxserver.bin

gdb  -core=<path_to_core_file>  -se=/usr/NX/bin/nxclient.bin

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.