NjmonForLinuxDebugging

Note: njmon in debug mode CAN NOT be used with the njmon Collector or the njmon Injector

OK, so this is very unlikely :-)

So in the rare case, try this and return the data to me.

Below I had to add code to crash njmon, hence assigning 42 to a null pointer at line 2247.

If you compiled njmon yourself then remember to use the -g compile option.

$ gdb njmon
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git

BLAH BLAH BLAH

For help, type "help".
Reading symbols from njmon...done.
(gdb) run -d -s1 -c100 >output.json
Starting program: /home/nag/njmoncode/njmondebug -d -s1 -c100 >output.json
. . .
. . .
Program received signal SIGSEGV, Segmentation fault.
main (argc=<optimised out>, argv=0x7fffffffe4d8) at njmon_linux_v19.c:2247
2247            *crashptr = 42;

(gdb) where full
#0  main (argc=<optimised out>, argv=0x7fffffffe4d8) at njmon_linux_v19.c:2247
. . .
- lots of variables here
. . .
(gdb) quit