Bug #653

gmtmath: sigfault in column math

Added by Eduardo over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:2014-12-01
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:

Description

In 5.2.0_r13772 this fails:

echo '1 2 3 4' | gmt gmtmath STDIN -C0 0 MUL 1 COL 10 MUL ADD 2 COL SUB =
ERROR: Caught signal number 11 (Segmentation fault) at
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(table_COL+0xc9)[0xb756e659]
[0x28]
Stack backtrace:
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(sig_handler+0x13b)[0xb741986b]
linux-gate.so.1(__kernel_rt_sigreturn+0x0)[0xb77b6d34]
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(table_COL+0xc9)[0xb756e659]
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(GMT_gmtmath+0x120f)[0xb75734af]
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(GMT_Call_Module+0xee)[0xb741d8de]
gmt(main+0x347)[0x8048c57]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf3)[0xb629fa63]
gmt[0x8048fd4]

valgrind says:
echo '1 2 3 4' | valgrind gmt gmtmath STDIN -C0 0 MUL 1 COL 10 MUL ADD 2 COL SUB =
==26930== Memcheck, a memory error detector
==26930== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==26930== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==26930== Command: gmt gmtmath STDIN -C0 0 MUL 1 COL 10 MUL ADD 2 COL SUB =
==26930== 
==26930== Invalid read of size 4
==26930==    at 0x41BE659: table_COL (gmtmath.c:1081)
==26930==    by 0x41C34AE: GMT_gmtmath (gmtmath.c:3940)
==26930==    by 0x406D8DD: GMT_Call_Module (gmt_api.c:6009)
==26930==    by 0x8048C56: main (gmt.c:194)
==26930==  Address 0x28 is not stack'd, malloc'd or (recently) free'd
==26930== 
ERROR: Caught signal number 11 (Segmentation fault) at
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(table_COL+0xc9)[0x41be659]
[0x28]
Stack backtrace:
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(sig_handler+0x13b)[0x406986b]
/lib/i386-linux-gnu/i686/cmov/libpthread.so.0(+0xecd0)[0x53abcd0]
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(table_COL+0xc9)[0x41be659]
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(GMT_gmtmath+0x120f)[0x41c34af]
/opt/apps/GMT/GMT-5.2.0-testing/bin/../lib/libgmt.so.5(GMT_Call_Module+0xee)[0x406d8de]
gmt(main+0x347)[0x8048c57]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf3)[0x53d2a63]
gmt[0x8048fd4]
==26930== 
==26930== HEAP SUMMARY:
==26930==     in use at exit: 69,047,585 bytes in 1,763 blocks
==26930==   total heap usage: 3,110 allocs, 1,347 frees, 69,367,355 bytes allocated
==26930== 
==26930== LEAK SUMMARY:
==26930==    definitely lost: 0 bytes in 0 blocks
==26930==    indirectly lost: 0 bytes in 0 blocks
==26930==      possibly lost: 0 bytes in 0 blocks
==26930==    still reachable: 69,047,585 bytes in 1,763 blocks
==26930==         suppressed: 0 bytes in 0 blocks
==26930== Rerun with --leak-check=full to see details of leaked memory
==26930== 
==26930== For counts of detected and suppressed errors, rerun with: -v
==26930== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Associated revisions

Revision 13776
Added by Paul over 2 years ago

Address issue #653

History

#1 Updated by Paul over 2 years ago

  • Status changed from New to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

Fixed in r13776.

#2 Updated by Eduardo over 2 years ago

Works for me. Close!

#3 Updated by Paul over 2 years ago

  • Status changed from Resolved to Closed

Closing as requested.

Also available in: Atom PDF