[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#130574: marked as done (libc6: iconv(3) breaks on converting "\n" from UNICODE --> ISO-8859-1)



Your message dated Fri, 14 Mar 2003 18:11:05 +0100
with message-id <20030314171103.GK5238@balrog.logic.univie.ac.at>
and subject line Cannot reproduce with 2.3.1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 23 Jan 2002 18:51:50 +0000
>From ametzler@downhill.at.eu.org Wed Jan 23 12:51:50 2002
Return-path: <ametzler@downhill.at.eu.org>
Received: from mailbox.surfeu.at (surfeu.at) [212.197.128.120] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 16TSUw-0002hU-00; Wed, 23 Jan 2002 12:51:50 -0600
Received: from [194.152.121.75] (HELO downhill.univie.ac.at)
  by surfeu.at (CommuniGate Pro SMTP 3.4.8)
  with ESMTP id 17614166; Wed, 23 Jan 2002 19:51:35 +0100
Received: from ametzler by downhill.univie.ac.at with local (Exim 3.33 #1 (Debian))
	id 16TSSN-0000jJ-00; Wed, 23 Jan 2002 19:49:11 +0100
Date: Wed, 23 Jan 2002 19:49:11 +0100
From: Andreas Metzler <ametzler@downhill.at.eu.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libc6: iconv(3) breaks on converting "\n" from UNICODE --> ISO-8859-1
Message-ID: <20020123184910.GA2627@downhill.at.eu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.25i
X-Reportbug-Version: 1.41.14213
X-Debbugs-CC: Bruno Haible <haible@clisp.cons.org>
X-GPG-Fingerprint: BCF7 1345 BE42 B5B8 1A57  EE09 1D33 9C65 8B8D 7663
Delivered-To: submit@bugs.debian.org

Package: libc6
Version: 2.2.4-7
Severity: normal

Hello,
I am Ccing Bruno Haible, apparently[1] the responsible man from the
glibc-team.

The program-snippet below will loop infinitly on glibc 2.2.4-7, but
not 2.1.3. It takes the string "\n" and tries to convert it from
UNICODE to ISO-8859-1, trouble is that iconv(3) does nothing, it
neither returns an error nor does it "increment inbuf", etc.

(I tried to produce a minimal testcase by stripping the code from the
tin-Newsreader, which got bitten by this bug.)

IMVVVVVHO it might be a good idea to drop UNICODE-support and let
iconv_open fail with errno EINVAL for ("ISO-8859-1", "UNICODE") like
libiconv-1.7 does:

 from libiconv-1.7 notes:
|     * UNICODE (big endian), UNICODEFEFF (little endian)
|       We DON'T implement these because they are stupid and not
|       standardized.

thanks for your work, cu andreas
[1] libc6/NEWS.gz:
| * Bruno Haible updated all the code handling Unicode in some form to
|   support Unicode 3.1.


--------program snippet-------------------------
#include <iconv.h>
#include <stdlib.h>
#include <string.h>

int main(void);

int main() {
	char line[]="\n";
	char * obuf;
	char * outbuf;
	char * inbuf;
	iconv_t cd;
	size_t result;
	size_t inbytesleft, outbytesleft;

	// if ((cd = iconv_open("ISO-8859-1", "ISO-8859-15")) != (iconv_t) (-1)) { 
	if ((cd = iconv_open("ISO-8859-1", "UNICODE")) != (iconv_t) (-1)) {
		inbuf = (char *) line;
		inbytesleft = strlen (line);
		outbytesleft = 1 + inbytesleft * 4;	/* should be enough */
		obuf = (char *) malloc (outbytesleft + 1);
		outbuf = (char *) obuf;

		do {
			result = iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
			if (result == (size_t) (-1)) /* Error occured */
				break;
		} while (inbytesleft > 0);

		**&outbuf = '\0';
		strcpy(line, obuf); 
		free(obuf);
		iconv_close(cd);
	}
	return(0);
}
---------------------------------------------------------------------

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux downhill 2.4.14csbadram #1 Die Dez 4 17:25:38 CET 2001 i586
Locale: LANG=de_AT, LC_CTYPE=de_AT

---------------------------------------
Received: (at 130574-done) by bugs.debian.org; 14 Mar 2003 17:11:09 +0000
>From ametzler@logic.univie.ac.at Fri Mar 14 11:11:09 2003
Return-path: <ametzler@logic.univie.ac.at>
Received: from server.logic.univie.ac.at [131.130.190.41] ([Tfu1zZ9XOSJwXn3TMUtHkHdVlslgNrFA])
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 18tsi4-0007rd-00; Fri, 14 Mar 2003 11:11:08 -0600
Received: from balrog.logic.univie.ac.at ([131.130.190.58] ident=mail)
	by server.logic.univie.ac.at with esmtp (Exim 3.36 #3 )
	id 18tsiB-0006nX-00
	for <130574-done@bugs.debian.org>; Fri, 14 Mar 2003 18:11:15 +0100
Received: from ametzler by balrog.logic.univie.ac.at with local (Exim 4.14 #1 (Debian) [+prerelease])
	id 18tsi1-0001a7-6X
	for <130574-done@bugs.debian.org>; Fri, 14 Mar 2003 18:11:05 +0100
Date: Fri, 14 Mar 2003 18:11:05 +0100
From: Andreas Metzler <ametzler@logic.univie.ac.at>
To: 130574-done@bugs.debian.org
Subject: Cannot reproduce with 2.3.1
Message-ID: <20030314171103.GK5238@balrog.logic.univie.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
X-Archive: encrypt
Sender: Andreas Metzler <ametzler@balrog.logic.univie.ac.at>
Delivered-To: 130574-done@bugs.debian.org
X-Spam-Status: No, hits=-0.9 required=4.0
	tests=SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MUTT
	version=2.44
X-Spam-Level: 

Hello,
I cannot reproduce this with 2.3.1-14 (at least the test program exits
normally.)
              cu andreas



Reply to: