GMT6 install problems

I’m having problems installing 6.0.0 on ubuntu 18.04 (linuxmint 19.3). Installed all supporting packages AKAIK.

Problems 1:

cmake … command in build directory gave no errors, nor did make and make install.

But when I type “gmt” I get this:

/usr/local/src/gmt/gmt-6.0.0/build % gmt
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x13)[0x14b43a147da3]
[0x0]
Stack backtrace:
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig_handler+0x2b1)[0x14b43a0dc921]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x14b439e96890]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x13)[0x14b43a147da3]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x153379)[0x14b43a1f6379]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_begin+0x2e)[0x14b43a1f6fce]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT_Create_Session+0x1cd)[0x14b43a0ec7cd]
gmt(main+0xa0e)[0x5643483d796e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x14b439ab4b97]
gmt(_start+0x2a)[0x5643483d7eaa]

Problem 2:

typing “make docs_man” goes ok, then this:

.
.
.
[ 43%] Built target gmt
Scanning dependencies of target gmt_for_img_convert
[ 43%] Built target gmt_for_img_convert
Scanning dependencies of target _docs_html_scripts_fig
[ 43%] Generating …/rst/_source/_images/GMT_App_M_2.png
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x13)[0x14e391d42da3]
[0x0]
Stack backtrace:
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig_handler+0x2b1)[0x14e391cd7921]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x14e391a91890]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x13)[0x14e391d42da3]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x153379)[0x14e391df1379]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_begin+0x2e)[0x14e391df1fce]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT_Create_Session+0x1cd)[0x14e391ce77cd]
/usr/local/src/gmt/gmt-6.0.0/build/./src/gmt(main+0x14f)[0x558baa6630af]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x14e3916afb97]
/usr/local/src/gmt/gmt-6.0.0/build/./src/gmt(_start+0x2a)[0x558baa663eaa]
doc/scripts/CMakeFiles/_docs_html_scripts_fig.dir/build.make:206: recipe for target ‘doc/rst/_source/_images/GMT_App_M_2.png’ failed
make[3]: *** [doc/rst/_source/_images/GMT_App_M_2.png] Error 1
CMakeFiles/Makefile2:1168: recipe for target ‘doc/scripts/CMakeFiles/_docs_html_scripts_fig.dir/all’ failed
make[2]: *** [doc/scripts/CMakeFiles/_docs_html_scripts_fig.dir/all] Error 2
CMakeFiles/Makefile2:1074: recipe for target ‘doc/rst/CMakeFiles/docs_man.dir/rule’ failed
make[1]: *** [doc/rst/CMakeFiles/docs_man.dir/rule] Error 2
Makefile:446: recipe for target ‘docs_man’ failed
make: *** [docs_man] Error 2

I’ve built many gmt versions, never had these problems before.

All seems to start a libpthread but that’s strange because I don’t remember that GMT is using pthreads. It does optionally use gthreads. Try adding -DGMT_USE_THREADS=FALSE to the cmake build line.

In build directory tried cmake -DGMT_USE_THREADS=FALSE … ; make; make install, then …/bin/gmt

same result. Tried uncommenting the “set (GMT_USE_THREADS TRUE)” in the cmake config file, no difference.

Built version 5.4.5 successfully, no problems.

There is a post with similar error messages. Maybe caused by the same reason? BTW, can you run gmt -Vd and post the full debug messages?

Here’s the output from gmt -Vd. (tried uploading the text file, the reply window only accepts image files). I looked at the post you recommended, but don’t see anything to try. But looks like it can’t find something it needs.

/usr/local/src/gmt/gmt-6.0.0/bin % ./gmt -Vd
gmt [DEBUG]: Obtained the ppid from parent: 32003
gmt [DEBUG]: Enter: gmtinit_new_GMT_ctrl
gmt [DEBUG]: GMT->session.SHAREDIR = /usr/local/src/gmt/gmt-6.0.0/share
gmt [DEBUG]: GMT->session.HOMEDIR = /home/roland
gmt [DEBUG]: GMT->session.USERDIR = /home/roland/.gmt [created]
gmt [DEBUG]: GMT->session.CACHEDIR = /home/roland/.gmt/cache [created]
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x13)[0x1456eb717da3]
[0x0]
Stack backtrace:
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig_handler+0x2b1)[0x1456eb6ac921]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x1456eb466890]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x13)[0x1456eb717da3]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x153379)[0x1456eb7c6379]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_begin+0x2e)[0x1456eb7c6fce]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT_Create_Session+0x1cd)[0x1456eb6bc7cd]
./gmt(main+0x14f)[0x5564f1b4b0af]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x1456eb084b97]
./gmt(_start+0x2a)[0x5564f1b4beaa]

Do you know how to debug with a debugger? Otherwise I’m afraid it’s going to be difficult because we need to able to reproduce the problem.

Can you try this? In gmt_io.c find the function gmt_replace_backslash_in_path() (about line 8752) and add this before the while (dir[k]) line

if (dir == NULL) {
     fprintf (stderr, "Caller name: %pS\n", __builtin_return_address(0));
}

If it works, it won’t avoid the crash but maybe will point us to the right direction

Tried that- here’s what I get:

/usr/local/src/gmt/gmt-6.0.0/bin % gmt
Caller name: 0x145c70fc23a9S
ERROR: Caught signal number 11 (Segmentation fault) at
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x1b)[0x145c70f13dab]
[0x0]
Stack backtrace:
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(sig_handler+0x2b1)[0x145c70ea8921]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x145c70c62890]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_replace_backslash_in_path+0x1b)[0x145c70f13dab]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(+0x1533a9)[0x145c70fc23a9]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(gmt_begin+0x2e)[0x145c70fc2ffe]
/usr/local/src/gmt/gmt-6.0.0/lib/libgmt.so.6(GMT_Create_Session+0x1cd)[0x145c70eb87cd]
gmt(main+0xa0e)[0x55b55ae2196e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x145c70880b97]
gmt(_start+0x2a)[0x55b55ae21eaa]
/

Damn it. That’s not what I was expecting to see. An hex address tell us nothing. It’s the function’s name that we need.

I think you just need to print the string __SOURCE_LINE_FUNC