Bug #872: Large numbers of Apache log directives cause PHP to fail

From: Date: Sun, 25 Oct 1998 22:00:07 +0000
Subject: Bug #872: Large numbers of Apache log directives cause PHP to fail
Groups: php.dev 
Request: Send a blank email to php-dev+get-2014@lists.php.net to get a copy of this message
From: maupin@easystreet.com Operating system: SunOS 4.1.4 PHP version: 3.0.5 PHP Bug Type: Reproduceable crash Bug description: Large numbers of Apache log directives cause PHP to fail Hi, When Apache is compiled with PHP and is configured with a large number of virtual hosts, each of which has its own set of log file directives, PHP returns empty documents (i.e., Communicator reports "Document contains no data"). In my experiments, I've found that the problem manifests itself when somewhere between 110 and 115 log file directives are present. My configuration uses "TransferLog", "ErrorLog", and "RewriteLog", but I suspect other log directives would contribute to the problem as well. I'm running PHP v3.0.5 as a module in Apache v1.3.2 under SunOS v4.1.4. No modules were compiled into PHP. I've observed the same problem in PHP versions going back to at least v3.0. Red Hat Linux v5.1 with kernel v2.0.33 appears immune to the problem. The call to the "YY_INPUT" macro on line 4329 in the "yy_get_next_buffer" function of "language-scanner.c" generates the error. I've run Apache with the "-X" option under gdb and while the server does not core dump, it exits with status code 2 after executing "YY_INPUT" and "input in flex scanner failed" is written to the server's error log. PHP was compiled with GNU flex v2.5.4 and gcc v2.7.2.2. Here is a backtrace captured just prior to the execution of "YY_INPUT"... #0 yy_get_next_buffer () at language-scanner.c:4329 #1 0x50214 in lex_scan (phplval=0xefffe670) at language-scanner.c:4164 #2 0xc740 in read_next_token (tcm=0xcf098, token=0xefffe58c, phplval=0xefffe670) at token_cache.c:139 #3 0x40c8 in phplex (phplval=0xefffe670) at main.c:435 #4 0x3d770 in phpparse () at /usr/local/share/bison.simple:387 #5 0x62e0 in php3_parse (yyin=0xef6b1fd8) at main.c:1465 #6 0x66a8 in apache_php3_module_main (r=0x146b30, fd=128, display_source_mode=0, preprocessed=0) at main.c:1845 #7 0x25b4 in send_php3 () #8 0x263c in send_parsed_php3 () #9 0x59aa8 in ap_invoke_handler () #10 0x7a54c in process_request_internal () #11 0x7a5cc in ap_process_request () #12 0x6dbfc in child_main () #13 0x6ddf4 in make_child () #14 0x6dff8 in startup_children () #15 0x6eb24 in standalone_main () #16 0x6f694 in main () The problem can be reproduced by creating an Apache configuration with simple <VirtualHost> sections like the following. I recommend starting with 120 and removing "TransferLog" directives until the error disappears. The ServerName directives aren't necessary, but they aid in counting. Listen 192.168.1.1:80 NameVirtualHost 192.168.1.1:80 <VirtualHost 192.168.1.1:80> ServerName host001 TransferLog /dev/null </VirtualHost> <VirtualHost 192.168.1.1:80> ServerName host002 TransferLog /dev/null </VirtualHost> </VirtualHost> . . . <VirtualHost 192.168.1.1:80> ServerName host119 TransferLog /dev/null </VirtualHost> <VirtualHost 192.168.1.1:80> ServerName host120 TransferLog /dev/null </VirtualHost> -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#2014) next »