From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Mar 25 15:40:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3020F3C for ; Mon, 25 Mar 2013 15:40:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A162BAC4 for ; Mon, 25 Mar 2013 15:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r2PFe0ci061325 for ; Mon, 25 Mar 2013 15:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r2PFe0Dp061324; Mon, 25 Mar 2013 15:40:00 GMT (envelope-from gnats) Resent-Date: Mon, 25 Mar 2013 15:40:00 GMT Resent-Message-Id: <201303251540.r2PFe0Dp061324@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tamás Kovács Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44524E7A for ; Mon, 25 Mar 2013 15:34:55 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 3610BA7F for ; Mon, 25 Mar 2013 15:34:55 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r2PFYqDZ035491 for ; Mon, 25 Mar 2013 15:34:52 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r2PFYqA3035490; Mon, 25 Mar 2013 15:34:52 GMT (envelope-from nobody) Message-Id: <201303251534.r2PFYqA3035490@red.freebsd.org> Date: Mon, 25 Mar 2013 15:34:52 GMT From: Tamás Kovács To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/177375: lang/php5 segmentation fault executing pcre (PHP 5.4 preg_replace) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Mar 2013 15:40:00 -0000 >Number: 177375 >Category: ports >Synopsis: lang/php5 segmentation fault executing pcre (PHP 5.4 preg_replace) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 25 15:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Tamás Kovács >Release: FreeBSD 8.3-RELEASE-p3 >Organization: >Environment: FreeBSD freebsd.local 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 #0: Tue Jun 12 00:39:29 UTC 2012 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Executing the provided code using PHP 5.4 produces a segmentation fault (core dumped). PHP v5.3 executes the code correctly. PHP v5.4 binary for Windows executes the code correctly. PHP v5.4 from ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/ or compiled from lang/php5 fails with a segmentation fault. This issue has been tested in FreeBSD 8.3-RELEASE and 9.1-RELEASE. gdb indicates that the issue is related to libpcre: Program terminated with signal 11, Segmentation fault. #0 0x0000000800d5ab5d in match () from /usr/local/lib/libpcre.so.3 >How-To-Repeat: Create a file with the following php code and execute from the command line: # php -n ./test.php [php] $code = ''; $result = preg_replace('/().)*[^\]])(-->)/is', '', $code); echo strlen($result); [/php] Expected result: 0 Actual result: Segmentation fault (core dumped) Note: Change the value of str_repeat from 5438 to 5437 and no segmentation fault occurs. >Fix: >Release-Note: >Audit-Trail: >Unformatted: