You should generate a core file and analyze it with gdb. Make sure your core file limit is unlimited by running ulimit -c unlimited before you execute your binary. Once the core file is generated, analyze it by running gdb ./a.out <corefilename>. Once you see the gdb prompt, you may issue the command where or bt to print a backtrace. If you cut and paste the output, we can help you analyze it.
# gdb ./a.out core
GNU gdb (Debian 8.1-4+b1) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...done.
[New LWP 5789]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./a.out'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000000000 in ?? ()
(gdb)
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x000055aa9fa7e5db in openrm (host=0x55aa9fa7f004 "debian", port=15002)
at rm.c:177
#2 0x000055aa9fa7e1ea in main () at test.c:7
It did solve SIGSEGV problem
One thing i should comment is that we can only use <source_code_location>/src/include to find rpp.h rather than <INSTALL_PREFIX>/include, as there is no rpp.h , but link to libpbs.so is vaild.
it’s good to hear we have pre-builded pbs_rmget command, however, this is a practice for myself just for fun :).
Right, there is scope for improvement here. I think openrm should call this function internally to setup rpp functions if they are not set already. A user writing a program using rm library APIs should not do that.