bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined behavior in closeout, aggravated by libsigsegv


From: Eric Blake
Subject: Re: undefined behavior in closeout, aggravated by libsigsegv
Date: Tue, 24 Nov 2009 16:47:35 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> This example flushes out the libsigsegv interaction for both cygwin 1.5 and 
> today's CVS cygwin 1.7.

Given that I have proven a case where cygwin relies on internal fault handling 
for more than just EFAULT, and that correct program behavior is broken if 
libsigsegv built without --enable-EFAULT interferes, how about this patch?


From: Eric Blake <address@hidden>
Date: Tue, 24 Nov 2009 09:35:41 -0700
Subject: [PATCH] Flip default of --enable-EFAULT.

* configure.ac: Default --enable-EFAULT to on.
* README: Tweak wording accordingly.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    |    6 ++++++
 README       |    8 ++++----
 configure.ac |    2 +-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2eb27a6..5892dec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-24  Eric Blake  <address@hidden>
+
+       Flip default of --enable-EFAULT.
+       * configure.ac: Default --enable-EFAULT to on.
+       * README: Tweak wording accordingly.
+
 2009-11-21  Eric Blake  <address@hidden>
             Bruno Haible  <address@hidden>

diff --git a/README b/README
index 86671eb..06db747 100644
--- a/README
+++ b/README
@@ -119,10 +119,10 @@ Installation instructions on Woe32:

 Configuration options:

-  - If the option --enable-EFAULT is given, libsigsegv will try to arrange
-    that passing invalid memory adresses to system calls (such as read(),
-    write(), etc.) makes the system call fail with errno = EFAULT, rather than
-    invoking the signal handler. POSIX does not specify the behaviour of
+  - If the option --disable-EFAULT is given, libsigsegv will try to intercept
+    invalid memory adresses to system calls (such as read(), write(), etc.)
+    and invoke a handler, even if the system call would otherwise fail with
+    errno = EFAULT with no signal. POSIX does not specify the behaviour of
     system calls in this case (see
     <http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html>,
     under "[EFAULT]" and under "Memory Protection"). Therefore correct
diff --git a/configure.ac b/configure.ac
index 20380b8..3c75949 100644
--- a/configure.ac
+++ b/configure.ac
@@ -946,7 +946,7 @@ AC_ARG_ENABLE([EFAULT],
      enable_EFAULT=no
    fi
   ],
-  [enable_EFAULT=no])
+  [enable_EFAULT=yes])
 AC_MSG_RESULT([$enable_EFAULT])
 if test $enable_EFAULT = yes; then
   AC_DEFINE([ENABLE_EFAULT], [1],
-- 
1.6.4.2








reply via email to

[Prev in Thread] Current Thread [Next in Thread]