From owner-freebsd-i18n@freebsd.org Tue Jun 23 12:15:32 2020 Return-Path: Delivered-To: freebsd-i18n@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D23C353D45 for ; Tue, 23 Jun 2020 12:15:32 +0000 (UTC) (envelope-from stas@sanskrit.ru) Received: from mx.grinkin.ru (mx.grinkin.ru [62.140.237.35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49rlbl4KjSz4SZ4 for ; Tue, 23 Jun 2020 12:15:31 +0000 (UTC) (envelope-from stas@sanskrit.ru) Received: from mx.grinkin.ru (mx.grinkin.ru [62.140.237.35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.grinkin.ru (Postfix) with ESMTPS id D1E06ABB159 for ; Tue, 23 Jun 2020 15:15:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.10.3 mx.grinkin.ru D1E06ABB159 Date: Tue, 23 Jun 2020 15:15:12 +0300 (MSK) From: Stanislav Grinkin X-X-Sender: stas@mx.grinkin.ru To: freebsd-i18n@freebsd.org Subject: _citrus_iconv_convert and php bug Message-ID: User-Agent: Alpine 2.21 (BSF 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Rspamd-Queue-Id: 49rlbl4KjSz4SZ4 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.20 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.016]; R_DKIM_ALLOW(-0.20)[sanskrit.ru:s=relay]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:62.140.237.35]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-i18n@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.04)[-1.035]; DKIM_TRACE(0.00)[sanskrit.ru:+]; DMARC_POLICY_ALLOW(-0.50)[sanskrit.ru,reject]; NEURAL_HAM_SHORT(-0.25)[-0.245]; RCVD_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:28917, ipnet:62.140.224.0/19, country:RU]; RCVD_TLS_ALL(0.00)[]; ONCE_RECEIVED(0.10)[] X-BeenThere: freebsd-i18n@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD Internationalization Effort List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2020 12:15:32 -0000 Hi all, I'm not familiar in C but may be somebody has idea about this bug in php or/and iconv implementation in freebsd libc. Shortly: php -r 'echo iconv("UTF-8", "UTF-8", "Hello, world.\n");' Bus error (core dumped) bug desribed in a few places: https://bugs.php.net/bug.php?id=74014 https://bugs.php.net/bug.php?id=72198 it seems bug does exist even in php 7.x. I caught it in very old version php 5.6.40 - some old site on old joomla framework. Well, we have php.core and what we see: uname -a FreeBSD space 12.1-RELEASE-p4 FreeBSD 12.1-RELEASE-p4 GENERIC amd64 gdb sapi/cli/php php.core GNU gdb (GDB) 9.2 [GDB v9.2 for FreeBSD] Reading symbols from sapi/cli/php... [New LWP 100454] Core was generated by `sapi/cli/php -r echo iconv("UTF-8", "UTF-8", "Hello, world.\n");'. Program terminated with signal SIGBUS, Bus error. #0 0x0000000801296711 in _citrus_iconv_convert (cv=0x80253a000, in=0x7fffffffe190, inbytes=0x7fffffffe1a0, out=0x7fffffffe1b8, outbytes=0x7fffffffe1c0, flags=0, nresults=0x0) at /usr/src/lib/libc/iconv/citrus_iconv.h:62 62 /usr/src/lib/libc/iconv/citrus_iconv.h: No such file or directory. warning: File "/usr/local/src/php-5.6.40/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". To enable execution of this file add --Type for more, q to quit, c to continue without paging-- add-auto-load-safe-path /usr/local/src/php-5.6.40/.gdbinit line to your configuration file "/root/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/root/.gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" (gdb) bt #0 0x0000000801296711 in _citrus_iconv_convert (cv=0x80253a000, in=0x7fffffffe190, inbytes=0x7fffffffe1a0, out=0x7fffffffe1b8, outbytes=0x7fffffffe1c0, flags=0, nresults=0x0) at /usr/src/lib/libc/iconv/citrus_iconv.h:62 #1 __bsd_iconv (handle=0x80253a000, in=0x7fffffffe190, szin=0x7fffffffe1a0, out=0x7fffffffe1b8, szout=0x7fffffffe1c0) at /usr/src/lib/libc/iconv/bsd_iconv.c:135 #2 0x000000000099cf7b in php_iconv_string (in_p=0x801cddca0 "Hello, world.\n", in_len=14, out=0x7fffffffe208, out_len=0x7fffffffe210, out_charset=, in_charset=) at ext/iconv/iconv.c:653 #3 0x000000000099a5dd in php_if_iconv (ht=, return_value=0x801c9fa10, return_value_ptr=, this_ptr=, return_value_used=) at ext/iconv/iconv.c:2490 #4 0x0000000000bded49 in zend_do_fcall_common_helper_SPEC (execute_data=0x801c6bd20) at Zend/zend_vm_execute.h:558 #5 0x0000000000b9e2e8 in execute_ex (execute_data=0x801c6bd20) at Zend/zend_vm_execute.h:363 #6 0x0000000000b65e21 in zend_eval_stringl (str=, str_len=, retval_ptr=, string_name=) at Zend/zend_execute_API.c:1080 #7 0x0000000000b6621c in zend_eval_stringl_ex ( str=0x7fffffffedb0 "echo iconv(\"UTF-8\", \"UTF-8\", \"Hello, world.\\n\");", str_len=-443987883, retval_ptr=0x7fffffffe1a0, string_name=0x7fffffffe1b8 "@\372\311\001\b", handle_exceptions=1) at Zend/zend_execute_API.c:1127 #8 zend_eval_string_ex ( str=0x7fffffffedb0 "echo iconv(\"UTF-8\", \"UTF-8\", \"Hello, world.\\n\");", retval_ptr=0x7fffffffe1a0, string_name=0x7fffffffe1b8 "@\372\311\001\b", handle_exceptions=1) a piece of code at ext/iconv/iconv.c:653: result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left); That version of php, compiled under linux (Linux test 4.4.217 #1 SMP Thu Mar 26 14:44:04 CDT 2020 x86_64 Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz GenuineIntel GNU/Linux) works correctly. Has anybody ideas how to fix it? -- Best regards, Stanislav From owner-freebsd-i18n@freebsd.org Tue Jun 23 14:20:40 2020 Return-Path: Delivered-To: freebsd-i18n@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0F223560E7 for ; Tue, 23 Jun 2020 14:20:40 +0000 (UTC) (envelope-from thierry@pompo.net) Received: from erza.lautre.net (erza.lautre.net [80.67.160.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "lautre.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49rpN56SVhz4ZxK for ; Tue, 23 Jun 2020 14:20:37 +0000 (UTC) (envelope-from thierry@pompo.net) Received: from graf.pompo.net (graf.pompo.net [78.225.128.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by erza.lautre.net (Postfix) with ESMTPSA id A192EF3FD0 for ; Tue, 23 Jun 2020 16:20:34 +0200 (CEST) Received: by graf.pompo.net (Postfix, from userid 1001) id 1015D4A0461; Tue, 23 Jun 2020 16:20:34 +0200 (CEST) Date: Tue, 23 Jun 2020 16:20:34 +0200 From: Thierry Thomas To: freebsd-i18n@freebsd.org Subject: Re: _citrus_iconv_convert and php bug Message-ID: <20200623142034.GA79829@graf.pompo.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 12.1-STABLE amd64 Organization: Kabbale Eros X-Face: (hRbQnK~Pt7$ct`!fupO(`y_WL4^-Iwn4@ly-.,[4xC4xc; y=\ipKMNm<1J>lv@PP~7Z<.tKjAnXLs: X-PGP: 0xF1C516B3C8359753 X-Rspamd-Queue-Id: 49rpN56SVhz4ZxK X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of thierry@pompo.net designates 80.67.160.89 as permitted sender) smtp.mailfrom=thierry@pompo.net X-Spamd-Result: default: False [3.05 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(0.00)[+mx]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[thierry@freebsd.org,thierry@pompo.net]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20766, ipnet:80.67.160.0/19, country:FR]; FROM_NEQ_ENVFROM(0.00)[thierry@freebsd.org,thierry@pompo.net]; TO_DOM_EQ_FROM_DOM(0.00)[]; NEURAL_HAM_MEDIUM(-0.08)[-0.079]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.37)[0.366]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-i18n@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; BAD_REP_POLICIES(0.10)[]; RBL_VIRUSFREE_BOTNET(2.00)[80.67.160.89:from]; NEURAL_SPAM_LONG(0.56)[0.558]; RBL_SENDERSCORE(2.00)[80.67.160.89:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-i18n@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD Internationalization Effort List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2020 14:20:40 -0000 --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le mar. 23 juin 20 =E0 14:15:12 +0200, Stanislav Grinkin via freebsd-i18n <= freebsd-i18n@freebsd.org> =E9crivait=A0: > Hi all, Hello, > I'm not familiar in C but may be somebody has idea about this bug in php= =20 > or/and iconv implementation in freebsd libc. >=20 > Shortly: >=20 > php -r 'echo iconv("UTF-8", "UTF-8", "Hello, world.\n");' > Bus error (core dumped) >=20 > bug desribed in a few places: > https://bugs.php.net/bug.php?id=3D74014 > https://bugs.php.net/bug.php?id=3D72198 >=20 > it seems bug does exist even in php 7.x. I just tested it with /usr/local/bin/php was installed by package php72-7.2.31 and it works: no problem. (on 12.1-STABLE) > I caught it in very old version php 5.6.40 - some old site on old joomla= =20 > framework. Sorry, I don=B4t have this one anymore! --=20 Th. Thomas. --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJe8g+xXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFNTM2QkU4NTM4NTM5OUQwMEI2RkFBNzZG MUM1MTZCM0M4MzU5NzUzAAoJEPHFFrPINZdTwl8QAKinI40AGvwU35w8eb8jz0nV KHUPZ8zyus6FLK6Dc+WGUuHUVqHzf3Rz5XPuuO5WkLs+5hz9hq+jkUyPEAT8ZXGQ sMIaYsB4yVOSJ54j7623+8bPwICNnQ99KdbtJVV9AIxBx3lCov0Yw/fy0L1zhPzB Ms1y03CzexGkk31ZVT7XnO4NQji4DuyJ3uopROyPpVSVPmE75TUPvHs5M9ecgQpT fT9PQU3gy3uPjafw50FoPaXC301MGqhapONXUU2KXlOnpKP2sUnrarfT29XESoeM /MOg8Mm5TR1KU47pq4eUI4eygIt17rChc32MlmLirtsdHHrVYlIafPzwxgqQTXMQ ycFN3yiCjyelpdYQUGtuZrGH3r6lX4YjxjxWfs5TToPGHwhOCBejjz5xu9qXDdny PkKDf2T/w/WXDRhAap9J0SGsxiQW7k0tOESj1ijWNK5c+3KX8oRu/IVZnY0GVbGx qjoN11Wc9AeFReK7Gx84Id8muANw/wT00k7Rj6wVp9astw3ghgRvZib4dE0Pa5eK 7xEmX4OWNCKm1xr1KSOFL4C+ZzX+z/GS+/Jj1gI4jI34B+zx8wl4Xyv0p8ajMnQS zu8/V9pGJ9wbj1ERnzmr2SVgJBw9y4HgjqciR7Sl6kFuJ1AyQlirtb2e80MpsRW6 4atBAEA6SKqhwknigPtN =rJK4 -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/-- From owner-freebsd-i18n@freebsd.org Tue Jun 23 14:50:20 2020 Return-Path: Delivered-To: freebsd-i18n@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A3763574A1 for ; Tue, 23 Jun 2020 14:50:20 +0000 (UTC) (envelope-from stas@sanskrit.ru) Received: from mx.grinkin.ru (mx.grinkin.ru [62.140.237.35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49rq2M3Lt6z4dRP; Tue, 23 Jun 2020 14:50:19 +0000 (UTC) (envelope-from stas@sanskrit.ru) Received: from mx.grinkin.ru (mx.grinkin.ru [62.140.237.35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.grinkin.ru (Postfix) with ESMTPS id EECE9ABB2DA; Tue, 23 Jun 2020 17:50:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.10.3 mx.grinkin.ru EECE9ABB2DA Date: Tue, 23 Jun 2020 17:50:05 +0300 (MSK) From: Stanislav X-X-Sender: stas@mx.grinkin.ru To: Thierry Thomas cc: freebsd-i18n@freebsd.org Subject: Re: _citrus_iconv_convert and php bug In-Reply-To: <20200623142034.GA79829@graf.pompo.net> Message-ID: References: <20200623142034.GA79829@graf.pompo.net> User-Agent: Alpine 2.21 (BSF 202 2017-01-01) MIME-Version: 1.0 Content-ID: X-Rspamd-Queue-Id: 49rq2M3Lt6z4dRP X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.46 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.030]; R_DKIM_ALLOW(-0.20)[sanskrit.ru:s=relay]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:62.140.237.35:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; NEURAL_HAM_LONG(-1.01)[-1.006]; DKIM_TRACE(0.00)[sanskrit.ru:+]; CTYPE_MIXED_BOGUS(1.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.53)[-0.525]; DMARC_POLICY_ALLOW(-0.50)[sanskrit.ru,reject]; RCVD_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:28917, ipnet:62.140.224.0/19, country:RU]; RCVD_TLS_ALL(0.00)[]; ONCE_RECEIVED(0.10)[] Content-Type: text/plain; CHARSET=ISO-8859-1; FORMAT=flowed Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-i18n@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD Internationalization Effort List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2020 14:50:20 -0000 >> it seems bug does exist even in php 7.x. > > I just tested it with > /usr/local/bin/php was installed by package php72-7.2.31 > and it works: no problem. > > (on 12.1-STABLE) > >> I caught it in very old version php 5.6.40 - some old site on old joomla >> framework. > > Sorry, I donīt have this one anymore! > -- > Th. Thomas. > Hi, ok, seems bug does not exist with package php72-7.2.31. And at the moment we have no problems with php-7.x Unfortanelly we have not port of php5. Only one way - try to compile it myself. Because old joomla works only with old php, and nobody has time to move site to new joomla... I moved it from linux to freebsd and php-iconv now broken. Possible somebody has ideas how to help... -- Best regards, Stanislav