Debian Bug report logs -
#1021109
bash: non existent locale crashes bash
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, koster@debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#1021062; Package libc6.
(Sat, 01 Oct 2022 12:03:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Kan-Ru Chen <koster@debian.org>:
New Bug report received and forwarded. Copy sent to koster@debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>.
(Sat, 01 Oct 2022 12:03:04 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: libc6
Version: 2.35-1
Severity: grave
Justification: renders package unusable
X-Debbugs-Cc: koster@debian.org
Dear maintainer,
After upgrading to libc6 2.35-1 (or 2.36-1 in experimental), nonexistent locale setting
starts to crash the system.
This is dangerous because a remote system might not always have the same locale installed.
An auto update will soft-brick the system unless the sysadmin knows to set their LC_ALL=POSIX
before attempting to ssh.
Steps to reproduce:
From a clean installed Debian sid, upgrade to libc6 2.35-1.
Only install C locale and en_US.UTF-8.
$ LC_ALL=ja_JP.UTF-8 bash
bash: warning: setlocale: LC_ALL: cannot change locale (ja_JP.UTF-8)
Segmentation fault (core dumped)
$ LC_ALL=ja_JP.UTF-8 gdb bash
Fatal signal: Segmentation fault
----- Backtrace -----
0x55ed3e1e8dcf ???
0x55ed3e2df312 ???
0x55ed3e2df488 ???
0x7f0b4a39ba9f ???
0x7f0b4b412204 _rl_init_locale
0x7f0b4b4122f1 _rl_init_eightbit
0x7f0b4b3f10f2 rl_initialize
... snip ...
Downgrade to 2.34-8 seems also don't fix the issue, probably some locale
state was invalidated when upgrading.
Thanks,
Kan-Ru
-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 5.19.0-2-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages libc6 depends on:
ii libgcc-s1 12.2.0-3
Versions of packages libc6 recommends:
ii libidn2-0 2.3.3-1+b1
Versions of packages libc6 suggests:
ii debconf [debconf-2.0] 1.5.79
pn glibc-doc <none>
ii libc-l10n 2.35-1
pn libnss-nis <none>
pn libnss-nisplus <none>
ii locales 2.35-1
-- debconf information:
glibc/kernel-too-old:
glibc/restart-failed:
glibc/disable-screensaver:
glibc/upgrade: true
* libraries/restart-without-asking: false
* glibc/restart-services: cron
glibc/kernel-not-supported:
Information forwarded
to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#1021062; Package libc6.
(Sat, 01 Oct 2022 17:00:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Aurelien Jarno <aurelien@aurel32.net>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>.
(Sat, 01 Oct 2022 17:00:02 GMT) (full text, mbox, link).
Message #10 received at 1021062@bugs.debian.org (full text, mbox, reply):
control: reassign -1 bash
control: found -1 bash/5.2-1
Hi,
On 2022-10-01 21:01, Kan-Ru Chen wrote:
> Package: libc6
> Version: 2.35-1
> Severity: grave
> Justification: renders package unusable
> X-Debbugs-Cc: koster@debian.org
>
> Dear maintainer,
>
> After upgrading to libc6 2.35-1 (or 2.36-1 in experimental), nonexistent locale setting
> starts to crash the system.
>
> This is dangerous because a remote system might not always have the same locale installed.
> An auto update will soft-brick the system unless the sysadmin knows to set their LC_ALL=POSIX
> before attempting to ssh.
>
> Steps to reproduce:
>
> >From a clean installed Debian sid, upgrade to libc6 2.35-1.
> Only install C locale and en_US.UTF-8.
>
> $ LC_ALL=ja_JP.UTF-8 bash
> bash: warning: setlocale: LC_ALL: cannot change locale (ja_JP.UTF-8)
> Segmentation fault (core dumped)
>
> $ LC_ALL=ja_JP.UTF-8 gdb bash
>
> Fatal signal: Segmentation fault
> ----- Backtrace -----
> 0x55ed3e1e8dcf ???
> 0x55ed3e2df312 ???
> 0x55ed3e2df488 ???
> 0x7f0b4a39ba9f ???
> 0x7f0b4b412204 _rl_init_locale
> 0x7f0b4b4122f1 _rl_init_eightbit
> 0x7f0b4b3f10f2 rl_initialize
> ... snip ...
FYI, this is the full backtrace with the debug packages installed:
#0 0x00007f8079d0ccc7 in __GI_kill () at ../sysdeps/unix/syscall-template.S:120
#1 0x0000559be26519c9 in termsig_handler (sig=11) at .././sig.c:625
#2 0x0000559be2651c21 in termsig_handler (sig=<optimized out>) at .././sig.c:492
#3 termsig_sighandler (sig=<optimized out>) at .././sig.c:547
#4 <signal handler called>
#5 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
#6 0x0000559be26b8682 in _rl_init_locale () at ../../.././lib/readline/nls.c:150
#7 0x0000559be26b8772 in _rl_init_eightbit () at ../../.././lib/readline/nls.c:227
#8 0x0000559be269766e in readline_initialize_everything () at ../../.././lib/readline/readline.c:1292
#9 rl_initialize () at ../../.././lib/readline/readline.c:1183
#10 0x0000559be2662b05 in initialize_readline () at .././bashline.c:522
#11 0x0000559be26040a5 in yy_readline_get () at /usr/local/src/chet/src/bash/src/parse.y:1514
#12 0x0000559be2606aa1 in yy_getc () at /usr/local/src/chet/src/bash/src/parse.y:1462
#13 shell_getc (remove_quoted_newline=remove_quoted_newline@entry=1) at /usr/local/src/chet/src/bash/src/parse.y:2393
#14 0x0000559be2608eeb in read_token (command=0) at /usr/local/src/chet/src/bash/src/parse.y:3400
#15 0x0000559be260d05b in yylex () at /usr/local/src/chet/src/bash/src/parse.y:2890
#16 yyparse () at ./build-bash/y.tab.c:1854
#17 0x0000559be2603586 in parse_command () at .././eval.c:348
#18 0x0000559be2603714 in read_command () at .././eval.c:392
#19 0x0000559be26038c6 in reader_loop () at .././eval.c:139
#20 0x0000559be26023b5 in main (argc=1, argv=0x7ffe3da22078, env=0x7ffe3da22088) at .././shell.c:833
So the problem is that _rl_init_locale (from bash) calls strlen(NULL).
> Downgrade to 2.34-8 seems also don't fix the issue, probably some locale
> state was invalidated when upgrading.
This is because you upgraded other packages than glibc (here bash), and the bug
is not in glibc. Downgrading bash fixes the issue. Reassigning the bug.
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
Bug reassigned from package 'libc6' to 'bash'.
Request was from Aurelien Jarno <aurelien@aurel32.net>
to 1021062-submit@bugs.debian.org.
(Sat, 01 Oct 2022 17:00:02 GMT) (full text, mbox, link).
No longer marked as found in versions glibc/2.35-1.
Request was from Aurelien Jarno <aurelien@aurel32.net>
to 1021062-submit@bugs.debian.org.
(Sat, 01 Oct 2022 17:00:03 GMT) (full text, mbox, link).
Marked as found in versions bash/5.2-1.
Request was from Aurelien Jarno <aurelien@aurel32.net>
to 1021062-submit@bugs.debian.org.
(Sat, 01 Oct 2022 17:00:03 GMT) (full text, mbox, link).
Changed Bug title to 'bash: non existent locale crashes bash' from 'libc6: nonexistent locale crashes programs (for example, bash, gdb, ...)'.
Request was from Aurelien Jarno <aurel32@debian.org>
to control@bugs.debian.org.
(Sat, 01 Oct 2022 17:57:06 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#1021062; Package bash.
(Sat, 01 Oct 2022 22:33:04 GMT) (full text, mbox, link).
Acknowledgement sent
to "Kan-Ru Chen" <koster@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>.
(Sat, 01 Oct 2022 22:33:04 GMT) (full text, mbox, link).
Message #23 received at 1021062@bugs.debian.org (full text, mbox, reply):
reassign 1021062 libreadline8
found 1021062 libreadline8/8.2-1
thanks
On Sun, Oct 2, 2022, at 1:56 AM, Aurelien Jarno wrote:
> control: reassign -1 bash
> control: found -1 bash/5.2-1
>
> Hi,
>
> On 2022-10-01 21:01, Kan-Ru Chen wrote:
>> Package: libc6
>> Version: 2.35-1
>> Severity: grave
>> Justification: renders package unusable
>> X-Debbugs-Cc: koster@debian.org
>>
>> Dear maintainer,
>>
>> After upgrading to libc6 2.35-1 (or 2.36-1 in experimental), nonexistent locale setting
>> starts to crash the system.
>>
>> This is dangerous because a remote system might not always have the same locale installed.
>> An auto update will soft-brick the system unless the sysadmin knows to set their LC_ALL=POSIX
>> before attempting to ssh.
>>
>> Steps to reproduce:
>>
>> >From a clean installed Debian sid, upgrade to libc6 2.35-1.
>> Only install C locale and en_US.UTF-8.
>>
>> $ LC_ALL=ja_JP.UTF-8 bash
>> bash: warning: setlocale: LC_ALL: cannot change locale (ja_JP.UTF-8)
>> Segmentation fault (core dumped)
>>
>> $ LC_ALL=ja_JP.UTF-8 gdb bash
>>
>> Fatal signal: Segmentation fault
>> ----- Backtrace -----
>> 0x55ed3e1e8dcf ???
>> 0x55ed3e2df312 ???
>> 0x55ed3e2df488 ???
>> 0x7f0b4a39ba9f ???
>> 0x7f0b4b412204 _rl_init_locale
>> 0x7f0b4b4122f1 _rl_init_eightbit
>> 0x7f0b4b3f10f2 rl_initialize
>> ... snip ...
>
> FYI, this is the full backtrace with the debug packages installed:
>
> #0 0x00007f8079d0ccc7 in __GI_kill () at
> ../sysdeps/unix/syscall-template.S:120
> #1 0x0000559be26519c9 in termsig_handler (sig=11) at .././sig.c:625
> #2 0x0000559be2651c21 in termsig_handler (sig=<optimized out>) at
> .././sig.c:492
> #3 termsig_sighandler (sig=<optimized out>) at .././sig.c:547
> #4 <signal handler called>
> #5 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
> #6 0x0000559be26b8682 in _rl_init_locale () at
> ../../.././lib/readline/nls.c:150
> #7 0x0000559be26b8772 in _rl_init_eightbit () at
> ../../.././lib/readline/nls.c:227
> #8 0x0000559be269766e in readline_initialize_everything () at
> ../../.././lib/readline/readline.c:1292
> #9 rl_initialize () at ../../.././lib/readline/readline.c:1183
> #10 0x0000559be2662b05 in initialize_readline () at .././bashline.c:522
> #11 0x0000559be26040a5 in yy_readline_get () at
> /usr/local/src/chet/src/bash/src/parse.y:1514
> #12 0x0000559be2606aa1 in yy_getc () at
> /usr/local/src/chet/src/bash/src/parse.y:1462
> #13 shell_getc (remove_quoted_newline=remove_quoted_newline@entry=1) at
> /usr/local/src/chet/src/bash/src/parse.y:2393
> #14 0x0000559be2608eeb in read_token (command=0) at
> /usr/local/src/chet/src/bash/src/parse.y:3400
> #15 0x0000559be260d05b in yylex () at
> /usr/local/src/chet/src/bash/src/parse.y:2890
> #16 yyparse () at ./build-bash/y.tab.c:1854
> #17 0x0000559be2603586 in parse_command () at .././eval.c:348
> #18 0x0000559be2603714 in read_command () at .././eval.c:392
> #19 0x0000559be26038c6 in reader_loop () at .././eval.c:139
> #20 0x0000559be26023b5 in main (argc=1, argv=0x7ffe3da22078,
> env=0x7ffe3da22088) at .././shell.c:833
>
> So the problem is that _rl_init_locale (from bash) calls strlen(NULL).
>
>> Downgrade to 2.34-8 seems also don't fix the issue, probably some locale
>> state was invalidated when upgrading.
>
> This is because you upgraded other packages than glibc (here bash), and the bug
> is not in glibc. Downgrading bash fixes the issue. Reassigning the bug.
Thanks!
That explains why not all programs crash like this. The common library they used is
libreadline and I confirmed downgrade libreadline8 to 8.2~rc2-2 fixed the issue.
Reassigning to libreadline8.
--
Kan-Ru Chen
Debian Developer
Bug reassigned from package 'bash' to 'libreadline8'.
Request was from "Kan-Ru Chen" <koster@debian.org>
to control@bugs.debian.org.
(Sat, 01 Oct 2022 22:33:06 GMT) (full text, mbox, link).
No longer marked as found in versions bash/5.2-1.
Request was from "Kan-Ru Chen" <koster@debian.org>
to control@bugs.debian.org.
(Sat, 01 Oct 2022 22:33:06 GMT) (full text, mbox, link).
Marked as found in versions libreadline8/8.2-1.
Request was from "Kan-Ru Chen" <koster@debian.org>
to control@bugs.debian.org.
(Sat, 01 Oct 2022 22:33:06 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#1021062; Package libreadline8.
(Sun, 02 Oct 2022 08:51:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Aurelien Jarno <aurel32@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>.
(Sun, 02 Oct 2022 08:51:04 GMT) (full text, mbox, link).
Message #34 received at 1021062@bugs.debian.org (full text, mbox, reply):
control: clone 1021062 -1
control: reassign -1 bash
control: found -1 bash/5.2-1
Hi,
On 2022-10-02 07:27, Kan-Ru Chen wrote:
> reassign 1021062 libreadline8
> found 1021062 libreadline8/8.2-1
> thanks
>
> On Sun, Oct 2, 2022, at 1:56 AM, Aurelien Jarno wrote:
> > control: reassign -1 bash
> > control: found -1 bash/5.2-1
> >
> > Hi,
> >
> > On 2022-10-01 21:01, Kan-Ru Chen wrote:
> >> Package: libc6
> >> Version: 2.35-1
> >> Severity: grave
> >> Justification: renders package unusable
> >> X-Debbugs-Cc: koster@debian.org
> >>
> >> Dear maintainer,
> >>
> >> After upgrading to libc6 2.35-1 (or 2.36-1 in experimental), nonexistent locale setting
> >> starts to crash the system.
> >>
> >> This is dangerous because a remote system might not always have the same locale installed.
> >> An auto update will soft-brick the system unless the sysadmin knows to set their LC_ALL=POSIX
> >> before attempting to ssh.
> >>
> >> Steps to reproduce:
> >>
> >> >From a clean installed Debian sid, upgrade to libc6 2.35-1.
> >> Only install C locale and en_US.UTF-8.
> >>
> >> $ LC_ALL=ja_JP.UTF-8 bash
> >> bash: warning: setlocale: LC_ALL: cannot change locale (ja_JP.UTF-8)
> >> Segmentation fault (core dumped)
> >>
> >> $ LC_ALL=ja_JP.UTF-8 gdb bash
> >>
> >> Fatal signal: Segmentation fault
> >> ----- Backtrace -----
> >> 0x55ed3e1e8dcf ???
> >> 0x55ed3e2df312 ???
> >> 0x55ed3e2df488 ???
> >> 0x7f0b4a39ba9f ???
> >> 0x7f0b4b412204 _rl_init_locale
> >> 0x7f0b4b4122f1 _rl_init_eightbit
> >> 0x7f0b4b3f10f2 rl_initialize
> >> ... snip ...
> >
> > FYI, this is the full backtrace with the debug packages installed:
> >
> > #0 0x00007f8079d0ccc7 in __GI_kill () at
> > ../sysdeps/unix/syscall-template.S:120
> > #1 0x0000559be26519c9 in termsig_handler (sig=11) at .././sig.c:625
> > #2 0x0000559be2651c21 in termsig_handler (sig=<optimized out>) at
> > .././sig.c:492
> > #3 termsig_sighandler (sig=<optimized out>) at .././sig.c:547
> > #4 <signal handler called>
> > #5 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
> > #6 0x0000559be26b8682 in _rl_init_locale () at
> > ../../.././lib/readline/nls.c:150
> > #7 0x0000559be26b8772 in _rl_init_eightbit () at
> > ../../.././lib/readline/nls.c:227
> > #8 0x0000559be269766e in readline_initialize_everything () at
> > ../../.././lib/readline/readline.c:1292
> > #9 rl_initialize () at ../../.././lib/readline/readline.c:1183
> > #10 0x0000559be2662b05 in initialize_readline () at .././bashline.c:522
> > #11 0x0000559be26040a5 in yy_readline_get () at
> > /usr/local/src/chet/src/bash/src/parse.y:1514
> > #12 0x0000559be2606aa1 in yy_getc () at
> > /usr/local/src/chet/src/bash/src/parse.y:1462
> > #13 shell_getc (remove_quoted_newline=remove_quoted_newline@entry=1) at
> > /usr/local/src/chet/src/bash/src/parse.y:2393
> > #14 0x0000559be2608eeb in read_token (command=0) at
> > /usr/local/src/chet/src/bash/src/parse.y:3400
> > #15 0x0000559be260d05b in yylex () at
> > /usr/local/src/chet/src/bash/src/parse.y:2890
> > #16 yyparse () at ./build-bash/y.tab.c:1854
> > #17 0x0000559be2603586 in parse_command () at .././eval.c:348
> > #18 0x0000559be2603714 in read_command () at .././eval.c:392
> > #19 0x0000559be26038c6 in reader_loop () at .././eval.c:139
> > #20 0x0000559be26023b5 in main (argc=1, argv=0x7ffe3da22078,
> > env=0x7ffe3da22088) at .././shell.c:833
> >
> > So the problem is that _rl_init_locale (from bash) calls strlen(NULL).
> >
> >> Downgrade to 2.34-8 seems also don't fix the issue, probably some locale
> >> state was invalidated when upgrading.
> >
> > This is because you upgraded other packages than glibc (here bash), and the bug
> > is not in glibc. Downgrading bash fixes the issue. Reassigning the bug.
>
> Thanks!
>
> That explains why not all programs crash like this. The common library they used is
> libreadline and I confirmed downgrade libreadline8 to 8.2~rc2-2 fixed the issue.
> Reassigning to libreadline8.
I did the test of downgrading bash yesterday (i.e. without downgrading
libreadline8), and it fixes the issue you reported with bash. It appears
that bash has an embedded copy of readline, hence the issue with both. I
am therefore cloning the bug to bash.
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
Bug 1021062 cloned as bug 1021109
Request was from Aurelien Jarno <aurel32@debian.org>
to 1021062-submit@bugs.debian.org.
(Sun, 02 Oct 2022 08:51:05 GMT) (full text, mbox, link).
Bug reassigned from package 'libreadline8' to 'bash'.
Request was from Aurelien Jarno <aurel32@debian.org>
to 1021062-submit@bugs.debian.org.
(Sun, 02 Oct 2022 08:51:05 GMT) (full text, mbox, link).
No longer marked as found in versions libreadline8/8.2-1.
Request was from Aurelien Jarno <aurel32@debian.org>
to 1021062-submit@bugs.debian.org.
(Sun, 02 Oct 2022 08:51:06 GMT) (full text, mbox, link).
Marked as found in versions bash/5.2-1.
Request was from Aurelien Jarno <aurel32@debian.org>
to 1021062-submit@bugs.debian.org.
(Sun, 02 Oct 2022 08:51:06 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#1021109; Package bash.
(Sat, 15 Oct 2022 11:48:05 GMT) (full text, mbox, link).
Acknowledgement sent
to Adrian Bunk <bunk@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>.
(Sat, 15 Oct 2022 11:48:05 GMT) (full text, mbox, link).
Message #49 received at 1021109@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Control: tags 1021109 + patch
Control: tags 1021109 + pending
Dear maintainer,
I've prepared an NMU for bash (versioned as 5.2-1.1) and uploaded
it to DELAYED/15. Please feel free to tell me if I should cancel it.
cu
Adrian
[bash-5.2-1.1-nmu.diff (text/x-diff, attachment)]
Added tag(s) patch.
Request was from Adrian Bunk <bunk@debian.org>
to 1021109-submit@bugs.debian.org.
(Sat, 15 Oct 2022 11:48:05 GMT) (full text, mbox, link).
Added tag(s) pending.
Request was from Adrian Bunk <bunk@debian.org>
to 1021109-submit@bugs.debian.org.
(Sat, 15 Oct 2022 11:48:06 GMT) (full text, mbox, link).
Reply sent
to Adrian Bunk <bunk@debian.org>:
You have taken responsibility.
(Sat, 29 Oct 2022 00:21:04 GMT) (full text, mbox, link).
Notification sent
to Kan-Ru Chen <koster@debian.org>:
Bug acknowledged by developer.
(Sat, 29 Oct 2022 00:21:04 GMT) (full text, mbox, link).
Message #58 received at 1021109-done@bugs.debian.org (full text, mbox, reply):
Version: 5.2-2
bash (5.2-2) unstable; urgency=medium
* Apply upstream patches 001 - 002.
...
- Starting bash with an invalid locale specification for
LC_ALL/LANG/LC_CTYPE can cause the shell to crash. Closes: #1021062.
-- Matthias Klose <doko@debian.org> Mon, 24 Oct 2022 10:34:28 +0200
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Sat, 26 Nov 2022 07:25:01 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Wed Dec 6 08:37:40 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.