This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Reading compressed character maps and gzip EPIPE issues.
- From: Carlos O'Donell <carlos at redhat dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Cc: Paul Eggert <eggert at cs dot ucla dot edu>
- Date: Wed, 20 Nov 2019 23:43:32 -0500
- Subject: Reading compressed character maps and gzip EPIPE issues.
In locale/programs/charmap-dir.c:fopen_uncompressed we invoke
gzip via posix_spawnp to decompress the character maps.
Recently I saw some odd behaviour while triaging bug 25195,
namely that gzip writes to STDERR some nasty broken pipe messages.
/home/carlos/build/glibc/locale/localedef -c --no-archive -i en_US -f 'ISO-8859-1-whee' -A /usr/share/locale/locale.alias --prefix $HOME en_US
[error] character map file `ISO-8859-1-whee' not found: No such file or directory
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
gzip: stdout: Broken pipe
You can see why here:
1574310173.014284 write(1, "<code_set_name> EUC-JP-MS\n<comme"..., 32768) = 32768
1574310173.014466 write(1, " CYRILLIC SMALL LETTER DE\n<U04"..., 32768) = -1 EPIPE (Broken pipe)
1574310173.014498 --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=10480, si_uid=1000} ---
1574310173.014521 write(2, "\ngzip: ", 7) = 7
1574310173.014619 write(2, "stdout: Broken pipe\n", 20) = 20
In charmap_aliases() we only read BUFSIZ before closing the stream,
and so gzip is left writing to a broken pipe.
I tried adding -q to gzip and it still complains:
1574310173.012925 execve("/usr/bin/gzip", ["gzip", "-cdq", "-"], 0x7ffc844ee480 /* 78 vars */) = 0
It is unfortunate to get this error on stderr for normal localedef operation.
I'm on gzip 1.9 and I wonder if 1.10 fixes any of this?
Next steps?
Paul, Any suggestions?
--
Cheers,
Carlos.