Bug #71937 [Opn]: Php regular expression error with a large pattern

From: Date: Sun, 24 Apr 2016 16:18:46 +0000
Subject: Bug #71937 [Opn]: Php regular expression error with a large pattern
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200747@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71937&edit=1 ID: 71937 Updated by: pajoye@php.net Reported by: aayaresko at gmail dot com Summary: Php regular expression error with a large pattern Status: Open Type: Bug Package: *Regular Expressions Operating System: Linux debian 3.16.0-4-amd64 #1 S PHP Version: 7.0.5 Block user comment: N Private report: N New Comment: For php processes. This pattern looks like it will cause issue with the stack depending on the match and/or recursion level. For example for apache (the apache config is the same for linux)/windows: http://stackoverflow.com/questions/5058845/how-do-i-increase-the-stack-size-for-apache-running-under-windows-7 or see http://stackoverflow.com/questions/7535994/how-do-i-find-the-maximum-stack-size Previous Comments: ------------------------------------------------------------------------ [2016-04-24 10:41:45] aayaresko at gmail dot com Thanks for the reply! You mean gdb-stack? I'm sorry but could you please give me some hint on how to do that? ------------------------------------------------------------------------ [2016-04-24 09:48:57] pajoye@php.net I would suggest to increase the stack as it is most likely exhausted. ------------------------------------------------------------------------ [2016-04-24 08:39:05] aayareslp at gmail dot com And here one more backtrace from virtualbox guest: #0 0x00007f4d76333067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 0x00007f4d76333067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007f4d76334448 in __GI_abort () at abort.c:89 #2 0x00007f4d763711b4 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7f4d76466530 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175 #3 0x00007f4d7637698e in malloc_printerr (action=1, str=0x7f4d76462646 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:4996 #4 0x00007f4d76377696 in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840 #5 0x00007f4d779b83f5 in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3 #6 0x00007f4d779dd8ef in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3 #7 0x00007f4d779e04a5 in pcre_study () from /lib/x86_64-linux-gnu/libpcre.so.3 #8 0x00000000004af0ca in pcre_get_compiled_regex_cache () #9 0x00000000004b0696 in ?? () #10 0x000000000071eb7a in dtrace_execute_internal () #11 0x00000000007b3370 in ?? () #12 0x000000000076e8ab in execute_ex () #13 0x000000000071ea08 in dtrace_execute_ex () #14 0x00000000007c27f7 in zend_execute () #15 0x000000000072ee83 in zend_execute_scripts () #16 0x00000000006cfb20 in php_execute_script () #17 0x000000000046fa12 in main () ------------------------------------------------------------------------ [2016-04-24 04:45:33] aayaresko at gmail dot com Xdebug is unloaded. The problem is still present. Here is the backtrace: #0 0x00007fc40269e067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007fc40269f448 in __GI_abort () at abort.c:89 #2 0x00007fc4026dc1b4 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7fc4027d1530 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175 #3 0x00007fc4026e198e in malloc_printerr (action=1, str=0x7fc4027cd646 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:4996 #4 0x00007fc4026e2696 in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840 #5 0x00007fc403d233f5 in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3 #6 0x00007fc403d488ef in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3 #7 0x00007fc403d4b4a5 in pcre_study () from /lib/x86_64-linux-gnu/libpcre.so.3 #8 0x00000000004af0ca in pcre_get_compiled_regex_cache () #9 0x00000000004b335d in ?? () #10 0x000000000071eb7a in dtrace_execute_internal () #11 0x00000000007b3370 in ?? () #12 0x000000000076e8ab in execute_ex () #13 0x000000000071ea08 in dtrace_execute_ex () #14 0x00000000007c27f7 in zend_execute () #15 0x000000000072ee83 in zend_execute_scripts () #16 0x00000000006cfb20 in php_execute_script () #17 0x000000000046fa12 in main () ------------------------------------------------------------------------ [2016-04-24 04:22:27] php-bugs at lists dot php dot net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. ------------------------------------------------------------------------ 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=71937 -- Edit this bug report at https://bugs.php.net/bug.php?id=71937&edit=1

« previous php.bugs (#200747) next »