Bug #72198 [Com]: PHP built with libconv crashes after iconv() is called

From: Date: Thu, 09 May 2019 18:49:57 +0000
Subject: Bug #72198 [Com]: PHP built with libconv crashes after iconv() is called
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220804@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72198&edit=1

 ID:                 72198
 Comment by:         phpbugs dot ooglek at 0sg dot net
 Reported by:        marcelo at tpn dot com dot br
 Summary:            PHP built with libconv crashes after iconv() is
                     called
 Status:             Open
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   FreeBSD 10.3
 PHP Version:        7.0.6
 Block user comment: N
 Private report:     N

 New Comment:

The documentation from ./configure is misleading.

# ./configure --help | grep -i iconv

  --without-iconv=DIR     Exclude iconv support
  --with-iconv-dir=DIR    XMLRPC-EPI: iconv dir for XMLRPC-EPI

However --with-iconv-dir seems to be not respected, and thus PHP ends up using the BSD version of
libiconv, which causes the bus error.

When passing --with-iconv=/usr/local you get the correctly installed from ports libiconv from
/usr/local 

Maybe add a failure case in ./configure if the library included is the BSD version? __bsd_iconv that
cmb at php dot net mentioned is a likely culprit.


Previous Comments:
------------------------------------------------------------------------
[2019-05-09 18:39:05] phpbugs dot ooglek at 0sg dot net

I am experiencing this on FreeBSD 12.0-RELEASE-p3 compiling PHP 7.3.5 from source using
--with-iconv-dir=/usr/local

I've installed libiconv from ports but FreeBSD after 10-CURRENT on 2013-08-13 have iconv
installed as part of the OS. It may be that the configure script, regardless of the value of DIR
(/usr vs /usr/local) may pick up the port rather than the native library in
/usr/lib/i18n/libiconv_std.so.4 vs /usr/local/lib/libiconv.so.2.5.1

I've tried DIR as both /usr and /usr/local without luck, still get the bus error. I'm
going to dig a bit more to see if there is a lingering path issue in my environment, another
./configure var that will fix this on FreeBSD, or if another change is required.

It is still an issue when compiling PHP 7.3 from source on FreeBSD. Along with mysqli and mariadb,
but that's another bug. :-)

------------------------------------------------------------------------
[2018-09-30 16:25:04] cmb@php.net

> iconv implementation => libiconv
> […]
> #0  0x00000008022700d1 in __bsd_iconv () from /lib/libc.so.7

This looks wrong.

------------------------------------------------------------------------
[2018-09-30 16:23:07] cmb@php.net

Related To: Bug #71304

------------------------------------------------------------------------
[2017-02-02 23:41:04] nti at w4w dot net

I've compiled phpXX-iconv with

CONFIGURE_ARGS+=--with-iconv=/usr/local

Now it works

------------------------------------------------------------------------
[2017-01-31 10:44:21] cmb@php.net

Related To: Bug #74014

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=72198


--
Edit this bug report at https://bugs.php.net/bug.php?id=72198&edit=1


Thread (10 messages)

« previous php.bugs (#220804) next »