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

2020-08-21 Thread John Paul Adrian Glaubitz
Hi!

On 8/21/20 9:33 PM, John Paul Adrian Glaubitz wrote:
> Could you check whether this bugs still persists? It's probably been fixed
> long time ago, hasn't it?

Looks like the bug is no longer reproducible:

root@pacman:~# cat sfl.c
#include 
#include 
#include 
#include 

const char s1[] = { 0x20, 0xe0, 0xa6, 0xac, 0x00 };
const char s2[] = { 0x20, 0xe0, 0xa6, 0xad, 0x00 };

int
main(void)
{
int r;

if (setlocale(LC_ALL, "") == NULL)
err(4, "setlocale");
r = strcoll(s1, s2);
return (r < 0 ? 1 : r == 0 ? 2 : 3);
}

root@pacman:~# gcc -o sfl sfl.c
root@pacman:~# LC_ALL=C.UTF-8 ./sfl; echo $?
1
root@pacman:~#

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



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

2020-08-21 Thread John Paul Adrian Glaubitz
User: debian-68klists.debian.org
Usertags: m68k
X-Debbugs-CC: debian-...@lists.debian.org

Hi Thorsten!

Could you check whether this bugs still persists? It's probably been fixed
long time ago, hasn't it?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



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

2011-08-07 Thread Andreas Schwab
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, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.



-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/m2pqkhoxsj@igel.home



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

2011-08-02 Thread Andreas Schwab
There is no testcase.

Andreas.

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



-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/m2pqknhgrt@igel.home



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

2011-08-02 Thread Thorsten Glaser
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) IN, 78 (82) MW, 0 FP)
‣ src:dash (82 (90) bugs: 3 RC, 44 (47) IN, 35 (40) MW, 0 FP)
‣ src:mksh (2 bugs: 0 RC, 0 IN, 2 MW, 0 FP)#include err.h
#include locale.h
#include stdlib.h
#include string.h

const char s1[] = { 0x20, 0xe0, 0xa6, 0xac, 0x00 };
const char s2[] = { 0x20, 0xe0, 0xa6, 0xad, 0x00 };

int
main(void)
{
int r;

if (setlocale(LC_ALL, ) == NULL)
err(4, setlocale);
r = strcoll(s1, s2);
return (r  0 ? 1 : r == 0 ? 2 : 3);
}


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

2011-08-01 Thread Thorsten Glaser
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=0x8556  ব, s2=0x855b  ভ, l=0xc0145990) at 
../locale/weight.h:126
126   return indirect[-i + offset];
(gdb) bt
#0  0xc0094940 in findidx (s1=0x8556  ব, s2=0x855b  ভ, 
l=0xc0145990) at ../locale/weight.h:126
#1  __strcoll_l (s1=0x8556  ব, s2=0x855b  ভ, l=0xc0145990) at 
strcoll_l.c:213
#2  0xc008f960 in strcoll (s1=0x8556  ব, s2=0x855b  ভ) at 
strcoll.c:37
#3  0x848e 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:

0x8796 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:  0xa60xac0x000x20
(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



-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20110801235636.31812.58475.report...@aranym.mirbsd.org