Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SegFault when running almalinux:8 based docker images #109

Open
kvinwang opened this issue Feb 19, 2025 · 1 comment
Open

SegFault when running almalinux:8 based docker images #109

kvinwang opened this issue Feb 19, 2025 · 1 comment

Comments

@kvinwang
Copy link
Collaborator

kvinwang commented Feb 19, 2025

It crashed in glibc at program start. Most commands are effected.
Reproduce:

docker run --rm -it almalinux:8 bash

almalinux:9 and almalinux:10 work fine though.

GDB couldn't catch the SEGFAULT:

[root@1f9eebb6f557 /]# /gdb/gdb bash
GNU gdb (GDB) 16.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bash...

warning: Cannot parse .gnu_debugdata section; LZMA support was disabled at compile time
(No debugging symbols found in bash)
(gdb) r
Starting program: /usr/bin/bash
During startup program terminated with signal SIGSEGV, Segmentation fault.
(gdb)

strace.txt

@kvinwang
Copy link
Collaborator Author

Some updates:

Unable to determine the root cause.
Some attempts:

  1. If run the same VM system without TDX enabled, it works.
  2. Can not debug with GDB directly. However, it can generate core dump. We can see it crashed at __memmove_avx512_unaligned_erms from the dumped core.
(gdb) bt
#0  0x00007dceb90def45 in __memmove_avx512_unaligned_erms ()
   from /lib64/libc.so.6
#1  0x00007dceb9050134 in qsort_r () from /lib64/libc.so.6
#2  0x0000572f9c02fcbe in ?? ()
#3  0x0000572f9c02e5ec in main ()
  1. After turning off avx512, it crashed at __memmove_avx_unaligned_erms.
(gdb) bt
#0  0x00007a70a52a7db7 in __memmove_avx_unaligned_erms () from /lib64/libc.so.6
#1  0x00007a70a524fce1 in msort_with_tmp.part () from /lib64/libc.so.6
#2  0x00007a70a5250134 in qsort_r () from /lib64/libc.so.6
#3  0x00005a5dcce2fcbe in ?? ()
#4  0x00005a5dcce2e5ec in main ()
  1. After turning off avx, avx2 and avx512, it doesn't crash any more.
  2. But it also call __memmove_avx512_unaligned_erms under AlmaLinux 9, as well as most other systems, without any error.
  3. AlmaLinux 9 ships with glibc-2.34, AlmaLinux 8 ships with glibc-2.28.
  4. When I compile the glibc-2.28 from source, and install it to AlmaLinux 8, then run the bash again, the segfault disappears.

The issue might be caused by some patches to glibc from AlmaLinux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant