pscoast crashed with SIGSEGV in _int_free()

Bug #1349718 reported by Anders Kaseorg on 2014-07-29
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gmt (Debian)
Fix Released
Unknown
gmt (Ubuntu)
Medium
Unassigned

Bug Description

pscoast crashes on every run.

$ /usr/lib/gmt/bin/pscoast -Rg -JH0/6i -Glightgray > /dev/null
*** Error in `/usr/lib/gmt/bin/pscoast': double free or corruption (!prev): 0x00000000007830b0 ***
Aborted (core dumped)

ProblemType: Crash
DistroRelease: Ubuntu 14.10
Package: gmt 4.5.12-1
ProcVersionSignature: Ubuntu 3.16.0-5.10-generic 3.16.0-rc6
Uname: Linux 3.16.0-5-generic x86_64
NonfreeKernelModules: openafs
ApportVersion: 2.14.4-0ubuntu2
Architecture: amd64
CurrentDesktop: GNOME
Date: Tue Jul 29 03:49:06 2014
EcryptfsInUse: Yes
ExecutablePath: /usr/lib/gmt/bin/pscoast
InstallationDate: Installed on 2010-12-05 (1331 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20101202)
ProcCmdline: pscoast -Rg -JH0/6i -x0.25i -y0.5i -O -K -Bg30 -Dc -Glightgray
SegvAnalysis:
 Segfault happened at: 0x7f0c6101f02d <_int_free+445>: cmp 0x18(%rax),%rbx
 PC (0x7f0c6101f02d) ok
 source "0x18(%rax)" (0x404e000000000018) not located in a known VMA region (needed readable region)!
 destination "%rbx" ok
SegvReason: reading unknown VMA
Signal: 11
SourcePackage: gmt
StacktraceTop:
 _int_free (av=0x7f0c6135e760 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3987
 GMT_graticule_path () from /usr/lib/libgmt.so.4
 GMT_assemble_shore () from /usr/lib/libgmt.so.4
 ?? ()
 __libc_start_main (main=0x402110, argc=10, argv=0x7fff2580d128, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff2580d118) at libc-start.c:287
Title: pscoast crashed with SIGSEGV in _int_free()
UpgradeStatus: Upgraded to utopic on 2013-10-31 (270 days ago)
UserGroups: adm admin bumblebee cdrom dialout fuse kvm libvirtd lpadmin plugdev sambashare sudo wireshark

Anders Kaseorg (andersk) wrote :

StacktraceTop:
 _int_free (av=0x7f0c6135e760 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3987
 GMT_graticule_path () from /tmp/apport_sandbox_NOsZFA/usr/lib/libgmt.so.4
 GMT_assemble_shore () from /tmp/apport_sandbox_NOsZFA/usr/lib/libgmt.so.4
 ?? ()
 __libc_start_main (main=0x402110, argc=10, argv=0x7fff2580d128, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff2580d118) at libc-start.c:287

Changed in gmt (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Anders Kaseorg (andersk) on 2014-07-29
information type: Private → Public
hamish (hamish-b) wrote :

Hi,

as a wild guess, I suspect the trouble is the version of the GSHHS coastline supplied by gmt-coast-low package is out of sync with the upstream version of gmt. I seem to recall a couple months ago downloading the latest coastlines by hand and then it was ok; check the MB-System @ mbari mailing list archives?

can you try the gmt-gshhs-low package instead of gmt-coast-low? (for me it doesn't help in 14.04)

for me it doesn't run out of memory, just cycles the CPU at 100% forever, with some warnings:
[with gmt examples package installed]
"""
$ cp -r /usr/share/doc/gmt-examples/examples/ gmt-examples
cd gmt-examples/
./do_examples.csh

Running examples with executables from /usr/lib/gmt/bin
Doing example ex01/job01.csh ... GMT Fatal Error: GMT_lonpath requesting negative n_items (-2147483647) - exceeding 32-bit counting?
grdcontour: GMT_non_zero_winding given non-closed polygon
grdcontour: GMT_non_zero_winding given non-closed polygon
"""

Hamish

hamish (hamish-b) wrote :

actually I remember a bit better now what I did a couple months ago, it was trying to install newer versions of the GSHHS coastline in /usr/share/gmt/coast/ on Lucid, which caused similar trouble. The reason was the download script which used to be supplied linked to ftp sites which no longer had the right data. The solution that time was to copy the data over and do the plotting step in 12.04.

and to clarify the error messages above, it's on 14.04 & I have pscoast running forever at 100% cpu. I installed gmt-gshhs-full and -high in addition to -low. But it always happens, even with -low.

Hamish

hamish (hamish-b) wrote :

see also launchpad bug #379105

hamish (hamish-b) wrote :

see also http://gmt.soest.hawaii.edu/boards/1/topics/730
and http://thread.gmane.org/gmane.comp.gis.gmt.user/21512

seems to be a new and common problem starting with 14.04. The next thing is to check if it's working in debian/sid or not.

thanks,
Hamish

hamish (hamish-b) wrote :
Download full text (12.1 KiB)

updating to the latest versions of the data files (2.3.2) does not help.

http://www.soest.hawaii.edu/pwessel/gshhg/
http://www.soest.hawaii.edu/pwessel/gshhg/gshhg-gmt-2.3.2.tar.gz

filed as Debian bug # 758685
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758685

recompiling the source package with -g -O0 & no dh_strip gives this backtrace:

*** Error in `/usr/lib/gmt/bin/pscoast': double free or corruption (!prev): 0x0000000000688a50 ***

Program received signal SIGABRT, Aborted.
0x00007ffff6c81407 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007ffff6c81407 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff6c827e8 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff6cbf344 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff6cc4b1e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff6cc5826 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007ffff7919449 in GMT_free (addr=0x688a50) at gmt_support.c:2634
#6 0x00007ffff78d427c in GMT_graticule_path (x=0x686470, y=0x686478, dir=1, w=310, e=320, s=70, n=80) at gmt_map.c:4475
#7 0x00007ffff790179e in GMT_assemble_shore (c=0x7fffffff17c0, dir=1, assemble=1, shift=0, west=-180, east=180, pol=0x7fffffff1478)
    at gmt_shore.c:667
#8 0x0000000000405ca7 in main (argc=5, argv=0x7fffffffe148) at pscoast.c:774

(gdb) bt full
#0 0x00007ffff6c81407 in raise () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00007ffff6c827e8 in abort () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2 0x00007ffff6cbf344 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3 0x00007ffff6cc4b1e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4 0x00007ffff6cc5826 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#5 0x00007ffff7919449 in GMT_free (addr=0x688a50) at gmt_support.c:2634
No locals.
#6 0x00007ffff78d427c in GMT_graticule_path (x=0x686470, y=0x686478, dir=1, w=310, e=320, s=70, n=80) at gmt_map.c:4475
        xtmp = 0x688a50
        ytmp = 0x694d00
        add = 0
        n_alloc = 6174
        np = 40
        xx = 0x694db0
        yy = 0x688b00
        px0 = 310
        px1 = 320
        px2 = 320
        px3 = 310
#7 0x00007ffff790179e in GMT_assemble_shore (c=0x7fffffff17c0, dir=1, assemble=1, shift=0, west=-180, east=180, pol=0x7fffffff1478)
    at gmt_shore.c:667
        p = 0x686450
        start_side = 140737488294800
        next_side = 0
        id = 0
        P = 0
        more = -4577451624384954368
        p_alloc = 1
        wet_or_dry = 1
        use_this_level = 1
        high_seg_level = 1
        n_alloc = 0
        cid = 67
        nid = 114224
        add = 0
        first_pos = 140737334367632
        entry_pos = 4294967296
        n = 0
        low_level = 4
        high_level = 1
        fid = 140737353955136
        nseg_at_level = {0, 0, 0, 0, 0}
        completely_inside = 1
        xtmp = 0x0
        ytmp = 0x0
        plon = 6.9533558074342183e-310
        plat = 2.0764195710899237e-317
#8 0x0000000000405ca7 in main (argc=5, argv=0x7fffffffe148) at pscoast.c:774
        ...

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gmt (Ubuntu):
status: New → Confirmed
Changed in gmt (Debian):
status: Unknown → New

same issue on brand new install:
3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

/usr/lib/gmt/bin/pscoast -Rg -JH0/6i -Glightgray > /dev/null
*** Error in `/usr/lib/gmt/bin/pscoast': double free or corruption (!prev): 0x0000000001bcec60 ***
Aborted (core dumped)

I removed gmt-coast-low and added gmt-gshhs-low but he result is the same.

Changed in gmt (Debian):
status: New → Fix Released
Bas Couwenberg (sebastic) wrote :

This has been fixed in GMT 5, available in wily and later.

Changed in gmt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.