Bug #906

Segmentation fault with -i option, then requested column is absent

Added by Michael over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:2016-05-15
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.2-svn Platform:


I check this on psxy, but think other programs also affected
echo "1 2"| /home/michael/tmp/gmt5/bin/gmt psxy -i0,3 -JX10c -R0/1/0/1 >/dev/null
ERROR: Caught signal number 11 (Segmentation fault) at
Stack backtrace:

This is a bug.

Interpretation of absent data as NaN can be added as a feature, because some data files have variable number of columns. This often happens in files created from Excel datasheets.


#1 Updated by Joaquim over 5 years ago

  • Status changed from New to In Progress

It is a bug because it crashes instead of being catch as an user error.

#2 Updated by Paul over 5 years ago

  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release

Reasonable behavior here should be an error when requested columns exceed number of input columns. Note that this number is known when binary tables are used but unknown for ASCII until we read the data. So it will be necessary to throw an error deep in the belly of GMT. I will see how this should be done.

#3 Updated by Michael over 5 years ago

ASCII files can contains a different number of columns in each row. In some cases more useful to interpret absent data in some of rows as NaN (or other value) instead of throw error. May be some flag to -i option?

#4 Updated by Paul over 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

For now I am mostly concerned with stopping execution if inadequate data or options have been applied. Thus, r16447 has added checks in programs that read tables. The record-by-record programs usually catch this problem as they process the records. GMT does not really handle variable-length data records as they do not match our paradigm.

#5 Updated by Paul over 5 years ago

  • Status changed from Resolved to Closed

Closed as fixed - reopen if there are other problems related to this.

Also available in: Atom PDF