[ovs-git] Open vSwitch: util: Make out_of_memory() call abort() instead of exit(EXIT_FAILURE). (master)

dev at openvswitch.org dev at openvswitch.org
Thu Feb 24 00:44:29 UTC 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  c1c8308a3971526f5126201a6d1659c9247c1f0a (commit)
      from  1883ed0f727bd10f0b8b6b80832029c349138595 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c1c8308a3971526f5126201a6d1659c9247c1f0a
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=c1c8308a3971526f5126201a6d1659c9247c1f0a
Author: Ben Pfaff <blp at nicira.com>
		
util: Make out_of_memory() call abort() instead of exit(EXIT_FAILURE).
		
exit(EXIT_FAILURE) will make a monitoring process (the one created by
--monitor) think that it should exit.  But the most likely reason for
out_of_memory() to be called is a bug: probably, the process is trying
to allocate more memory than there is available address space, e.g.
something like malloc(-1).  So it's better, in my opinion, to call abort()
instead, so that the monitor process restarts the daemon and we are more
likely to stay alive and, in addition, get a core dump and a useful bug
report.

I decided to implement a new general-purpose function for this purpose in
case we run into other similar situations in the future.

(I haven't actually run into this problem in practice.  This commit is
just speculation about what is better behavior.)


-----------------------------------------------------------------------

Summary of changes:
 lib/util.c |   55 ++++++++++++++++++++++++++++++++++++++++++++++---------
 lib/util.h |    4 ++++
 2 files changed, 50 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
Open vSwitch




More information about the git mailing list