Bug #52752 [Com]: Crash when lexing

[email protected] ("mfractal at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=52752&edit=1

 ID:                 52752
 Comment by:         mfractal at gmail dot com
 Reported by:        paulgao at yeah dot net
 Summary:            Crash when lexing
 Status:             Duplicate
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Centos 5 32bit
 PHP Version:        5.3SVN-2010-08-31 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

I am seeing similar behaviour in PHP 7.0.1 as well :

[New LWP 30950]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php-fpm: pool www                                                          '.
Program terminated with signal SIGBUS, Bus error.
#0  0x0000000000746e13 in lex_scan ()
(gdb) bt
#0  0x0000000000746e13 in lex_scan ()
#1  0x000000000075958b in zendlex ()
#2  0x000000000073dd5e in zendparse ()
#3  0x000000000074181b in compile_file ()
#4  0x00000000007673c2 in dtrace_compile_file ()
#5  0x00000000005d3b83 in ?? ()
#6  0x0000000000741a05 in compile_filename ()
#7  0x00000000007f7c37 in ?? ()
#8  0x00000000007b205b in execute_ex ()
#9  0x0000000000767439 in dtrace_execute_ex ()
#10 0x00000000007eed70 in ?? ()
#11 0x00000000007b205b in execute_ex ()
#12 0x0000000000767439 in dtrace_execute_ex ()
#13 0x00000000007eed70 in ?? ()
#14 0x00000000007b205b in execute_ex ()
#15 0x0000000000767439 in dtrace_execute_ex ()
#16 0x00000000007eed70 in ?? ()
#17 0x00000000007b205b in execute_ex ()
#18 0x0000000000767439 in dtrace_execute_ex ()
#19 0x0000000000768d2c in zend_call_function ()
#20 0x0000000000792124 in zend_call_method ()
#21 0x00000000007ac0d2 in ?? ()
#22 0x00000000007b2292 in ?? ()
#23 0x00000000007b205b in execute_ex ()
---Type <return> to continue, or q <return> to quit---
#24 0x0000000000767439 in dtrace_execute_ex ()
#25 0x0000000000768d2c in zend_call_function ()
#26 0x0000000000792124 in zend_call_method ()
#27 0x00000000007aa37c in ?? ()
#28 0x00000000007ab804 in zend_std_read_property ()
#29 0x00000000007b52e1 in ?? ()
#30 0x00000000007b205b in execute_ex ()
#31 0x0000000000767439 in dtrace_execute_ex ()
#32 0x00000000007eed70 in ?? ()
#33 0x00000000007b205b in execute_ex ()
#34 0x0000000000767439 in dtrace_execute_ex ()
#35 0x00000000007eed70 in ?? ()
#36 0x00000000007b205b in execute_ex ()
#37 0x0000000000767439 in dtrace_execute_ex ()
#38 0x00000000007eed70 in ?? ()
#39 0x00000000007b205b in execute_ex ()
#40 0x0000000000767439 in dtrace_execute_ex ()
#41 0x00000000007facdf in zend_execute ()
#42 0x0000000000776a74 in zend_execute_scripts ()
#43 0x000000000071a9e8 in php_execute_script ()
#44 0x00000000004789bc in main ()


Previous Comments:
------------------------------------------------------------------------
[2015-05-06 20:16:58] fbastani at perennate dot com

I am still encountering this bug with PHP 5.5.9, using php5-fpm without opcache/APC.

Backtrace:

#0  lex_scan (zendlval=zendlval@entry=0x7fffefa33e58) at Zend/zend_language_scanner.c:2271
#1  0x00000000006d7772 in zendlex (zendlval=zendlval@entry=0x7fffefa33e50) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_compile.c:6749
#2  0x00000000006b2766 in zendparse () at /build/buildd/php5-5.5.9+dfsg/Zend/zend_language_parser.c:3438
#3  0x00000000006b7d18 in compile_file (file_handle=file_handle@entry=0x7fffefa36330, type=8) at Zend/zend_language_scanner.l:588
#4  0x00000000006dd4ea in dtrace_compile_file (file_handle=0x7fffefa36330, type=<optimized out>)
    at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:40
#5  0x0000000000566674 in phar_compile_file (file_handle=<optimized out>, type=<optimized out>)
    at /build/buildd/php5-5.5.9+dfsg/ext/phar/phar.c:3379
#6  0x000000000079cb9d in ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER (execute_data=0x7fc1d68e6688)
    at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:7994
#7  0x00000000007173e8 in execute_ex (execute_data=0x7fc1d68e6688) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#8  0x00000000006dd559 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#9  0x000000000079d1bf in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER (execute_data=0x7fc1d68e60f8)
    at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:2748
#10 0x00000000007173e8 in execute_ex (execute_data=0x7fc1d68e60f8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#11 0x00000000006dd559 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#12 0x00000000006eefe0 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3)
    at /build/buildd/php5-5.5.9+dfsg/Zend/zend.c:1316
#13 0x000000000068eec5 in php_execute_script (primary_file=primary_file@entry=0x7fffefa38ad0)
    at /build/buildd/php5-5.5.9+dfsg/main/main.c:2506
#14 0x0000000000463b00 in main (argc=<optimized out>, argv=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/sapi/fpm/fpm/fpm_main.c:1933

Line 2271 is this switch statement:

                YYDEBUG(121, *YYCURSOR);
                YYFILL(16);
                yych = *YYCURSOR;
		YYDEBUG(-1, yych);
2271            switch (yych) {
                case 0x00:
                case 0x01:
                case 0x02:
		case 0x03:


This bug is marked duplicate, but all of the references bugs also appear to be marked duplicate.

The error does not happen on every request, but occurs several ten or so times a day on our webserver. The file being compiled is "/var/www/include/include.php", which is included on every request, so there does not appear to be anything special about the requests that are failing (usually it is just a GET request for a static page that's parsed through PHP).

------------------------------------------------------------------------
[2014-12-04 12:05:38] kostik dot lv at gmail dot com

It's marked as a duplicate to itself:
[2013-07-24 10:12 UTC] [email protected]
-Status: Open
+Status: Duplicate
 [2013-07-24 10:12 UTC] [email protected]
see bug #52752

------------------------------------------------------------------------
[2014-12-04 12:05:38] kostik dot lv at gmail dot com

Related To: Bug #52752

------------------------------------------------------------------------
[2014-11-19 15:00:13] igor at wiedler dot ch

Which bug is this a duplicate of? From what I can tell, all related bugs have been closed. Was this one closed by accident?

------------------------------------------------------------------------
[2013-07-24 10:19:36] [email protected]

Related To: Bug #64883

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


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=52752


--
Edit this bug report at https://bugs.php.net/bug.php?id=52752&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.