Discussion:
Bug#1018881: glibc: iconv not working properly on m68k and sh4
(too old to reply)
John Paul Adrian Glaubitz
2022-09-01 10:50:01 UTC
Permalink
Source: glibc
Version: 2.34-7
Severity: normal
User: debian-***@lists.debian.org
Usertags: m68k sh4
X-Debbugs-Cc: debian-***@lists.debian.org,debian-***@lists.debian.org

Hello!

iconv stopped working on m68k and sh4 starting with glibc 2.34 and
I have no clue why. The issue can be reproduced on real hardware
qemu-user and qemu-system.

The problem becomes visible when the configure script of the gettext
package is being run on the affected architectures:

checking for iconv... yes
checking for working iconv... no
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for inttypes.h... (cached) yes
checking for limits.h... (cached) yes

The configure script runs a small program which I have extracted and
attached to this bug report as iconv.c.

Running it on amd64 returns a zero exit code:

(sid-amd64-sbuild)***@nofan:/# gcc -o iconv iconv.c -lc
(sid-amd64-sbuild)***@nofan:/# ./iconv
(sid-amd64-sbuild)***@nofan:/# echo $?

0
(sid-amd64-sbuild)***@nofan:/#

On m68k and sh4, the exit code is 16 which is why the above configure
check fails:

***@tirpitz:~$ uname -a
Linux tirpitz 5.11.0-rc4-00012-g10c03c5bf422 #161 PREEMPT Mon Jan 18 21:10:17 CET 2021 sh4a GNU/Linux
***@tirpitz:~$ gcc -o iconv iconv.c -lc
***@tirpitz:~$ ./iconv
***@tirpitz:~$ echo $?
16
***@tirpitz:~$

I have run out of ideas why iconv fails, so I was wondering whether this might
be a packaging issue. I have found a similar iconv issue being discussed on a
Fedora mailing list where the cause was iconv data being moved out of the main
glibc packages [1].

Maybe we have a similar problem in Debian which manifests on m68k and sh4 only
due to some reverse dependencies being out of date?

Thanks,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2022-09-02 05:40:01 UTC
Permalink
Hi!
The problem is that the
/usr/lib/m68k-linux-gnu/gconv/gconv-modules.cache file is somehow
truncated for the glibc 2.34 build. Running iconvconfig by hand to
generate it fixes the issue.
It seems to be the right size for the glibc 2.35 build.
Yes, running iconvconfig manually fixes the problem indeed. Now I just
need to figure out why the file is truncated in the first place.

Thanks,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Aurelien Jarno
2022-09-02 16:50:01 UTC
Permalink
control: tag -1 + unreproducible
Post by John Paul Adrian Glaubitz
Hi!
The problem is that the
/usr/lib/m68k-linux-gnu/gconv/gconv-modules.cache file is somehow
truncated for the glibc 2.34 build. Running iconvconfig by hand to
generate it fixes the issue.
It seems to be the right size for the glibc 2.35 build.
Yes, running iconvconfig manually fixes the problem indeed. Now I just
need to figure out why the file is truncated in the first place.
I ran a build on mitchy.debian.net and the file is correctly generated.
Is there anything different on the buildds?

Cheers,
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
***@aurel32.net http://www.aurel32.net
John Paul Adrian Glaubitz
2022-09-04 06:10:01 UTC
Permalink
Hello!
Post by Aurelien Jarno
I ran a build on mitchy.debian.net and the file is correctly generated.
Is there anything different on the buildds?
The buildds use qemu-user while mitchy uses qemu-system. The issue might be
a result of the getdents issue in glibc [1]. I have uploaded a glibc package with
the patch set included to unreleased in any case.

Adrian
Post by Aurelien Jarno
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=23960
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Loading...