iconv can not process long stream

Bug #2049659 reported by Vladimir
This bug report is a duplicate of:  Bug #1568726: iconv stdio buffering. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Iconv eats too much memory on large piped input.
Steps to reproduce
yes | iconv -f ascii -t utf-8 | head -n5
Expected: 5 lines of y
Observed: iconv tries to read its stdin to the very end (infinitely) until got killed by OOM Killer.
Suggested solution: apply the patch https://sourceware.org/legacy-ml/libc-alpha/2015-08/msg00297.html

$ lsb_release -rd
Description: Ubuntu 20.04.5 LTS
Release: 20.04

$ iconv -V
iconv (Ubuntu GLIBC 2.31-0ubuntu9.14) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Ulrich Drepper.

$ apt-cache policy libc-bin
libc-bin:
  Installed: 2.31-0ubuntu9.14
  Candidate: 2.31-0ubuntu9.14

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.