Debian Bug report logs - #636286
eglibc: SIGSEGV in strcoll in UTF-8 locales with certain characters

version graph

Package: src:eglibc; Maintainer for src:eglibc is GNU Libc Maintainers <debian-glibc@lists.debian.org>;

Reported by: Thorsten Glaser <tg@mirbsd.de>

Date: Mon, 1 Aug 2011 23:57:12 UTC

Severity: normal

Tags: wontfix

Found in version eglibc/2.13-11

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, tg@mirbsd.de, debian-68k@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Mon, 01 Aug 2011 23:57:15 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <tg@mirbsd.de>:
New Bug report received and forwarded. Copy sent to tg@mirbsd.de, debian-68k@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 01 Aug 2011 23:57:15 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <tg@mirbsd.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: eglibc: SIGSEGV in strcoll in UTF-8 locales with certain characters
Date: Mon, 01 Aug 2011 23:56:36 +0000
Source: eglibc
Version: 2.13-11
Severity: normal

(Only normal severity because this doesn't happen on i386)

root@aranym:~ # LC_ALL=C ./sfl; echo $?
1
root@aranym:~ # LC_ALL=CUT ./sfl; echo $?
sfl: setlocale: No such file or directory
4
root@aranym:~ # LC_ALL=C.UTF-8 ./sfl; echo $?
Segmentation fault
139

Works with no or a nonexistent locale, but not with
a UTF-8 locale. The problem was found in the code of
localechooser (a d-i component which runs sort over
native language lists at build).

Program received signal SIGSEGV, Segmentation fault.
0xc0094940 in findidx (s1=0x80000556 " ব", s2=0x8000055b " ভ", l=0xc0145990) at ../locale/weight.h:126
126               return indirect[-i + offset];
(gdb) bt
#0  0xc0094940 in findidx (s1=0x80000556 " ব", s2=0x8000055b " ভ", l=0xc0145990) at ../locale/weight.h:126
#1  __strcoll_l (s1=0x80000556 " ব", s2=0x8000055b " ভ", l=0xc0145990) at strcoll_l.c:213
#2  0xc008f960 in strcoll (s1=0x80000556 " ব", s2=0x8000055b " ভ") at strcoll.c:37
#3  0x8000048e in main () at sfl.c:16
(gdb) print indirect
$1 = <value optimized out>
(gdb) print i
$2 = <value optimized out>
(gdb) print offset
$3 = <value optimized out>

I’ve got libc6-dbg installed, but it doesn’t seem to pick that
up, even with LD_LIBRARY_PATH=/usr/lib/debug/lib/m68k-linux-gnu
set. It does however load the symbols:

Reading symbols from /lib/m68k-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug/lib/m68k-linux-gnu/libc-2.13.so...done.   

I had to manually unpack and quilt push -a the source to get this
far, though. How am I supposed to use the libc6-dbg package then?

The error does NOT occur if the test programme is linked statically.

By preventing inlining and handcompiling strcoll_l.c with a
slightly adjusted (duplocale and __strcoll_l using) programme
I got this:

0x80000796 in findidx (cpp=0xefbc0728) at ../locale/weight.h:126
126               return indirect[-i + offset];
(gdb) print cpp
$1 = (const unsigned char **) 0xefbc0728
(gdb) print *cpp
$2 = (const unsigned char *) 0x8000107c "\246\254"
(gdb) x/4xb *cpp
0x8000107c <s1+2>:      0xa6    0xac    0x00    0x20
(gdb) print indirect
Cannot access memory at address 0xcda56b30
(gdb) print i
$3 = -1130053888
(gdb) print offset
$4 = <value optimized out>

Sorry, can’t debug this further.


https://wiki.debian.org/Aranym/Quick has an easy way to get a VM
image for testing.



-- System Information:
Debian Release: wheezy/sid
Architecture: m68k

Kernel: Linux 3.0.0-1-atari
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/mksh-static




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Tue, 02 Aug 2011 17:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Schwab <schwab@linux-m68k.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Tue, 02 Aug 2011 17:24:03 GMT) Full text and rfc822 format available.

Message #10 received at submit@bugs.debian.org (full text, mbox):

From: Andreas Schwab <schwab@linux-m68k.org>
To: Thorsten Glaser <tg@mirbsd.de>
Cc: 636286@bugs.debian.org, Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#636286: eglibc: SIGSEGV in strcoll in UTF-8 locales with certain characters
Date: Tue, 02 Aug 2011 19:20:22 +0200
There is no testcase.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Tue, 02 Aug 2011 17:24:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Schwab <schwab@linux-m68k.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Tue, 02 Aug 2011 17:24:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Tue, 02 Aug 2011 19:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <tg@mirbsd.de>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Tue, 02 Aug 2011 19:45:04 GMT) Full text and rfc822 format available.

Message #20 received at 636286@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <tg@mirbsd.de>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 636286@bugs.debian.org
Subject: Re: Bug#636286: eglibc: SIGSEGV in strcoll in UTF-8 locales with certain characters
Date: Tue, 2 Aug 2011 19:35:44 +0000 (UTC)
[Message part 1 (text/plain, inline)]
Andreas Schwab dixit:

>There is no testcase.

Meh, you know that when you say attach but forget to actually do it?
Thanks for spotting. Here it is.

bye,
//mirabilos
-- 
Support mksh as /bin/sh and RoQA dash NOW!
‣ src:bash (254 (273) bugs: 1 RC, 175 (190) I&N, 78 (82) M&W, 0 F&P)
‣ src:dash (82 (90) bugs: 3 RC, 44 (47) I&N, 35 (40) M&W, 0 F&P)
‣ src:mksh (2 bugs: 0 RC, 0 I&N, 2 M&W, 0 F&P)
[sfl.c (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Sun, 07 Aug 2011 19:00:23 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Schwab <schwab@linux-m68k.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 07 Aug 2011 19:00:23 GMT) Full text and rfc822 format available.

Message #25 received at submit@bugs.debian.org (full text, mbox):

From: Andreas Schwab <schwab@linux-m68k.org>
To: Thorsten Glaser <tg@mirbsd.de>
Cc: 636286@bugs.debian.org, Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#636286: eglibc: SIGSEGV in strcoll in UTF-8 locales with certain characters
Date: Sun, 07 Aug 2011 20:56:44 +0200
The locale files are invalid.  Since I cannot reproduce that with the
unmodified localedef program this must be due to some broken debian
patches.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Sun, 07 Aug 2011 19:00:29 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Schwab <schwab@linux-m68k.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 07 Aug 2011 19:00:29 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Sun, 07 Aug 2011 19:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <tg@mirbsd.de>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 07 Aug 2011 19:57:04 GMT) Full text and rfc822 format available.

Message #35 received at 636286@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <tg@mirbsd.de>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 636286@bugs.debian.org
Subject: Re: Bug#636286: eglibc: SIGSEGV in strcoll in UTF-8 locales with certain characters
Date: Sun, 7 Aug 2011 19:53:12 +0000 (UTC)
[Message part 1 (text/plain, inline)]
Andreas Schwab dixit:

>The locale files are invalid.  Since I cannot reproduce that with the
>unmodified localedef program this must be due to some broken debian
>patches.

Ouch. Probably, then. I just tried this:

root@aranym:~ # localedef -i en_US -c -f UTF-8 /root/L/en_BA.UTF-8
root@aranym:~ # LOCPATH=/root/L LC_ALL=en_BA.UTF-8 locale
LANG=C
LANGUAGE=
LC_CTYPE="en_BA.UTF-8"
LC_NUMERIC="en_BA.UTF-8"
LC_TIME="en_BA.UTF-8"
LC_COLLATE="en_BA.UTF-8"
LC_MONETARY="en_BA.UTF-8"
LC_MESSAGES="en_BA.UTF-8"
LC_PAPER="en_BA.UTF-8"
LC_NAME="en_BA.UTF-8"
LC_ADDRESS="en_BA.UTF-8"
LC_TELEPHONE="en_BA.UTF-8"
LC_MEASUREMENT="en_BA.UTF-8"
LC_IDENTIFICATION="en_BA.UTF-8"
LC_ALL=en_BA.UTF-8
root@aranym:~ # LOCPATH=/root/L LC_ALL=en_BA.UTF-8 ~/sfl; echo $?
Segmentation fault
139

I also confirmed the following files are unpatched by Debian:
-rw-r--r-- 1 root root 1721947 Aug  4 08:42 /usr/share/i18n/charmaps/UTF-8
-rw-r--r-- 1 root root    5577 Aug  4 08:42 /usr/share/i18n/locales/en_US
(although UTF-8 is installed gzip’d)

I’ve attached /root/L so you can diff with yours, I have no idea
which parts of eglibc to recompile or how to do so selectively
to weed out the broken patch.

https://wiki.debian.org/Aranym/Quick contains a VM image so the
Debian eglibc maintainers can easily reproduce and maybe fix it.

(In case you wonder, ba is Bosna i Hercegovina ;)

Thanks for your help,
//mirabilos
-- 
22:59⎜<Vutral> glaub ich termkit is kompliziert | glabe nicht das man
damit schneller arbeitet | reizüberflutung │ wie windows │ alles evil
zuviel bilder │ wie ein spiel | 23:00⎜<Vutral> die meisten raffen auch
nicht mehr von windows | 23:01⎜<Vutral> bilderbücher sind ja auch nich
wirklich verbreitet als erwachsenen literatur	‣ who needs GUIs thus?
[L.tgz (application/octet-stream, attachment)]

Added tag(s) wontfix. Request was from Aurelien Jarno <aurel32@debian.org> to control@bugs.debian.org. (Sat, 17 Dec 2011 14:42:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Sun, 01 Jan 2012 23:36:21 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <tg@mirbsd.de>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 01 Jan 2012 23:36:21 GMT) Full text and rfc822 format available.

Message #42 received at 636286@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <tg@mirbsd.de>
To: 636286@bugs.debian.org
Cc: debian-68k@lists.debian.org
Subject: Re: tagging 636286
Date: Sun, 1 Jan 2012 23:35:10 +0000 (UTC)
Aurelien Jarno dixit:

>tags 636286 + wontfix

Uhm, why? If someone working for glibc upstream says that the
locale files produced by the Debian patched version of glibc
are invalid…

>thanks

for doing so silently and with no reason. Maybe I should
indeed, as you expressed so nicely, stop to care about
open source projects.

//mirabilos
-- 
22:20⎜<asarch> The crazy that persists in his craziness becomes a master
22:21⎜<asarch> And the distance between the craziness and geniality is
only measured by the success 18:35⎜<asarch> "Psychotics are consistently
inconsistent. The essence of sanity is to be inconsistently inconsistent




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Sun, 01 Jan 2012 23:51:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 01 Jan 2012 23:51:07 GMT) Full text and rfc822 format available.

Message #47 received at 636286@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Thorsten Glaser <tg@mirbsd.de>
Cc: 636286@bugs.debian.org, debian-68k@lists.debian.org
Subject: Re: Bug#636286: tagging 636286
Date: Sun, 1 Jan 2012 17:48:46 -0600
Thorsten Glaser wrote:
> Aurelien Jarno dixit:

>> tags 636286 + wontfix
>
> Uhm, why? If someone working for glibc upstream says that the
> locale files produced by the Debian patched version of glibc
> are invalid…

The wontfix tag has a somewhat complicated role.  In practice, it
generally means that the people responsible for that package are not
going to be working on fixing this particular bug, and although that's
a kind of strange piece of metadata to maintain, I tend to find it
much more helpful than no response at all.

While it would have been even nicer if the maintainer had said why
and what avenues, if any, exist for helping out, I don't think that's
necessary.  Even for bugs marked wontfix, help investigating and
working towards a fix tends to be appreciated.

Sorry for the trouble and hope that helps,
Jonathan




Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#636286; Package src:eglibc. (Mon, 02 Jan 2012 01:27:07 GMT) Full text and rfc822 format available.

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>. (Mon, 02 Jan 2012 01:27:07 GMT) Full text and rfc822 format available.

Message #52 received at 636286@bugs.debian.org (full text, mbox):

From: Aurelien Jarno <aurelien@aurel32.net>
To: Thorsten Glaser <tg@mirbsd.de>, 636286@bugs.debian.org
Cc: debian-68k@lists.debian.org
Subject: Re: Bug#636286: tagging 636286
Date: Mon, 2 Jan 2012 02:23:43 +0100
On Sun, Jan 01, 2012 at 11:35:10PM +0000, Thorsten Glaser wrote:
> Aurelien Jarno dixit:
> 
> >tags 636286 + wontfix
> 
> Uhm, why? If someone working for glibc upstream says that the
> locale files produced by the Debian patched version of glibc
> are invalid…

This has only be seen so far on m68k. I don't plan to debug things on 
m68k, though *tested patches* are welcome.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 23:18:58 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.