public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap
@ 2023-12-21  0:16 hjl.tools at gmail dot com
  2023-12-22 13:37 ` [Bug dynamic-link/31184] " cvs-commit at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2023-12-21  0:16 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 31184
           Summary: FAIL: elf/tst-tlsgap
           Product: glibc
           Version: 2.38
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: x32

On x32, I got

FAIL: elf/tst-tlsgap

open tst-tlsgap-mod1.so

Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 2268754]
_dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
108             movq    (%rsi), %rax
(gdb) p/x $rsi
$4 = 0xf7dbf9005655fb18
(gdb) 

The problem is at

_dl_tlsdesc_dynamic:
        _CET_ENDBR
        /* Preserve call-clobbered registers that we modify.
           We need two scratch regs anyway.  */
        movq    %rsi, -16(%rsp)
        movq    %fs:DTV_OFFSET, %rsi
        movq    %rdi, -8(%rsp)
        movq    TLSDESC_ARG(%rax), %rdi
        movq    (%rsi), %rax
        cmpq    %rax, TLSDESC_GEN_COUNT(%rdi)
        ja      .Lslow
        movq    TLSDESC_MODID(%rdi), %rax
        salq    $4, %rax
        movq    (%rax,%rsi), %rax
        cmpq    $-1, %rax
        je      .Lslow
        addq    TLSDESC_MODOFF(%rdi), %rax
.Lret:
        movq    -16(%rsp), %rsi
        subq    %fs:0, %rax
        movq    -8(%rsp), %rdi
        ret

since the dtv field is a pointer, %fs:DTV_OFFSET is a 32-bit
location, not 64-bit.

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

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

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
@ 2023-12-22 13:37 ` cvs-commit at gcc dot gnu.org
  2023-12-22 14:44 ` sam at gentoo dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-22 13:37 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3502440397bbb840e2f7223734aa5cc2cc0e29b6

commit 3502440397bbb840e2f7223734aa5cc2cc0e29b6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 20 16:31:43 2023 -0800

    x86-64: Fix the dtv field load for x32 [BZ #31184]

    On x32, I got

    FAIL: elf/tst-tlsgap

    $ gdb elf/tst-tlsgap
    ...
    open tst-tlsgap-mod1.so

    Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 2268754]
    _dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
    108             movq    (%rsi), %rax
    (gdb) p/x $rsi
    $4 = 0xf7dbf9005655fb18
    (gdb)

    This is caused by

    _dl_tlsdesc_dynamic:
            _CET_ENDBR
            /* Preserve call-clobbered registers that we modify.
               We need two scratch regs anyway.  */
            movq    %rsi, -16(%rsp)
            movq    %fs:DTV_OFFSET, %rsi

    Since the dtv field in TCB is a pointer, %fs:DTV_OFFSET is a 32-bit
    location, not 64-bit.  Load the dtv field to RSI_LP instead of rsi.
    This fixes BZ #31184.

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

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

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
  2023-12-22 13:37 ` [Bug dynamic-link/31184] " cvs-commit at gcc dot gnu.org
@ 2023-12-22 14:44 ` sam at gentoo dot org
  2023-12-23 15:08 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sam at gentoo dot org @ 2023-12-22 14:44 UTC (permalink / raw)
  To: glibc-bugs

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

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] 9+ messages in thread

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
  2023-12-22 13:37 ` [Bug dynamic-link/31184] " cvs-commit at gcc dot gnu.org
  2023-12-22 14:44 ` sam at gentoo dot org
@ 2023-12-23 15:08 ` cvs-commit at gcc dot gnu.org
  2023-12-23 17:00 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-23 15:08 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The release/2.38/master branch has been updated by H.J. Lu
<hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=35ea7549751d4f13a28c732e6ad68204f5e60a06

commit 35ea7549751d4f13a28c732e6ad68204f5e60a06
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 20 16:31:43 2023 -0800

    x86-64: Fix the dtv field load for x32 [BZ #31184]

    On x32, I got

    FAIL: elf/tst-tlsgap

    $ gdb elf/tst-tlsgap
    ...
    open tst-tlsgap-mod1.so

    Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 2268754]
    _dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
    108             movq    (%rsi), %rax
    (gdb) p/x $rsi
    $4 = 0xf7dbf9005655fb18
    (gdb)

    This is caused by

    _dl_tlsdesc_dynamic:
            _CET_ENDBR
            /* Preserve call-clobbered registers that we modify.
               We need two scratch regs anyway.  */
            movq    %rsi, -16(%rsp)
            movq    %fs:DTV_OFFSET, %rsi

    Since the dtv field in TCB is a pointer, %fs:DTV_OFFSET is a 32-bit
    location, not 64-bit.  Load the dtv field to RSI_LP instead of rsi.
    This fixes BZ #31184.

    (cherry picked from commit 3502440397bbb840e2f7223734aa5cc2cc0e29b6)

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

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

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2023-12-23 15:08 ` cvs-commit at gcc dot gnu.org
@ 2023-12-23 17:00 ` cvs-commit at gcc dot gnu.org
  2023-12-23 17:35 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-23 17:00 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The release/2.37/master branch has been updated by H.J. Lu
<hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8bd00f5b6d42ee89f61b5f15624788ad1aed917e

commit 8bd00f5b6d42ee89f61b5f15624788ad1aed917e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 20 16:31:43 2023 -0800

    x86-64: Fix the dtv field load for x32 [BZ #31184]

    On x32, I got

    FAIL: elf/tst-tlsgap

    $ gdb elf/tst-tlsgap
    ...
    open tst-tlsgap-mod1.so

    Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 2268754]
    _dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
    108             movq    (%rsi), %rax
    (gdb) p/x $rsi
    $4 = 0xf7dbf9005655fb18
    (gdb)

    This is caused by

    _dl_tlsdesc_dynamic:
            _CET_ENDBR
            /* Preserve call-clobbered registers that we modify.
               We need two scratch regs anyway.  */
            movq    %rsi, -16(%rsp)
            movq    %fs:DTV_OFFSET, %rsi

    Since the dtv field in TCB is a pointer, %fs:DTV_OFFSET is a 32-bit
    location, not 64-bit.  Load the dtv field to RSI_LP instead of rsi.
    This fixes BZ #31184.

    (cherry picked from commit 3502440397bbb840e2f7223734aa5cc2cc0e29b6)

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

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

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2023-12-23 17:00 ` cvs-commit at gcc dot gnu.org
@ 2023-12-23 17:35 ` cvs-commit at gcc dot gnu.org
  2023-12-23 17:36 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-23 17:35 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The release/2.36/master branch has been updated by H.J. Lu
<hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6a1168279d770ee9631d8d0409768ac67c96be3c

commit 6a1168279d770ee9631d8d0409768ac67c96be3c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 20 16:31:43 2023 -0800

    x86-64: Fix the dtv field load for x32 [BZ #31184]

    On x32, I got

    FAIL: elf/tst-tlsgap

    $ gdb elf/tst-tlsgap
    ...
    open tst-tlsgap-mod1.so

    Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 2268754]
    _dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
    108             movq    (%rsi), %rax
    (gdb) p/x $rsi
    $4 = 0xf7dbf9005655fb18
    (gdb)

    This is caused by

    _dl_tlsdesc_dynamic:
            _CET_ENDBR
            /* Preserve call-clobbered registers that we modify.
               We need two scratch regs anyway.  */
            movq    %rsi, -16(%rsp)
            movq    %fs:DTV_OFFSET, %rsi

    Since the dtv field in TCB is a pointer, %fs:DTV_OFFSET is a 32-bit
    location, not 64-bit.  Load the dtv field to RSI_LP instead of rsi.
    This fixes BZ #31184.

    (cherry picked from commit 3502440397bbb840e2f7223734aa5cc2cc0e29b6)

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

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

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2023-12-23 17:35 ` cvs-commit at gcc dot gnu.org
@ 2023-12-23 17:36 ` cvs-commit at gcc dot gnu.org
  2023-12-23 17:38 ` cvs-commit at gcc dot gnu.org
  2023-12-23 17:40 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-23 17:36 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #5 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The release/2.35/master branch has been updated by H.J. Lu
<hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2d87262c1c4ed877a51a4689db0ac2e08fba2f43

commit 2d87262c1c4ed877a51a4689db0ac2e08fba2f43
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 20 16:31:43 2023 -0800

    x86-64: Fix the dtv field load for x32 [BZ #31184]

    On x32, I got

    FAIL: elf/tst-tlsgap

    $ gdb elf/tst-tlsgap
    ...
    open tst-tlsgap-mod1.so

    Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 2268754]
    _dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
    108             movq    (%rsi), %rax
    (gdb) p/x $rsi
    $4 = 0xf7dbf9005655fb18
    (gdb)

    This is caused by

    _dl_tlsdesc_dynamic:
            _CET_ENDBR
            /* Preserve call-clobbered registers that we modify.
               We need two scratch regs anyway.  */
            movq    %rsi, -16(%rsp)
            movq    %fs:DTV_OFFSET, %rsi

    Since the dtv field in TCB is a pointer, %fs:DTV_OFFSET is a 32-bit
    location, not 64-bit.  Load the dtv field to RSI_LP instead of rsi.
    This fixes BZ #31184.

    (cherry picked from commit 3502440397bbb840e2f7223734aa5cc2cc0e29b6)

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

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

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2023-12-23 17:36 ` cvs-commit at gcc dot gnu.org
@ 2023-12-23 17:38 ` cvs-commit at gcc dot gnu.org
  2023-12-23 17:40 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-23 17:38 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The release/2.34/master branch has been updated by H.J. Lu
<hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ba52b325c43e863fe29e7f83990175c37e379099

commit ba52b325c43e863fe29e7f83990175c37e379099
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 20 16:31:43 2023 -0800

    x86-64: Fix the dtv field load for x32 [BZ #31184]

    On x32, I got

    FAIL: elf/tst-tlsgap

    $ gdb elf/tst-tlsgap
    ...
    open tst-tlsgap-mod1.so

    Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 2268754]
    _dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
    108             movq    (%rsi), %rax
    (gdb) p/x $rsi
    $4 = 0xf7dbf9005655fb18
    (gdb)

    This is caused by

    _dl_tlsdesc_dynamic:
            _CET_ENDBR
            /* Preserve call-clobbered registers that we modify.
               We need two scratch regs anyway.  */
            movq    %rsi, -16(%rsp)
            movq    %fs:DTV_OFFSET, %rsi

    Since the dtv field in TCB is a pointer, %fs:DTV_OFFSET is a 32-bit
    location, not 64-bit.  Load the dtv field to RSI_LP instead of rsi.
    This fixes BZ #31184.

    (cherry picked from commit 3502440397bbb840e2f7223734aa5cc2cc0e29b6)

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

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

* [Bug dynamic-link/31184] FAIL: elf/tst-tlsgap
  2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2023-12-23 17:38 ` cvs-commit at gcc dot gnu.org
@ 2023-12-23 17:40 ` hjl.tools at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2023-12-23 17:40 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.39
             Status|NEW                         |RESOLVED

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for 2.39 and backported to 2.38/2.37/2.36/2.35/2.34 branches.

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

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

end of thread, other threads:[~2023-12-23 17:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21  0:16 [Bug dynamic-link/31184] New: FAIL: elf/tst-tlsgap hjl.tools at gmail dot com
2023-12-22 13:37 ` [Bug dynamic-link/31184] " cvs-commit at gcc dot gnu.org
2023-12-22 14:44 ` sam at gentoo dot org
2023-12-23 15:08 ` cvs-commit at gcc dot gnu.org
2023-12-23 17:00 ` cvs-commit at gcc dot gnu.org
2023-12-23 17:35 ` cvs-commit at gcc dot gnu.org
2023-12-23 17:36 ` cvs-commit at gcc dot gnu.org
2023-12-23 17:38 ` cvs-commit at gcc dot gnu.org
2023-12-23 17:40 ` hjl.tools at gmail dot com

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