public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu
@ 2022-12-13 17:43 glaubitz at physik dot fu-berlin.de
  2022-12-13 17:43 ` [Bug libc/29899] " glaubitz at physik dot fu-berlin.de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-13 17:43 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

            Bug ID: 29899
           Summary: Fix for bz#20305 broke glibc on alpha-linux-gnu
           Product: glibc
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: glaubitz at physik dot fu-berlin.de
                CC: adhemerval.zanella at linaro dot org, drepper.fsp at gmail dot com,
                    hjl.tools at gmail dot com, jrtc27 at jrtc27 dot com,
                    mcree at orcon dot net.nz
  Target Milestone: ---
              Host: alpha-linux-gnu

The following commit broke glibc on alpha-linux-gnu, in this case Debian
unstable running on Alpha:

commit 6c57d320484988e87e446e2e60ce42816bf51d53
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 1 11:00:38 2021 -0800

    sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305]

    Add _SC_MINSIGSTKSZ for the minimum signal stack size derived from
    AT_MINSIGSTKSZ, which is the minimum number of bytes of free stack
    space required in order to gurantee successful, non-nested handling
    of a single signal whose handler is an empty function, and _SC_SIGSTKSZ
    which is the suggested minimum number of bytes of stack space required
    for a signal stack.

Without the patch applied, running bash in a qemu-user-static chroot from the
build directory of a cross-compiled build works fine:

(sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$
LD_LIBRARY_PATH=/home/glaubitz/glibc-git/build /bin/bash
(sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$ 
exit

With the patch applied, the above command results in a segmentation fault:

(sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$
LD_LIBRARY_PATH=/home/glaubitz/glibc-git/build /bin/bash
Segmentation fault
(sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$

The issue also becomes apparent when comparing the testsuite failures for
glibc-2.33 and glibc-2.34 in Debian unstable:

> https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=alpha&ver=2.33-8&stamp=1657736413&raw=0
> https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=alpha&ver=2.34-1&stamp=1659947712&raw=0

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
@ 2022-12-13 17:43 ` glaubitz at physik dot fu-berlin.de
  2022-12-13 17:43 ` glaubitz at physik dot fu-berlin.de
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-13 17:43 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deller at gmx dot de

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
  2022-12-13 17:43 ` [Bug libc/29899] " glaubitz at physik dot fu-berlin.de
@ 2022-12-13 17:43 ` glaubitz at physik dot fu-berlin.de
  2022-12-13 19:52 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-13 17:43 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mattst88 at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
  2022-12-13 17:43 ` [Bug libc/29899] " glaubitz at physik dot fu-berlin.de
  2022-12-13 17:43 ` glaubitz at physik dot fu-berlin.de
@ 2022-12-13 19:52 ` hjl.tools at gmail dot com
  2022-12-13 20:38 ` glaubitz at physik dot fu-berlin.de
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2022-12-13 19:52 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-12-13

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
What are values of SIGSTKSZ and MINSIGSTKSZ before and after the commit?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (2 preceding siblings ...)
  2022-12-13 19:52 ` hjl.tools at gmail dot com
@ 2022-12-13 20:38 ` glaubitz at physik dot fu-berlin.de
  2022-12-13 21:12 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-13 20:38 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

--- Comment #2 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to H.J. Lu from comment #1)
> What are values of SIGSTKSZ and MINSIGSTKSZ before and after the commit?

I'm not sure how to read out those values as I tried it with small test program
which crashes after the commit.

Without commit, I get:

(sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$ /bz20305 
The value of SIGSTKSZ is 16384.
The value of MINSIGSTKSZ is 4096.
(sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$

I used the following test program:

#include <stdio.h>
#include <signal.h>

int main() {

        printf("The value of SIGSTKSZ is %d.\n", SIGSTKSZ);
        printf("The value of MINSIGSTKSZ is %d.\n", MINSIGSTKSZ);

        return 0;
}

Do you have any other suggestion for dumping the values?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (3 preceding siblings ...)
  2022-12-13 20:38 ` glaubitz at physik dot fu-berlin.de
@ 2022-12-13 21:12 ` hjl.tools at gmail dot com
  2022-12-13 21:22 ` glaubitz at physik dot fu-berlin.de
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2022-12-13 21:12 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to John Paul Adrian Glaubitz from comment #2)
> (In reply to H.J. Lu from comment #1)
> > What are values of SIGSTKSZ and MINSIGSTKSZ before and after the commit?
> 
> I'm not sure how to read out those values as I tried it with small test
> program which crashes after the commit.
> 
> Without commit, I get:
> 
> (sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$ /bz20305 
> The value of SIGSTKSZ is 16384.
> The value of MINSIGSTKSZ is 4096.
> (sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$
> 
> I used the following test program:
> 
> #include <stdio.h>
> #include <signal.h>
> 
> int main() {
> 
>         printf("The value of SIGSTKSZ is %d.\n", SIGSTKSZ);
>         printf("The value of MINSIGSTKSZ is %d.\n", MINSIGSTKSZ);
> 
>         return 0;
> }
> 
> Do you have any other suggestion for dumping the values?

Why does this program crash with the commit?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (4 preceding siblings ...)
  2022-12-13 21:12 ` hjl.tools at gmail dot com
@ 2022-12-13 21:22 ` glaubitz at physik dot fu-berlin.de
  2022-12-14  7:45 ` sam at gentoo dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-13 21:22 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

--- Comment #4 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to H.J. Lu from comment #3)
> Why does this program crash with the commit?

That's what I am trying to find out. I suspect that the values of MINSIGSTKSZ
and SIGSTKSZ are not the cause of the problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (5 preceding siblings ...)
  2022-12-13 21:22 ` glaubitz at physik dot fu-berlin.de
@ 2022-12-14  7:45 ` sam at gentoo dot org
  2022-12-14  7:53 ` glaubitz at physik dot fu-berlin.de
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sam at gentoo dot org @ 2022-12-14  7:45 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gentoo dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (6 preceding siblings ...)
  2022-12-14  7:45 ` sam at gentoo dot org
@ 2022-12-14  7:53 ` glaubitz at physik dot fu-berlin.de
  2022-12-14 16:00 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-14  7:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

--- Comment #5 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
This is the minimum change directly on top the commit that fixes the problem
for me:

diff --git a/elf/dl-sysdep.c b/elf/dl-sysdep.c
index bd5066fe3b..bc45a6e9d3 100644
--- a/elf/dl-sysdep.c
+++ b/elf/dl-sysdep.c
@@ -115,10 +115,10 @@ _dl_sysdep_start (void **start_argptr,
   user_entry = (ElfW(Addr)) ENTRY_POINT;
   GLRO(dl_platform) = NULL; /* Default to nothing known about the platform. 
*/

-  /* NB: Default to a constant CONSTANT_MINSIGSTKSZ.  */
-  _Static_assert (__builtin_constant_p (CONSTANT_MINSIGSTKSZ),
-             "CONSTANT_MINSIGSTKSZ is constant");
-  GLRO(dl_minsigstacksize) = CONSTANT_MINSIGSTKSZ;
+  /* /\* NB: Default to a constant CONSTANT_MINSIGSTKSZ.  *\/ */
+  /* _Static_assert (__builtin_constant_p (CONSTANT_MINSIGSTKSZ), */
+  /*                   "CONSTANT_MINSIGSTKSZ is constant"); */
+  /* GLRO(dl_minsigstacksize) = CONSTANT_MINSIGSTKSZ; */

   for (av = GLRO(dl_auxv); av->a_type != AT_NULL; set_seen (av++))
     switch (av->a_type)
@@ -184,9 +184,9 @@ _dl_sysdep_start (void **start_argptr,
       case AT_RANDOM:
        _dl_random = (void *) av->a_un.a_val;
        break;
-      case AT_MINSIGSTKSZ:
-   GLRO(dl_minsigstacksize) = av->a_un.a_val;
-   break;
+      /* case AT_MINSIGSTKSZ: */
+      /*     GLRO(dl_minsigstacksize) = av->a_un.a_val; */
+      /*     break; */
       DL_PLATFORM_AUXV
       }

diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 9720a4e446..9ead714718 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -536,8 +536,8 @@ struct rtld_global_ro
   /* Cached value of `getpagesize ()'.  */
   EXTERN size_t _dl_pagesize;

-  /* Cached value of `sysconf (_SC_MINSIGSTKSZ)'.  */
-  EXTERN size_t _dl_minsigstacksize;
+  /* /\* Cached value of `sysconf (_SC_MINSIGSTKSZ)'.  *\/ */
+  /* EXTERN size_t _dl_minsigstacksize; */

   /* Do we read from ld.so.cache?  */
   EXTERN int _dl_inhibit_cache;
diff --git a/sysdeps/unix/sysv/linux/sysconf.c
b/sysdeps/unix/sysv/linux/sysconf.c
index 366fcef01e..5a5c89f80e 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -77,12 +77,12 @@ __sysconf (int name)
       }
       break;

-    case _SC_MINSIGSTKSZ:
-      assert (GLRO(dl_minsigstacksize) != 0);
-      return GLRO(dl_minsigstacksize);
+    /* case _SC_MINSIGSTKSZ: */
+    /*   assert (GLRO(dl_minsigstacksize) != 0); */
+    /*   return GLRO(dl_minsigstacksize); */

-    case _SC_SIGSTKSZ:
-      return sysconf_sigstksz ();
+    /* case _SC_SIGSTKSZ: */
+    /*   return sysconf_sigstksz (); */

     default:
       break;

So, my suspicion is that adding the variable _dl_minsigstacksize to struct
rtld_global_ro {} breaks the ABI on Alpha.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (7 preceding siblings ...)
  2022-12-14  7:53 ` glaubitz at physik dot fu-berlin.de
@ 2022-12-14 16:00 ` hjl.tools at gmail dot com
  2022-12-21 10:25 ` glaubitz at physik dot fu-berlin.de
  2022-12-30 14:35 ` glaubitz at physik dot fu-berlin.de
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2022-12-14 16:00 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to John Paul Adrian Glaubitz from comment #5)
> So, my suspicion is that adding the variable _dl_minsigstacksize to struct
> rtld_global_ro {} breaks the ABI on Alpha.

rtld_global_ro is private to glibc.  Are there any hardcoded rtld_global_ro
related values on Alpha?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (8 preceding siblings ...)
  2022-12-14 16:00 ` hjl.tools at gmail dot com
@ 2022-12-21 10:25 ` glaubitz at physik dot fu-berlin.de
  2022-12-30 14:35 ` glaubitz at physik dot fu-berlin.de
  10 siblings, 0 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-21 10:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

--- Comment #7 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
It seems that this issue has been fixed in version 2.36 but there is another
issue which so far I have failed to bisect:

(sid-alpha-sbuild)glaubitz@nofan:~/glibc-git/build$
LD_LIBRARY_PATH=/home/glaubitz/glibc-git/build /bin/bash
Floating point exception
(sid-alpha-sbuild)glaubitz@nofan:~/glibc-git/build$

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libc/29899] Fix for bz#20305 broke glibc on alpha-linux-gnu
  2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
                   ` (9 preceding siblings ...)
  2022-12-21 10:25 ` glaubitz at physik dot fu-berlin.de
@ 2022-12-30 14:35 ` glaubitz at physik dot fu-berlin.de
  10 siblings, 0 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-12-30 14:35 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29899

John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |INVALID

--- Comment #8 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
After discussing this issue with Adhemveral, it turns out that my testing
method was incorrect and the segfault was a result of mixing ld.so and libc.so
from different glibc builds which, of course, doesn't work.

Closing this issue although the original problem may still exist. It affects
statically linked programs only, however.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-12-30 14:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 17:43 [Bug libc/29899] New: Fix for bz#20305 broke glibc on alpha-linux-gnu glaubitz at physik dot fu-berlin.de
2022-12-13 17:43 ` [Bug libc/29899] " glaubitz at physik dot fu-berlin.de
2022-12-13 17:43 ` glaubitz at physik dot fu-berlin.de
2022-12-13 19:52 ` hjl.tools at gmail dot com
2022-12-13 20:38 ` glaubitz at physik dot fu-berlin.de
2022-12-13 21:12 ` hjl.tools at gmail dot com
2022-12-13 21:22 ` glaubitz at physik dot fu-berlin.de
2022-12-14  7:45 ` sam at gentoo dot org
2022-12-14  7:53 ` glaubitz at physik dot fu-berlin.de
2022-12-14 16:00 ` hjl.tools at gmail dot com
2022-12-21 10:25 ` glaubitz at physik dot fu-berlin.de
2022-12-30 14:35 ` glaubitz at physik dot fu-berlin.de

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).