Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-95381

glibc: return code of iconv tool after successful conversion with parameter -c is not 0

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • rhel-9.6
    • glibc
    • None
    • No
    • None
    • rhel-pt-c-libs
    • ssg_platform_tools
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      What were you trying to do that didn't work?

      After updating glibc-common-2.34-125.el9_5.3.x86_64 to the current version glibc-common-2.34-168.el9_6.14.x86_64 the standard behavior of iconv in some cases with parameter -c returns 1 or another error code instead of 0.

      What is the impact of this issue to you?

      The command/binary iconv is not usable with this incorrect behavior, in case of using the error code 0 for the next step to read/import the converted file. Therefore, a rollback to the old glibc with the old iconv was performed.

      Please provide the package NVR for which the bug is seen:

      glibc-common-2.34-168.el9_6.14.x86_64

      How reproducible is this bug?:

      This bug is reproducible with different character sets (with from- and to-parameter or also without from-parameter, like in example below).

      Steps to reproduce

      In following steps you can see a conversion from character set ISO-8859 to UTF-8 (but without from-parameter). Step no. 6 is successful, but the return code in no. 7 is not 0 (that's the deviation from standard behavior). In following example it happened with German umlauts.

      1. # file testdatei.txt
      testdatei.txt: ISO-8859 text

      2. # vim testdatei.txt
      dünn
      dünn

      3. # cat testdatei.txt
      dünn
      d▒nn

      4. # iconv -t UTF-8 testdatei.txt -o ergebnis.txt
      iconv: illegal input sequence at position 7

      5. # cat ergebnis.txt
      dünn
      d

      6. # iconv -c -t UTF-8 testdatei.txt -o ergebnis.txt

      7. # echo $?
      1

      8. # cat ergebnis.txt
      dünn
      dnn

      9. # file ergebnis.txt
      ergebnis.txt: UTF-8 Unicode text

      Expected results

      The return code of the following iconv command with -c should be 0.

      Actual results

      The return code is not 0.

              glibc-bugzilla Platform Tools - Libraries Bot
              andrej.rohr@l-bank.de Andrej Rohr (Inactive)
              Platform Tools - Libraries Bot Platform Tools - Libraries Bot
              Sergey Kolosov Sergey Kolosov
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: