From nobody@FreeBSD.org  Wed Jan 21 17:56:25 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9920A1065679
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Jan 2009 17:56:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 86D1A8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Jan 2009 17:56:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LHuPiF059657
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Jan 2009 17:56:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n0LHuOZc059656;
	Wed, 21 Jan 2009 17:56:24 GMT
	(envelope-from nobody)
Message-Id: <200901211756.n0LHuOZc059656@www.freebsd.org>
Date: Wed, 21 Jan 2009 17:56:24 GMT
From: "D. Duccini" <david@backpack.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: csh core dumps after building  libiconv-1.1x from source on 7.0 and 7.1
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         130831
>Category:       bin
>Synopsis:       csh(1) core dumps after building  libiconv-1.1x from source on 7.0 and 7.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 21 18:00:09 UTC 2009
>Closed-Date:    
>Last-Modified:  Sat Jun 27 07:10:01 UTC 2009
>Originator:     D. Duccini
>Release:        7.1
>Organization:
BPSI
>Environment:
FreeBSD duckpond 7.1-RELEASE-p2 FreeBSD 7.1-RELEASE-p2 #0: Wed Jan 21 07:44:32 CST 2009     dvd@duckpond:/usr/obj/usr/src/sys/DUCKPOND  i386

>Description:
(The only kernel mod is for IP_FILTER) on this machine

In preparing to load PHP on server, downloaded and built from source libiconv-1.12

after download

./configure
make
make install

noticed core dumps in other builds -- traced to 'csh' and 'tcsh' core-dumping 

lost login ability, but had other window open so I removed /usr/local/lib/libiconv* and csh and tcsh functionality and login ability restored.

Same result with libiconv-1.11 on both Freebsd 7.0 and now this upgraded 7.1 machine.

Box is a Dell 1650, dual 1.4g, 4gb ram, running on top of vmware esxi hypervisor

>How-To-Repeat:

make install from within libiconv-1.1x source directory
>Fix:
Delete the newly installed libiconv libraries from /usr/local/lib

>Release-Note:
>Audit-Trail:

From: John Wehle <john@feith.com>
To: bug-followup@FreeBSD.org
Cc: david@backpack.com
Subject: Re: bin/130831: csh(1) core dumps after building  libiconv-1.1x from source on 7.0 and 7.1
Date: Sat, 27 Jun 2009 02:51:17 -0400 (EDT)

 I encountered the same problem using FreeBSD 7.2.
 
 There is code in bin/csh/iconv_stub.c which attempts to dynamically
 load and use iconv.  The problem is it makes assumptions as to
 which libiconv it's using (e.g. function names, calling conventions,
 parameters, etc).
 
 It's dangerous for there to be any code in the base applications
 / libraries that attempts to use functionality which is not supplied
 by the base libraries.
 
 The enclosed patch resolved the problem for me.
 
 -- John
 ------------------------8<------------------------------8<---------------
 --- bin/csh/iconv_stub.c.ORIGINAL	2009-04-14 23:14:26.000000000 -0400
 +++ bin/csh/iconv_stub.c	2009-05-18 21:45:20.000000000 -0400
 @@ -57,8 +57,10 @@ dl_iconv_open(const char *tocode, const 
  			return (iconv_t)-1;
  	} else {
  		initialized = 1;
 +/*
  		iconvlib = dlopen(ICONVLIB, RTLD_LAZY | RTLD_GLOBAL);
  		if (iconvlib == NULL)
 +*/
  			return (iconv_t)-1;
  		iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
  		dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
 -------------------------------------------------------------------------
 |   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
 |    John Wehle    |     Fax: 1-215-540-5495  |                         |
 -------------------------------------------------------------------------
 
>Unformatted:
