Bug 194321 - Message encoding not converted when ENOMEM error
Summary: Message encoding not converted when ENOMEM error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: 176344 198868
TreeView+ depends on / blocked
 
Reported: 2006-06-07 09:57 UTC by Bastien Nocera
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHBA-2007-0210
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-01 23:00:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0210 0 normal SHIPPED_LIVE glibc bug fix update 2007-04-28 17:26:43 UTC

Description Bastien Nocera 2006-06-07 09:57:18 UTC
dlerror (and probably strerror) will not convert the messages from their
original encoding to the current locale's encoding.

This causes EUC-JP messages to appear when in ja_JP.UTF-8 encoding for example.
2 ways to work around this problem:
- say that UTF-8 is the default encoding on RHEL4, and convert all the .po files
from their original encodings to UTF-8 (fairly straight forward, I already
tested this with ja_JP)
- fallback to C locale when the conversion fails, rather than passing non-UTF-8
encoded text back to the program

Test case:
#include <stdio.h>
#include <string.h>
#include <locale.h>
main()
{
        char *msg;
        setlocale(LC_ALL, "");
        msg = strerror(1);/*EPERM*/
        puts(msg);
}

And the gdb script to replicate the memory allocation error:
set height 0
set environment LANG=ja_JP.UTF-8
echo --- Success case ---\n
echo Japanese error message is readable in UTF-8 environment\n
run
break malloc.c:3594
command
return 0
cont
end
echo --- Failure case ---\n
echo Japanese error message is not readable in UTF-8 environment\n
run
quit

Comment 4 RHEL Program Management 2006-08-18 15:38:51 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 Red Hat Bugzilla 2007-05-01 23:00:44 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0210.html



Note You need to log in before you can comment on or make changes to this bug.