Feature #764

Replace exit(status); by return status; in triangle.c

Added by Joaquim over 2 years ago. Updated about 1 year ago.

Status:ClosedStart date:2015-09-10
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release


As found by Rick Carlson in http://gmt.soest.hawaii.edu/boards/1/topics/2508 triangle.c in triexit() #L1435 stops abruptly with an exit() command. This blows up external interfaces (e.g. Matlab and Julia) that use the GMT library.


#1 Updated by Joaquim over 2 years ago

  • Tracker changed from Bug to Feature

#2 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

THink I did this a few days ago but did not notice the issue being added.

#3 Updated by Joaquim over 2 years ago

No, I mean really replace exit() by return in triangle.c/triexit() function.
It will not solve anything at the triangle level but it will prevent the blow up of external API that use it.

#4 Updated by Paul over 2 years ago

I know, but the cause was pscontour calling triangle with no data. I now prevent that in pscontour and triangulate, so there really should not be any case where it will call exit, no?

#5 Updated by Joaquim over 2 years ago

As we know now no, but any memory error may trigger the bomb so safer not leave it armed.

#6 Updated by Paul over 2 years ago

I would if it was our code, but rather not make any edit to 3rd party code. Can't we wait to see if there really are any problems? The one Rick found was ours basically.

#7 Updated by Joaquim over 2 years ago

Well, we already fixed that 64 bits problem that triangle has due to its age and would crash MSVC builds on Windows 7 and above.

#8 Updated by Paul about 1 year ago

  • Status changed from Resolved to Closed

Closing this issue.

Also available in: Atom PDF