You are not logged in.

#1 2022-10-30 19:01:18

SolidWater
Member
Registered: 2022-10-30
Posts: 7

[SOLVED] bash Segmentation fault (core dumped)

Hello, after I upgraded my system with: sudo pacman -Syu
which upgraded kernel to: 6.0.5-arch1-1
(I was already on a previous version of 6)

After a reboot, whenever bash is launched, I got: Segmentation fault (core dumped)
which caused a lot of difficulties, because my user's shell was bash.

Eventually I got a limited workaround after booting from a USB stick and managed to install zsh:

% bash
zsh: segmentation fault (core dumped)  bash
% bash --noediting
[~]


I'd appreciate any suggestion to diagnose this further and address it.

Thanks!

Last edited by SolidWater (2022-11-02 02:46:01)

Offline

#2 2022-10-30 19:27:05

seth
Member
Registered: 2012-09-03
Posts: 51,560

Re: [SOLVED] bash Segmentation fault (core dumped)

https://wiki.archlinux.org/title/Core_d … _core_dump
On a limb, try to downgrade readline - it was just updated from 8.1 to 8.2 and it seems like bash might tap into an ABI instable function?

Offline

#3 2022-10-31 02:44:27

SolidWater
Member
Registered: 2022-10-30
Posts: 7

Re: [SOLVED] bash Segmentation fault (core dumped)

Thank you seth!

I downgraded to 8.1 and it does work. So, your thought must be correct.

FWIW:
- Before downgrade, I tried to run gdb and it also failed with segmentation fault.
- kernel 6.0.6-arch1-1 + readline 8.2 has the same problem

Offline

#4 2022-10-31 07:03:40

seth
Member
Registered: 2012-09-03
Posts: 51,560

Re: [SOLVED] bash Segmentation fault (core dumped)

If there's even the slight chance of an ABI incompatible change in readline, that's a problem.

pacman -Qs 'bash|readline|gdb'
type bash
ldd /bin/bash

and please look at the coredumps, they might further hint at the problem.

Even if, after experiencing zsh, you of course never want to go back to bash tongue

Offline

#5 2022-11-01 00:45:57

SolidWater
Member
Registered: 2022-10-30
Posts: 7

Re: [SOLVED] bash Segmentation fault (core dumped)

[~] pacman -Qs 'bash|readline|gdb'
local/bash 5.1.016-1
    The GNU Bourne Again shell
local/gdb 12.1-1
    The GNU Debugger
local/gdb-common 12.1-1
    The GNU Debugger
local/gdbm 1.23-1
    GNU database library
local/perl 5.36.0-1
    A highly capable, feature-rich programming language
local/readline 8.1.002-1
    GNU readline library
local/tdb 1.4.7-1
    Trivial Database similar to GDBM but allows simultaneous commits
[~] type bash
bash is /usr/bin/bash
[~] ldd /bin/bash
        linux-vdso.so.1 (0x00007ffebdd84000)
        libreadline.so.8 => /usr/lib/libreadline.so.8 (0x00007fe20c6e2000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fe20c6dd000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007fe20c4f6000)
        libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x00007fe20c482000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fe20c850000)
[~] ls -l /usr/lib/libreadline.so.8
lrwxrwxrwx 1 root root 18 Jan 29  2022 /usr/lib/libreadline.so.8 -> libreadline.so.8.1
[~]

Offline

#6 2022-11-01 01:05:16

SolidWater
Member
Registered: 2022-10-30
Posts: 7

Re: [SOLVED] bash Segmentation fault (core dumped)

[~] coredumpctl gdb 5597
           PID: 5597 (bash)
           UID: 1000
           GID: 1000
        Signal: 11 (SEGV)
     Timestamp: Sun 2022-10-30 14:44:16 EDT (1 day 6h ago)
  Command Line: bash
    Executable: /usr/bin/bash
Control Group: /system.slice/xrdp-sesman.service
          Unit: xrdp-sesman.service
         Slice: system.slice
...
                Module linux-vdso.so.1 with build-id 5bfd75e96d7e2d68ce28ea9a8fb019ab0b29852d
                Module ld-linux-x86-64.so.2 with build-id 22bd7a2c03d8cfc05ef7092bfae5932223189bc1
                Module libncursesw.so.6 with build-id b9917757481e6fa6097e2a1f31f5bb5eaf138c4e
                Module libc.so.6 with build-id 1e94beb079e278ac4f2c8bce1f53091548ea1584
                Module libdl.so.2 with build-id 414d1d630bc04818a150b9c73e4493f3395e8869
                Module libreadline.so.8 with build-id 0a4a9a4930af5052b6a7dbf9ca52ab594381364a
                Module bash with build-id 6c75f9f0f273cf6549f078b042c0a3f5a04f0357
                Stack trace of thread 5597:
                #0  0x00007f7259884c3b kill (libc.so.6 + 0x38c3b)
                #1  0x000055abbf7c8469 n/a (bash + 0x6f469)
                #2  0x000055abbf7c8661 termsig_sighandler (bash + 0x6f661)
                #3  0x00007f7259884a00 n/a (libc.so.6 + 0x38a00)
                #4  0x00007f72599a2ffd n/a (libc.so.6 + 0x156ffd)
                #5  0x00007f7259a6ecbc _rl_init_locale (libreadline.so.8 + 0x36cbc)
                #6  0x00007f7259a6edb7 _rl_init_eightbit (libreadline.so.8 + 0x36db7)
                #7  0x00007f7259a5c25b rl_initialize (libreadline.so.8 + 0x2425b)
                #8  0x000055abbf7d8c56 initialize_readline (bash + 0x7fc56)
                #9  0x000055abbf77c41e n/a (bash + 0x2341e)
                #10 0x000055abbf77eb20 n/a (bash + 0x25b20)
                #11 0x000055abbf781e4a n/a (bash + 0x28e4a)
                #12 0x000055abbf785232 yyparse (bash + 0x2c232)
                #13 0x000055abbf77b869 parse_command (bash + 0x22869)
                #14 0x000055abbf77b9f4 read_command (bash + 0x229f4)
                #15 0x000055abbf77bc1c reader_loop (bash + 0x22c1c)
                #16 0x000055abbf77a8e2 main (bash + 0x218e2)
                #17 0x00007f725986f290 n/a (libc.so.6 + 0x23290)
                #18 0x00007f725986f34a __libc_start_main (libc.so.6 + 0x2334a)
                #19 0x000055abbf77a91e _start (bash + 0x2191e)
                ELF object binary architecture: AMD x86-64

GNU gdb (GDB) 12.1
...
Reading symbols from /usr/bin/bash...
(No debugging symbols found in /usr/bin/bash)

warning: Can't open file /usr/lib/libreadline.so.8.2 during file-backed mapping note processing
[New LWP 5597]

warning: .dynamic section for "/usr/lib/libreadline.so.8" is not at the expected address (wrong library or version mismatch?)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `bash'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f7259884c3b in kill () from /usr/lib/libc.so.6
(gdb) bt full
#0  0x00007f7259884c3b in kill () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x000055abbf7c8469 in ?? ()
No symbol table info available.
#2  0x000055abbf7c8661 in termsig_sighandler ()
No symbol table info available.
#3  <signal handler called>
No symbol table info available.
#4  0x00007f72599a2ffd in ?? () from /usr/lib/libc.so.6
No symbol table info available.
#5  0x00007f7259a6ecbc in rl_tilde_expand () from /usr/lib/libreadline.so.8
No symbol table info available.
#6  0x000055abbf7d4190 in ?? ()
No symbol table info available.
#7  0x000055abbf7d49e0 in ?? ()
No symbol table info available.
#8  0x000055abbf846840 in ?? ()
No symbol table info available.
#9  0x000055abbf7d6580 in ?? ()
No symbol table info available.
#10 0x000055abbf7d6a40 in ?? ()
No symbol table info available.
#11 0x000055abbf7d3fe0 in ?? ()
No symbol table info available.
#12 0x000055abbf7d8c56 in initialize_readline ()
No symbol table info available.
#13 0x000055abbf77c41e in ?? ()
No symbol table info available.
#14 0x000055abbf77eb20 in ?? ()
No symbol table info available.
#15 0x000055abbf781e4a in ?? ()
No symbol table info available.
#16 0x000055abbf785232 in yyparse ()
No symbol table info available.
#17 0x000055abbf77b869 in parse_command ()
No symbol table info available.
#18 0x000055abbf77b9f4 in read_command ()
No symbol table info available.
#19 0x000055abbf77bc1c in reader_loop ()
No symbol table info available.
#20 0x000055abbf77a8e2 in main ()
No symbol table info available.
(gdb)

Offline

#7 2022-11-01 01:12:47

SolidWater
Member
Registered: 2022-10-30
Posts: 7

Re: [SOLVED] bash Segmentation fault (core dumped)

seth, hope the provided information helps.

I kind of seeing the problem may be from:   #5  0x00007f7259a6ecbc _rl_init_locale (libreadline.so.8 + 0x36cbc)
But I'm not really sure I understand more tongue

Please let me know if I can provide further information.

PS: I haven't really tried to learn zsh, but I guess I should smile

Offline

#8 2022-11-01 01:25:13

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,592

Re: [SOLVED] bash Segmentation fault (core dumped)

Offline

#9 2022-11-01 03:21:21

SolidWater
Member
Registered: 2022-10-30
Posts: 7

Re: [SOLVED] bash Segmentation fault (core dumped)

Thanks, seth and Scimmia, for all the help and information.

I updated and readline-8.2.001-1 has fixed the issue indeed.

Offline

#10 2022-11-01 07:16:29

seth
Member
Registered: 2012-09-03
Posts: 51,560

Re: [SOLVED] bash Segmentation fault (core dumped)

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Since the crash seems linked to a broken locale, you might want to look into that:

localectl; locale; locale -a

Offline

#11 2022-11-02 02:59:50

SolidWater
Member
Registered: 2022-10-30
Posts: 7

Re: [SOLVED] bash Segmentation fault (core dumped)

[~] localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a
[~] locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
[~] locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
[~]

A bit research, and I uncommented en_US.UTF-8 from locale.gen and ran locale-gen
Then no more error message:

[~] localectl; locale; locale -a
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
C
C.UTF-8
en_US.utf8
POSIX
[~]

Offline

Board footer

Powered by FluxBB