From: Operating system: Debian 6 PHP version: 5.3.10 Package: Regexps related Bug Type: Bug Bug description:crashes with preg_match
Description: ------------ Hello ! We have problem with parse some data and regular expression match. I have attached the file 1.txt # /usr/local/php5.3/bin/php test.php Segmentation fault (gdb) run test.php Starting program: /usr/local/bin/php test.php [Thread debugging using libthread_db enabled] [New Thread 0x7f1659abb710 (LWP 14776)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f1659abb710 (LWP 14776)] 0x00000000004bf9ff in match ( eptr=0x1632378 "nteria.pl;;\nmaciej...@o2.pl;;\nmaciej.len...@lumenpolska.pl;;\nmac...@szerszenowicz.com;;\nmaciej_zi...@op.pl;;\nmaciekprokopow...@gmail.com;;\nmadziam...@tlen.pl;;\nmadzior...@wp.pl;;\nmagda.mackiewicz@o2.p"..., ecode=0x165916a "V", mstart=0x1630b08 "status=OK\nsubscribers-exported=150...@student.pwr.wroc.pl;;\n2t...@gazeta.pl;;\n70...@interia.pl;;\n73piot...@wp.pl;;\na.gale...@zarzadca.wroclaw.pl;;\na.g...@poczta.fm;;\na.gruszew...@gmail.com;;\na.karamon"..., markptr=0x0, offset_top=8, md=0x7fff797e7960, ims=0, eptrb=0x0, flags=0, rdepth=12461) at /usr/local/directadmin/custombuild/php-5.2.17/ext/pcre/pcrelib/pcre_exec.c:1552 1552 /usr/local/directadmin/custombuild/php-5.2.17/ext/pcre/pcrelib/pcre_exec.c: No such file or directory. in /usr/local/directadmin/custombuild/php-5.2.17/ext/pcre/pcrelib/pcre_exec.c (gdb) print (char *)(executor_globals.function_state_ptr->function)->common.function_name $1 = 0x89f727 "preg_match" regards, Piotr Test script: --------------- <?php $matches = array(); $data = file_get_contents('1.txt'); var_dump(preg_match('/^(.|\s)+?subscribers-exported=((.|\s)+)$/', $data, $matches)); Expected result: ---------------- int(0) Actual result: -------------- crash -- Edit bug report at https://bugs.php.net/bug.php?id=61644&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61644&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61644&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61644&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61644&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61644&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61644&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61644&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61644&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61644&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61644&r=support Expected behavior: https://bugs.php.net/fix.php?id=61644&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61644&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61644&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61644&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61644&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61644&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61644&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61644&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61644&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61644&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61644&r=mysqlcfg