#23521 [Com]: any include() call causes 'input in flex scanner failed' error
| From: | jsl123 at web dot de | Date: | Wed, 07 May 2003 10:19:58 +0000 |
| Subject: | #23521 [Com]: any include() call causes 'input in flex scanner failed' error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39220@lists.php.net to get a copy of this message | ||
ID: 23521
Comment by: jsl123 at web dot de
Reported By: joe at cityofsanmateo dot org
Status: Open
Bug Type: Scripting Engine problem
Operating System: linux 2.4.20 - uclibc
PHP Version: 4.3.1
New Comment:
Hi again!
I finaly nailed it down to be a problem in handling the input buffer
reading in Zend/zend_language_scanner.c!
With the patch below the resulting phps will work with "include()" and
"require()" but I know that this so patched file gets generated by lex
(flex) and so one should perhaps change either the .l input or the
Zend/flex.skl file(s).
But I did know that there is a big chance that a call to fread() might
return 0 as a result and that this is absolutely legal and no reason to
bail out. And in my understanding from flex.skl this is what YY_INPUT()
was
defined to tolerate (aka only bail out if fread() returns < 0)!
But since I'm no flex god, I will leave this to whom it may concern ;-)
Salut, Joerg
BTW:
jsl@floyd:~/projekte/ep2/src/php-4.3.1> flex -V
flex version 2.5.4
Of course the follwing hunk will fail on any other machine since every
other implementation/version of lex (flex) would have generated other
line
numbers... :-)
--- snip ------------------------------------------------------------
*** Zend/zend_language_scanner.c Wed May 7 12:04:39 2003
--- Zend/zend_language_scanner.c.orig Wed May 7 12:04:35 2003
***************
*** 3521,3527 ****
YY_FATAL_ERROR( "input in flex scanner
failed" ); \
result = n; \
} \
! else if ( ((result = fread( buf, 1, max_size, yyin )) < 0) \
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
--- 3521,3527 ----
YY_FATAL_ERROR( "input in flex scanner
failed" ); \
result = n; \
} \
! else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
--- snap ------------------------------------------------------------
Previous Comments:
------------------------------------------------------------------------
[2003-05-07 04:01:06] jsl123 at web dot de
a few other tests:
it's not the permissions. I tried a complete accessible file in a wide
open
dir...
including or requiring from an absolute path gives the same error
there's no difference if the file is empty or text/plain or text/html
Joerg
------------------------------------------------------------------------
[2003-05-07 03:46:20] jsl123 at web dot de
Same here. (same kernel, uClibc version, php version)
I did configure with: "CFLAGS=-march=i486 ... --disable-all" against
the
same ver. of uClibc and also re-conf'd and recompiled the Zend engine
but
to no avail.
Add. tests have been done with changed php.ini's (exact path was
included/not included).
It's *not* a problem of finding the file!
require('') gives the same error :-(
sapi/cli/php also yieds the same output
If someone with better knowledge about debugging flex-engines is
reading
this, I would like to mail her my phpinfo() and help with testing...
Thank you. Salut, Joerg
------------------------------------------------------------------------
[2003-05-06 20:55:21] joe at cityofsanmateo dot org
compiled php 4.3.1 against uclibc 0.9.19 using the development
image supplied at www.uclibc.org
configured with
configure --disable-ipv6
eveything compiles and runs but any include() 'd calls
fail with 'input in flex scanner failed',
to replicate, once compiled run:
#touch tmpfile
#
#echo "<?php include('tmpfile') ?>"|php
i think it might be a uclibc issue as it runs fine, on the same machine
but compiled under redhat 9, but not sure
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23521&edit=1