bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: "bug-gnulib@gnu.org List" <bug-gnulib@gnu.org>
Subject: [PATCH] stdlib: avoid canonicalize_file_name contradiction
Date: Sat, 4 Jan 2020 22:24:53 -0800	[thread overview]
Message-ID: <CA+8g5KGoCEJ=gohDCR=UOHGHDy4fodC6yR7ny-Fz5tJEBOAUFA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

I expect to push something like the attached tomorrow:

stdlib: avoid canonicalize_file_name contradiction
* lib/stdlib.in.h (canonicalize_file_name): Remove the nonnull
attribute from its declaration. tests/test-canonicalize-lgpl.c
passes null_ptr () to it, which (via this contradiction) would
provoke a segfault from GCC 10. See a small reproducer and
discussion in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156

[-- Attachment #2: canonicalize_file_name-nonnull-vs-gcc10-segfault.diff --]
[-- Type: application/octet-stream, Size: 2276 bytes --]

From 0f7cfbf5c2b3403effc5910f57f420b58ed91330 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Sat, 4 Jan 2020 22:21:17 -0800
Subject: [PATCH] stdlib: avoid canonicalize_file_name contradiction

* lib/stdlib.in.h (canonicalize_file_name): Remove the nonnull
attribute from its declaration. tests/test-canonicalize-lgpl.c
passes null_ptr () to it, which (via this contradiction) would
provoke a segfault from GCC 10. See a small reproducer and
discussion in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156
---
 ChangeLog       | 9 +++++++++
 lib/stdlib.in.h | 6 ++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6d9ea9e52..730f53727 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-01-04  Jim Meyering  <meyering@fb.com>
+
+	stdlib: avoid canonicalize_file_name contradiction
+	* lib/stdlib.in.h (canonicalize_file_name): Remove the nonnull
+	attribute from its declaration. tests/test-canonicalize-lgpl.c
+	passes null_ptr () to it, which (via this contradiction) would
+	provoke a segfault from GCC 10. See a small reproducer and
+	discussion in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156
+
 2020-01-04  Bruno Haible  <bruno@clisp.org>

 	mbsnrtoc32s: Add tests.
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index e088959b2..938ec37b1 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -191,13 +191,11 @@ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define canonicalize_file_name rpl_canonicalize_file_name
 #  endif
-_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
-                                                  _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name));
 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
 # else
 #  if !@HAVE_CANONICALIZE_FILE_NAME@
-_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
-                                                  _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name));
 #  endif
 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
 # endif
-- 
2.24.0.390.g083378cc35


             reply	other threads:[~2020-01-05  6:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-05  6:24 Jim Meyering [this message]
2020-01-05  8:15 ` [PATCH] stdlib: avoid canonicalize_file_name contradiction Bruno Haible
2020-01-05 16:41   ` Jim Meyering
2020-01-05 16:46     ` Jim Meyering
2020-01-05 20:46     ` Bruno Haible
2020-01-05 21:52       ` Jim Meyering
2020-01-05 22:57         ` Bruno Haible

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to='CA+8g5KGoCEJ=gohDCR=UOHGHDy4fodC6yR7ny-Fz5tJEBOAUFA@mail.gmail.com' \
    --to=jim@meyering.net \
    --cc=bug-gnulib@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).