Brian Fallik created THRIFT-1689:
------------------------------------
Summary: don't exit(-1) in TNonblockingServer
Key: THRIFT-1689
URL: https://issues.apache.org/jira/browse/THRIFT-1689
Project: Thrift
Issue Type: Bug
Components: C++ - Library
Affects Versions: 0.8
Reporter: Brian Fallik
Priority: Minor
Fix For: 0.9
TNonblockingServer calls exit(-1) when it encounters a std::bad_alloc
exception. The -1 argument to exit() is problematic. Programs typically use
non-zero exit codes since negative values are reserved for signals. On
somewhat modern Linux (CentOS 6.0), exit(-1) causes the process to yield return
code 255. which BASH claims is out of range:
http://tldp.org/LDP/abs/html/exitcodes.html
I don't see any advantage to exit(-1) in this case. If the intent is to exit
with an error indication, 1 (or the EXIT_FAILURE macro) should do fine. If the
intent is to signal program termination, possibly with a stack trace, abrt()
would be better.
Attached is a patch for the simplest change from '-1' to '1'.
Thanks.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira