From:             
Operating system: Linux
PHP version:      5.3.2
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Memory Error: IPR in language scanner

Description:
------------
When running PHP through Purify, I am seeing Invalid Pointer Read (IPR)
errors such as the following:



IPR: Invalid pointer read:

  * This is occurring while in thread 8075:

    lex_scan       [zend_language_scanner.c:3174]

    zendlex        [zend_compile.c:4950]

    zendparse      [zend_language_parser.c:3280]

    compile_file   [zend_language_scanner.l:343]

    rnt_compile_file [rnt_opcode_cache.c:1008]

    compile_filename [zend_language_scanner.l:386]

  * Reading 1 byte from 0xf735f332 between the heap and the stack.



It appears that script files are memory mapped and then a cursor pointer is
used to iterate over the mapped memory. The problem is that the cursor
pointer is not properly checked when reaching the end of the file and
memory values are read that are not part of the mapped memory. I manually
fixed one case of this (see attached diff). However, there are others.



It looks like this file is generated (using flex?) so this is probably not
actually a PHP issue. However, I thought I would start here. Let me know if
this needs to be submitted to somebody else.


-- 
Edit bug report at http://bugs.php.net/bug.php?id=51761&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51761&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51761&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51761&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51761&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51761&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51761&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51761&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51761&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51761&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51761&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51761&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51761&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51761&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51761&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51761&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51761&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51761&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51761&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51761&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51761&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51761&r=mysqlcfg

Reply via email to