PR# 13759 Routine `eiffel_signal_handler' should save and restore errno

Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Medium
Date: 2007/12/13
Class: Bug
Severity: Serious
Number: 13759
Release: 6.1.71498
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.0.7) Gecko/20060915 Firefox/1.5.0.7 Solaris 9 on SPARC
Synopsis: Routine `eiffel_signal_handler' should save and restore errno

Description
Unless you can guarantee that there cannot possibly be any calls to
routines that set errno from within routine `eiffel_signal_handler' in sig.c,
this routine should save errno and then restore it before it returns (all paths).
If it doesn't return, it doesn't matter.

Without this change, if a routine executed from within a signal handler
ever calls anything that can fail and set errno and the signal handler
returns, errno can be changed unexpectedly from the point of view of the
routine which was executing when the signal was delivered.
This could lead to some hard to reproduce and hard to find bugs if
the unexpected change to errno occurred after a call to a routine that
failed and set errno, but before errno was tested.


To Reproduce

										
Problem Report Interactions