*BSD News Article 49189


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!daffy!uwvax!newssinet!news.nc.u-tokyo.ac.jp!wnoc-tyo-news!news.iij.ad.jp!sonygw2!atg2gw!strgsvr!sanewo
From: sanewo@strg.sony.co.jp (SANETO Takanori)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: bug in libc/locale/rune.c (2.1.0-950726-SNAP)
Date: 11 Aug 1995 03:20:58 GMT
Organization: Components company, Sony Corporation, JAPAN
Lines: 36
Distribution: world
Message-ID: <SANEWO.95Aug11122058@medusa.strg.sony.co.jp>
NNTP-Posting-Host: neptune.dev.strg.sony.co.jp
X-DNAS-Posting-Host: medusa.dev.strg.sony.co.jp

In FreeBSD-2.1.0-950726-SNAP, due to bug in src/lib/libc/locale/rune.c
(also startup_setlocate.c), when environment variable LANG is set to
ja_JP.EUC (or something else), bytebench execl fails to run with the
following error message:

/usr/lib/libc.so: too many open files.

I ktraced the execl program and found that when LANG is set, a file
/usr/share/locale/${LANG}/LC_CTYPE is left opened.

When I fixed the source (patch is attached), problem went away. (Note
this patch is for -current, not for 2.1.0-950726-SNAP).

--- rune.c.org	Fri Aug 11 12:15:42 1995
+++ rune.c	Fri Aug 11 12:16:00 1995
@@ -86,6 +86,7 @@
 		fclose(fp);
 		return(EFTYPE);
 	}
+	fclose(fp);
 
 	if (!rl->encoding[0] || !strcmp(rl->encoding, "UTF2")) {
 		return(_UTF2_init(rl));
--- startup_setlocale.c.org	Fri Aug 11 12:15:48 1995
+++ startup_setlocale.c	Fri Aug 11 12:16:11 1995
@@ -186,6 +186,7 @@
 		fclose(fp);
 		return(EFTYPE);
 	}
+	fclose(fp);
 
 	if (!rl->encoding[0])
 		return(EINVAL);

---
Takanori Saneto <sanewo@strg.sony.co.jp>	Sony Corp., Japan