Edit report at https://bugs.php.net/bug.php?id=65393&edit=1

 ID:                 65393
 Updated by:         yohg...@php.net
 Reported by:        lukyrys at gmail dot com
 Summary:            SIGSEGV
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            PCRE related
 Operating System:   Debian 7.1
 PHP Version:        5.4.17
 Block user comment: N
 Private report:     N

 New Comment:

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?


Previous Comments:
------------------------------------------------------------------------
[2013-08-05 12:14:26] 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 ()



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65393&edit=1

Reply via email to