|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-08-05 12:14 UTC] lukyrys at gmail dot com
Description:
------------
Hello, i have a problem with php when i use pcre regexp ((?<!href).)
Test script:
---------------
preg_match_all('#<a.*?href="([^<>]*?)\?img_id=(\d+)"\s*>((?<!href).)*<img.*?src="(.*?)"#i',$html,$outA)
Expected result:
----------------
array
Actual result:
--------------
Reading symbols from /usr/bin/php...(no debugging symbols found)...done.
(gdb) run /var/www/502.cz/web/nod/onny/index.php
Starting program: /usr/bin/php /var/www/502.cz/web/nod/onny/index.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffec495700 (LWP 12351)]
[Thread 0x7fffec495700 (LWP 12351) exited]
Program received signal SIGSEGV, Segmentation fault.
0x00000000004811ed in ?? ()
(gdb) bt
#0 0x00000000004811ed in ?? ()
#1 0x0000000000483496 in ?? ()
#2 0x000000000048f798 in ?? ()
#3 0x0000000000483496 in ?? ()
#4 0x000000000048f798 in ?? ()
#5 0x0000000000483496 in ?? ()
.... same lines
#10900 0x0000000000483496 in ?? ()
#10901 0x000000000048fa8c in ?? ()
#10902 0x0000000000492e0c in php_pcre_exec ()
#10903 0x0000000000497ba8 in php_pcre_match_impl ()
#10904 0x0000000000498538 in ?? ()
#10905 0x000000000076a0f1 in ?? ()
#10906 0x0000000000723f87 in execute ()
#10907 0x00000000006c44dc in zend_execute_scripts ()
#10908 0x0000000000664523 in php_execute_script ()
#10909 0x000000000076ca83 in ?? ()
#10910 0x000000000043181a in ?? ()
#10911 0x00007ffff53b4ead in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#10912 0x00000000004318ad in _start ()
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 05:00:01 2025 UTC |
Cannot reproduce w/o input. php > $html = file_get_contents('http://edition.cnn.com/'); php > preg_match_all('#<a.*?href="([^<>]*?)\?img_id=(\d+)"\s*>((?<!href).)* <img.*?src="(.*?)"#i',$html,$outA); php > var_dump($outA); array(5) { [0]=> array(0) { } [1]=> array(0) { } [2]=> array(0) { } [3]=> array(0) { } [4]=> array(0) { } } php > Could you provide short self contained "complete" script that reproduce segfault?