Santiago Vila <sanv...@debian.org> writes:

> Hello.
>
> I updated the Debian package for m4 and now it does not build ok in
> alpha and hppa (Linux in both cases).
>
> This is what happens in alpha:
>
> -------------------------------------------------------------------------
> gcc -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../lib -DIN_M4_GNULIB_TESTS=1
> -I. -I. -I.. -I./.. -I../lib -I./../lib -Wdate-time
> -D_FORTIFY_SOURCE=2 -mieee -Wno-error -Wno-cast-qual -Wno-conversion
> -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function
> -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough
> -Wno-pedantic -Wno-sign-conversion -Wno-type-limits
> -Wno-unused-const-variable -Wno-unsuffixed-float-constants -g -O2
> -Werror=implicit-function-declaration
> -ffile-prefix-map=/build/reproducible-path/m4-1.4.20=. -c -o
> test-sys_stat-h.o test-sys_stat-h.c
> In file included from test-sys_stat-h.c:19:
> ../lib/config.h:4125:25: error: static assertion failed
>  4125 |   #define static_assert _Static_assert
>       |                         ^~~~~~~~~~~~~~
> test-sys_stat-h.c:343:1: note: in expansion of macro 'static_assert'
>   343 | static_assert (TYPE_SIGNED (blksize_t));
>       | ^~~~~~~~~~~~~
> ../lib/config.h:4125:25: error: static assertion failed
>  4125 |   #define static_assert _Static_assert
>       |                         ^~~~~~~~~~~~~~
> test-sys_stat-h.c:348:1: note: in expansion of macro 'static_assert'
>   348 | static_assert (TYPE_SIGNED (blkcnt_t));
>       | ^~~~~~~~~~~~~
> -------------------------------------------------------------------------

Hi Santiago, thank you for the detailed report.

I am CC'ing bug-gnu...@gnu.org since this file is imported from
there. This actually seems like a glibc bug uncovered by the Gnulib test
suite. POSIX requires that blksize_t and blkcnt_t are signed integers.

In glibc, alpha is the only one where this is not the case:

    $ find . -name 'typesizes.h' | xargs grep -E 
'__BLK(CNT|SIZE)_T_TYPE[[:space:]]+__U'
    ./sysdeps/unix/sysv/linux/alpha/bits/typesizes.h:#define    __BLKCNT_T_TYPE 
        __U32_TYPE
    ./sysdeps/unix/sysv/linux/alpha/bits/typesizes.h:#define __BLKSIZE_T_TYPE   
__U32_TYPE

The first two patches were my attempt at silencing them in that test and
another one I noticed. However, I realized later that I mixed up hppa
and alpha. The third fixes that embarrassing mistake and adds a glibc
bug report I opened in comments to try to make up for it. :)

> and this is what happens in hppa:
>
> -------------------------------------------------------------------------
> Checking ./stackovf.test
> Stack soft limit set to 8192K
> Failure - m4 aborted unexpectedly
> Output from m4:
> m4: internal error detected; please report this bug to <bug-m4@gnu.org>: 
> Segmentation fault
>
> Skipped checks were:
>   ./127.changeword ./128.changeword ./129.changeword ./130.changeword 
> ./131.changeword ./132.changeword ./133.changeword
> Failed checks were:
>   ./stackovf.test
> make[4]: *** [Makefile:2574: check-local] Error 1
> -------------------------------------------------------------------------
>
> It might be worth to mention that this used to work five months ago
> with 1.4.19, so this is a regression.
>
> Full build logs available here, just click on the red "Build-Attempted":
>
> https://buildd.debian.org/status/package.php?p=m4

I'm leaving this bug report here since I think it may be related to
Gnulib's c-stack module. I could be completly wrong though since I
haven't investigated it.

Collin

[1] https://sourceware.org/PR33355

>From 1087a1576f1de2df8f7c1badf847ecaf63d08081 Mon Sep 17 00:00:00 2001
Message-ID: <1087a1576f1de2df8f7c1badf847ecaf63d08081.1756762404.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Mon, 1 Sep 2025 14:00:00 -0700
Subject: [PATCH 1/3] sys_stat-h tests: Fix a static_assert failure on
 glibc/hppa.

Reported by Santiago Vila <sanv...@debian.org> in:
<https://lists.gnu.org/archive/html/bug-m4/2025-09/msg00000.html>.

* tests/test-sys_stat-h.c [__GLIBC__ && __hppa]: Don't check that
blksize_t and blkcnt_t are signed.
* doc/posix-headers/sys_stat.texi: Mention that these types are
unsigned on this platform.
---
 ChangeLog                       | 10 ++++++++++
 doc/posix-headers/sys_stat.texi |  2 +-
 tests/test-sys_stat-h.c         |  6 ++++--
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d8950512db..60e3340309 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-09-01  Collin Funk  <collin.fu...@gmail.com>
+
+	sys_stat-h tests: Fix a static_assert failure on glibc/hppa.
+	Reported by Santiago Vila <sanv...@debian.org> in:
+	<https://lists.gnu.org/archive/html/bug-m4/2025-09/msg00000.html>.
+	* tests/test-sys_stat-h.c [__GLIBC__ && __hppa]: Don't check that
+	blksize_t and blkcnt_t are signed.
+	* doc/posix-headers/sys_stat.texi: Mention that these types are
+	unsigned on this platform.
+
 2025-09-01  Paul Eggert  <egg...@cs.ucla.edu>
 
 	tests: more fixes for AT_FDCWD portability
diff --git a/doc/posix-headers/sys_stat.texi b/doc/posix-headers/sys_stat.texi
index 764451255f..1369cbb768 100644
--- a/doc/posix-headers/sys_stat.texi
+++ b/doc/posix-headers/sys_stat.texi
@@ -61,7 +61,7 @@ @node sys/stat.h
 @itemize
 @item
 On some platforms the types @code{blksize_t} and @code{blkcnt_t} are unsigned:
-Android.
+Android, glibc/HPPA.
 @item
 The macro @code{S_IFBLK} is missing on some platforms:
 MSVC 14.
diff --git a/tests/test-sys_stat-h.c b/tests/test-sys_stat-h.c
index 9c8ceb7c7c..0979f03779 100644
--- a/tests/test-sys_stat-h.c
+++ b/tests/test-sys_stat-h.c
@@ -339,12 +339,14 @@ struct timespec st;
 static_assert (TYPE_SIGNED (off_t));
 
 /* POSIX requires that blksize_t is a signed integer type.  */
-#if !(defined __ANDROID__ || (defined __FreeBSD_kernel__ && !defined __FreeBSD__))
+#if !(defined __ANDROID__ \
+      || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) \
+      || defined __GLIBC__ && defined __hppa)
 static_assert (TYPE_SIGNED (blksize_t));
 #endif
 
 /* POSIX requires that blkcnt_t is a signed integer type.  */
-#if !defined __ANDROID__
+#if !(defined __ANDROID__ || defined __GLIBC__ && defined __hppa)
 static_assert (TYPE_SIGNED (blkcnt_t));
 #endif
 
-- 
2.51.0

>From 282ea1642b4ac0ad533ef7cc5bb37d2097a6614a Mon Sep 17 00:00:00 2001
Message-ID: <282ea1642b4ac0ad533ef7cc5bb37d2097a6614a.1756762404.git.collin.fu...@gmail.com>
In-Reply-To: <1087a1576f1de2df8f7c1badf847ecaf63d08081.1756762404.git.collin.fu...@gmail.com>
References: <1087a1576f1de2df8f7c1badf847ecaf63d08081.1756762404.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Mon, 1 Sep 2025 14:01:36 -0700
Subject: [PATCH 2/3] sys_types-h tests: Fix a static_assert failure on
 glibc/hppa.

* tests/test-sys_types-h.c [__GLIBC__ && __hppa]: Don't check that
blksize_t and blkcnt_t are signed.
* doc/posix-headers/sys_types.texi: Mention that these types are
unsigned on this platform.
---
 ChangeLog                        | 6 ++++++
 doc/posix-headers/sys_types.texi | 2 +-
 tests/test-sys_types-h.c         | 6 ++++--
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 60e3340309..fba408e498 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2025-09-01  Collin Funk  <collin.fu...@gmail.com>
 
+	sys_types-h tests: Fix a static_assert failure on glibc/hppa.
+	* tests/test-sys_types-h.c [__GLIBC__ && __hppa]: Don't check that
+	blksize_t and blkcnt_t are signed.
+	* doc/posix-headers/sys_types.texi: Mention that these types are
+	unsigned on this platform.
+
 	sys_stat-h tests: Fix a static_assert failure on glibc/hppa.
 	Reported by Santiago Vila <sanv...@debian.org> in:
 	<https://lists.gnu.org/archive/html/bug-m4/2025-09/msg00000.html>.
diff --git a/doc/posix-headers/sys_types.texi b/doc/posix-headers/sys_types.texi
index ed301c4b2c..90b8a60fdb 100644
--- a/doc/posix-headers/sys_types.texi
+++ b/doc/posix-headers/sys_types.texi
@@ -44,7 +44,7 @@ @node sys/types.h
 @itemize
 @item
 On some platforms the types @code{blksize_t} and @code{blkcnt_t} are unsigned:
-Android.
+Android, glibc/HPPA.
 @item
 On some platforms the types @code{blksize_t} and @code{suseconds_t}
 are signed integer types that are wider than @code{long}:
diff --git a/tests/test-sys_types-h.c b/tests/test-sys_types-h.c
index 2a64fb21cf..9fe0f92884 100644
--- a/tests/test-sys_types-h.c
+++ b/tests/test-sys_types-h.c
@@ -46,12 +46,14 @@ static_assert (TYPE_SIGNED (off_t));
 static_assert (TYPE_SIGNED (off64_t));
 
 /* POSIX requires that blksize_t is a signed integer type.  */
-#if !(defined __ANDROID__ || (defined __FreeBSD_kernel__ && !defined __FreeBSD__))
+#if !(defined __ANDROID__ \
+      || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) \
+      || defined __GLIBC__ && defined __hppa)
 static_assert (TYPE_SIGNED (blksize_t));
 #endif
 
 /* POSIX requires that blkcnt_t is a signed integer type.  */
-#if !defined __ANDROID__
+#if !(defined __ANDROID__ || defined __GLIBC__ && defined __hppa)
 static_assert (TYPE_SIGNED (blkcnt_t));
 #endif
 
-- 
2.51.0

>From d5dcc6c91d3c7c6f293fe906af885831af458dac Mon Sep 17 00:00:00 2001
Message-ID: <d5dcc6c91d3c7c6f293fe906af885831af458dac.1756762404.git.collin.fu...@gmail.com>
In-Reply-To: <1087a1576f1de2df8f7c1badf847ecaf63d08081.1756762404.git.collin.fu...@gmail.com>
References: <1087a1576f1de2df8f7c1badf847ecaf63d08081.1756762404.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Mon, 1 Sep 2025 14:26:59 -0700
Subject: [PATCH 3/3] Fix the previous two commits.

The issue occurs on alpha not hppa. Also add the glibc bug report link
in comments.
---
 ChangeLog                        | 8 ++++----
 doc/posix-headers/sys_stat.texi  | 3 ++-
 doc/posix-headers/sys_types.texi | 3 ++-
 tests/test-sys_stat-h.c          | 4 ++--
 tests/test-sys_types-h.c         | 4 ++--
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fba408e498..67fb38e457 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,15 +1,15 @@
 2025-09-01  Collin Funk  <collin.fu...@gmail.com>
 
-	sys_types-h tests: Fix a static_assert failure on glibc/hppa.
-	* tests/test-sys_types-h.c [__GLIBC__ && __hppa]: Don't check that
+	sys_types-h tests: Fix a static_assert failure on glibc/alpha.
+	* tests/test-sys_types-h.c [__GLIBC__ && __alpha]: Don't check that
 	blksize_t and blkcnt_t are signed.
 	* doc/posix-headers/sys_types.texi: Mention that these types are
 	unsigned on this platform.
 
-	sys_stat-h tests: Fix a static_assert failure on glibc/hppa.
+	sys_stat-h tests: Fix a static_assert failure on glibc/alpha.
 	Reported by Santiago Vila <sanv...@debian.org> in:
 	<https://lists.gnu.org/archive/html/bug-m4/2025-09/msg00000.html>.
-	* tests/test-sys_stat-h.c [__GLIBC__ && __hppa]: Don't check that
+	* tests/test-sys_stat-h.c [__GLIBC__ && __alpha]: Don't check that
 	blksize_t and blkcnt_t are signed.
 	* doc/posix-headers/sys_stat.texi: Mention that these types are
 	unsigned on this platform.
diff --git a/doc/posix-headers/sys_stat.texi b/doc/posix-headers/sys_stat.texi
index 1369cbb768..42040420d2 100644
--- a/doc/posix-headers/sys_stat.texi
+++ b/doc/posix-headers/sys_stat.texi
@@ -61,7 +61,8 @@ @node sys/stat.h
 @itemize
 @item
 On some platforms the types @code{blksize_t} and @code{blkcnt_t} are unsigned:
-Android, glibc/HPPA.
+@c https://sourceware.org/PR33355
+Android, glibc/alpha.
 @item
 The macro @code{S_IFBLK} is missing on some platforms:
 MSVC 14.
diff --git a/doc/posix-headers/sys_types.texi b/doc/posix-headers/sys_types.texi
index 90b8a60fdb..84d9bf7dea 100644
--- a/doc/posix-headers/sys_types.texi
+++ b/doc/posix-headers/sys_types.texi
@@ -44,7 +44,8 @@ @node sys/types.h
 @itemize
 @item
 On some platforms the types @code{blksize_t} and @code{blkcnt_t} are unsigned:
-Android, glibc/HPPA.
+@c https://sourceware.org/PR33355
+Android, glibc/alpha.
 @item
 On some platforms the types @code{blksize_t} and @code{suseconds_t}
 are signed integer types that are wider than @code{long}:
diff --git a/tests/test-sys_stat-h.c b/tests/test-sys_stat-h.c
index 0979f03779..6936cc7a8b 100644
--- a/tests/test-sys_stat-h.c
+++ b/tests/test-sys_stat-h.c
@@ -341,12 +341,12 @@ static_assert (TYPE_SIGNED (off_t));
 /* POSIX requires that blksize_t is a signed integer type.  */
 #if !(defined __ANDROID__ \
       || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) \
-      || defined __GLIBC__ && defined __hppa)
+      || defined __GLIBC__ && defined __alpha)
 static_assert (TYPE_SIGNED (blksize_t));
 #endif
 
 /* POSIX requires that blkcnt_t is a signed integer type.  */
-#if !(defined __ANDROID__ || defined __GLIBC__ && defined __hppa)
+#if !(defined __ANDROID__ || defined __GLIBC__ && defined __alpha)
 static_assert (TYPE_SIGNED (blkcnt_t));
 #endif
 
diff --git a/tests/test-sys_types-h.c b/tests/test-sys_types-h.c
index 9fe0f92884..b3d6abeca0 100644
--- a/tests/test-sys_types-h.c
+++ b/tests/test-sys_types-h.c
@@ -48,12 +48,12 @@ static_assert (TYPE_SIGNED (off64_t));
 /* POSIX requires that blksize_t is a signed integer type.  */
 #if !(defined __ANDROID__ \
       || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) \
-      || defined __GLIBC__ && defined __hppa)
+      || defined __GLIBC__ && defined __alpha)
 static_assert (TYPE_SIGNED (blksize_t));
 #endif
 
 /* POSIX requires that blkcnt_t is a signed integer type.  */
-#if !(defined __ANDROID__ || defined __GLIBC__ && defined __hppa)
+#if !(defined __ANDROID__ || defined __GLIBC__ && defined __alpha)
 static_assert (TYPE_SIGNED (blkcnt_t));
 #endif
 
-- 
2.51.0

  • m4 1.4.20 on a... Santiago Vila
    • Re: m4 1.... Collin Funk
      • Re: m... Santiago Vila
        • R... Collin Funk
          • ... Santiago Vila
        • R... Bruno Haible via Bug reports for the GNU m4 macro processor
      • Re: m... Bruno Haible via Bug reports for the GNU m4 macro processor
      • Re: m... Bruno Haible via Bug reports for the GNU m4 macro processor
        • R... Santiago Vila

Reply via email to