All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robbie Harwood <rharwood@redhat.com>
To: grub-devel@gnu.org
Cc: dkiper@net-space.pl, development@efficientek.com,
	Robbie Harwood <rharwood@redhat.com>
Subject: [PATCH v5 3/4] Drop gnulib no-abort.patch
Date: Wed, 16 Feb 2022 16:41:41 -0500	[thread overview]
Message-ID: <20220216214142.555294-4-rharwood@redhat.com> (raw)
In-Reply-To: <20220216214142.555294-1-rharwood@redhat.com>

Originally added in db7337a3d353a817ffe9eb4a3702120527100be9, this
patched out all relevant invocations of abort() in gnulib.  While it was
not documented why at the time, testing suggests that there's no abort()
implementation available for gnulib to use.

gnulib's position is that the use of abort() is correct here, since it
happens when input violates a "shall" from POSIX.  Additionally, the
code in question is probably not reachable.  Since abort() is more
friendly to user-space, they prefer to make no change, so we can just
carry a define instead.  (Suggested by Paul Eggert.)

Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
 bootstrap.conf                              |  2 +-
 conf/Makefile.extra-dist                    |  1 -
 config.h.in                                 |  3 +++
 grub-core/lib/gnulib-patches/no-abort.patch | 26 ---------------------
 4 files changed, 4 insertions(+), 28 deletions(-)
 delete mode 100644 grub-core/lib/gnulib-patches/no-abort.patch

diff --git a/bootstrap.conf b/bootstrap.conf
index 21a8cf15d..71acbeeb1 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -82,7 +82,7 @@ cp -a INSTALL INSTALL.grub
 bootstrap_post_import_hook () {
   set -e
   for patchname in fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \
-      fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width no-abort; do
+      fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width; do
     patch -d grub-core/lib/gnulib -p2 \
       < "grub-core/lib/gnulib-patches/$patchname.patch"
   done
diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
index 15a9b74e9..4ddc3c8f7 100644
--- a/conf/Makefile.extra-dist
+++ b/conf/Makefile.extra-dist
@@ -35,7 +35,6 @@ EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch
-EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch
 
 EXTRA_DIST += grub-core/lib/libgcrypt
 EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic
diff --git a/config.h.in b/config.h.in
index 682da058b..251bccf0d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -66,4 +66,7 @@
 
 #  define _GL_ATTRIBUTE_CONST __attribute__ ((const))
 
+/* We don't have an abort() for gnulib to call in regexp. */
+#  define abort() DEBUG_ASSERT(0)
+
 #endif
diff --git a/grub-core/lib/gnulib-patches/no-abort.patch b/grub-core/lib/gnulib-patches/no-abort.patch
deleted file mode 100644
index e469c4762..000000000
--- a/grub-core/lib/gnulib-patches/no-abort.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/lib/regcomp.c b/lib/regcomp.c
-index cc85f35ac..de45ebb5c 100644
---- a/lib/regcomp.c
-+++ b/lib/regcomp.c
-@@ -528,9 +528,9 @@ regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf,
-        to this routine.  If we are given anything else, or if other regex
-        code generates an invalid error code, then the program has a bug.
-        Dump core so we can fix it.  */
--    abort ();
--
--  msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
-+    msg = gettext ("unknown regexp error");
-+  else
-+    msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
- 
-   msg_size = strlen (msg) + 1; /* Includes the null.  */
- 
-@@ -1136,7 +1136,7 @@ optimize_utf8 (re_dfa_t *dfa)
- 	}
- 	break;
-       default:
--	abort ();
-+	break;
-       }
- 
-   if (mb_chars || has_period)
-- 
2.34.1



  parent reply	other threads:[~2022-02-16 21:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 21:41 [PATCH v5 0/4] Update gnulib and drop some patches Robbie Harwood
2022-02-16 21:41 ` [PATCH v5 1/4] Use visual indentation in config.h.in Robbie Harwood
2022-02-16 21:41 ` [PATCH v5 2/4] Drop gnulib fix-base64.patch Robbie Harwood
2022-02-16 21:41 ` Robbie Harwood [this message]
2022-02-16 21:41 ` [PATCH v5 4/4] Update gnulib version and drop most gnulib patches Robbie Harwood
2022-02-18 16:03 ` [PATCH v5 0/4] Update gnulib and drop some patches Glenn Washburn
2022-02-22 15:21 ` Daniel Kiper
2022-02-22 16:44   ` Robbie Harwood
2022-02-22 17:17     ` Daniel Kiper
2022-02-22 17:35       ` Robbie Harwood
2022-02-24 17:28         ` Daniel Kiper
2022-02-24 19:43           ` Robbie Harwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220216214142.555294-4-rharwood@redhat.com \
    --to=rharwood@redhat.com \
    --cc=development@efficientek.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.