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: 2018-03-06
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: http://www.gnu.org/software/gdb/

2. Verify if a core file has been generated on the remote machine where you are connecting to.

3. If there is a core file, run GDB as root or as sudo user:

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

4. in the GDB command line type:

  set height 0
  set logging file /tmp/nodeBacktrace.log
  set logging on
  thr apply all bt

5. Send the /tmp/nodeBacktrace.log to the Support Team.

 

Note

If the core file has been generated by nxserver.bin, nxclient.bin or nxplayer.bin, replace command at point 3. with any of the following:

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