From owner-freebsd-ports Sun Apr 28 14:50:12 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BF0DD37B404 for ; Sun, 28 Apr 2002 14:50:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3SLo3f54160; Sun, 28 Apr 2002 14:50:03 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0A7DE37B417 for ; Sun, 28 Apr 2002 14:40:20 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3SLeKA53232; Sun, 28 Apr 2002 14:40:20 -0700 (PDT) (envelope-from nobody) Message-Id: <200204282140.g3SLeKA53232@freefall.freebsd.org> Date: Sun, 28 Apr 2002 14:40:20 -0700 (PDT) From: Fuyuhiko Maruyama To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: ports/37543: libiconv run into endless loop during making security/gpgme. Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 37543 >Category: ports >Synopsis: libiconv run into endless loop during making security/gpgme. >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Apr 28 14:50:03 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Fuyuhiko Maruyama >Release: FreeBSD 4.5-STABLE >Organization: Tokyo Institute of Technology >Environment: FreeBSD guns.private 4.5-STABLE FreeBSD 4.5-STABLE #1: Mon Apr 29 01:48:04 JST 2002 maruyama@guns.private:/usr/obj/usr/src/sys/GUNS i386 >Description: When libiconv fail text conversion, it may run into endless loop (not always). The problem is caused by libiconv's odd error handling. There is some program points where error code is silently changed, RET_ILUNI to RET_TOOSMALL. Since RET_TOOSMALL means no sufficient buffer memory, libiconv try to enlarge buffer and retry conversion. Because of this nature, silently changed error code causes endless loop of (enlarge buffer -> retry). >How-To-Repeat: 1. setenv LANG ja_JP.eucJP 2. cd /usr/ports/gpgme 3. make It may be a locale dependent problem and I only know it appears when I set LANG=ja_JP.eucJP. >Fix: Although I met the problem when I make security/gpgme, the actual problem is in converters/libiconv. Here is a patch to fix libiconv. I'm sorry to paste it from send-pr's web interface, I know it breaks patch ;-<. --- lib/loop_unicode.h.orig Fri Jun 8 22:04:33 2001 +++ lib/loop_unicode.h Mon Apr 29 05:12:08 2002 @@ -52,8 +52,7 @@ cd->ostate = backup_state; outptr = backup_outptr; outleft = backup_outleft; - if (sub_outcount < 0) - return RET_TOOSMALL; + return sub_outcount; } } { @@ -96,8 +95,7 @@ cd->ostate = backup_state; outptr = backup_outptr; outleft = backup_outleft; - if (sub_outcount < 0) - return RET_TOOSMALL; + return sub_outcount; } if (last) break; @@ -144,8 +142,7 @@ cd->ostate = backup_state; outptr = backup_outptr; outleft = backup_outleft; - if (sub_outcount < 0) - return RET_TOOSMALL; + return sub_outcount; } } return RET_ILUNI; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message