Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 674338 - app-admin/systemrescuecd-x86-5.3.2 with dev-util/dialog-1.3.20181107 - usb_inst.sh: dialog: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Summary: app-admin/systemrescuecd-x86-5.3.2 with dev-util/dialog-1.3.20181107 - usb_in...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-02 16:28 UTC by Juergen Rose
Modified: 2019-01-12 08:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dialog-x86-systemrescuecd (dialog-x86-systemrescuecd,736.60 KB, application/octet-stream)
2019-01-04 11:35 UTC, Sergei Trofimovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2019-01-02 16:28:11 UTC
I insert an USB stick:

root@cheetahnew:/mnt/systemrescuecd(21)# dmesg | tail
[394343.080607] scsi host4: usb-storage 1-1.4:1.0
[394344.264542] scsi 4:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
[394344.264845] sd 4:0:0:0: Attached scsi generic sg3 type 0
[394344.265419] sd 4:0:0:0: [sdc] 7913472 512-byte logical blocks: (4.05 GB/3.77 GiB)
[394344.266164] sd 4:0:0:0: [sdc] Write Protect is off
[394344.266170] sd 4:0:0:0: [sdc] Mode Sense: 43 00 00 00
[394344.266904] sd 4:0:0:0: [sdc] No Caching mode page found
[394344.266907] sd 4:0:0:0: [sdc] Assuming drive cache: write through
[394344.272042]  sdc: sdc1
[394344.274911] sd 4:0:0:0: [sdc] Attached SCSI removable disk


I try to run usb_inst.sh, it fails with:

root@cheetahnew:/mnt/systemrescuecd(22)# ./usb_inst.sh 
Device [/dev/sdc] detected as [JetFlash Transcend 4GB   ] is removable and size=3864MB
* Device [/dev/sdc] is mounted: cannot use it
All valid USB/Removable devices are currently mounted, unmount these devices first


/dev/sdc1 is mounted:

root@cheetahnew:/mnt/systemrescuecd(23)# df | grep sdc
/dev/sdc1           3947984      4   3947980   1% /run/media/rose/F46C-F438


I unmount /dev/sdc1 , and try usb_inst.sh again:

root@cheetahnew:/mnt/systemrescuecd(24)# umount /dev/sdc1
root@cheetahnew:/mnt/systemrescuecd(25)# ./usb_inst.sh 
Device [/dev/sdc] detected as [JetFlash Transcend 4GB   ] is removable and size=3864MB
* Device [/dev/sdc] is not mounted
dialog: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
./usb_inst.sh: line 491:  4496 Aborted                 (core dumped) ${PROG_DIALOG} --infobox "$1" 20 75
dialog: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
./usb_inst.sh: line 491:  4499 Aborted                 (core dumped) ${PROG_DIALOG} --infobox "$1" 20 75


Reemerging "dev-util/dialog" did not help.
Comment 1 Jeroen Roovers gentoo-dev 2019-01-04 06:12:50 UTC
loadlocale.c is from glibc. It doesn't appear to be dev-util/dialog that is failing.
Comment 2 Sergei Trofimovich gentoo-dev 2019-01-04 10:33:42 UTC
Is there a reproducer for toolchain@ outside of systemrescuecd?
Comment 3 Sergei Trofimovich gentoo-dev 2019-01-04 11:31:48 UTC
Reproduced it locally after downloading systemrescuecd .iso.

./usb_inst.sh is running statically linked 'dialog' binary:

$ file /var/tmp/usb_inst.tmp/dialog
    /var/tmp/usb_inst.tmp/dialog: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, stripped

and attempts to load locale data from host. If libc versions don't match (x86 vs amd64) loading locale-archive will not succeed.

As a workaround I suggest forcing C locale as:
    LANG=C ./usb_inst.sh

Given that ./usb_inst.sh does not have localisation support it could as well contain
    LANG=C
    export LANG
to sanitize the environment.

We can look at better error handling on glibc side but it won't fix static binary as it already embeds old libc.

Looks like this dialog binary was built with gcc-4.4.4-r1 (added in Gentoo in 2011). Don't know which glibc version is that. Perhaps something around 2.12.
Comment 4 Sergei Trofimovich gentoo-dev 2019-01-04 11:35:52 UTC
Created attachment 559766 [details]
dialog-x86-systemrescuecd
Comment 5 Sergei Trofimovich gentoo-dev 2019-01-04 11:41:00 UTC
> We can look at better error handling on glibc side but it won't fix static
> binary as it already embeds old libc.

glibc was fixed in 2015 as:
    https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=0062ace2292effc4135c15ea99b1931fea5e0203

Relinking dialog against glibc-2.23 or newer should be enough.
Comment 6 Juergen Rose 2019-01-04 19:00:19 UTC
(In reply to Sergei Trofimovich from comment #3)
> Reproduced it locally after downloading systemrescuecd .iso.
> 
> ./usb_inst.sh is running statically linked 'dialog' binary:
> 
> $ file /var/tmp/usb_inst.tmp/dialog
>     /var/tmp/usb_inst.tmp/dialog: ELF 32-bit LSB executable, Intel 80386,
> version 1 (GNU/Linux), statically linked, stripped
> 
> and attempts to load locale data from host. If libc versions don't match
> (x86 vs amd64) loading locale-archive will not succeed.
> 
> As a workaround I suggest forcing C locale as:
>     LANG=C ./usb_inst.sh

Thanks, 'LANG=C ./usb_inst.sh' worked.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-01-05 13:01:02 UTC
@Juergen: For the record, the .iso file we're installing with USE=isohybrid is USB-friendly, so you can just 'dd' it into your stick.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-01-12 08:41:56 UTC
I've tried reporting this upstream but their official support channel seem to be the forum, and it doesn't allow registering new accounts.  I've also tried contacting the maintainer via sf mail but with no response so far.  If someone's got account on the Forums, I'd appreciate proxying this bug.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-01-12 08:42:20 UTC
(In reply to Michał Górny from comment #8)
> I've tried reporting this upstream but their official support channel seem
> to be the forum, and it doesn't allow registering new accounts.  I've also
> tried contacting the maintainer via sf mail but with no response so far.  If
> someone's got account on the Forums, I'd appreciate proxying this bug.

( http://forums.system-rescue-cd.org/ )