|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24243 Browscap causes segfault
Submitted: 2003-06-18 06:12 UTC Modified: 2004-01-13 13:00 UTC
Avg. Score:3.8 ± 0.8
Reproduced:3 of 4 (75.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: neon at neon-line dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-11-29 OS: *
Private report: No CVE-ID: None
 [2003-06-18 06:12 UTC] neon at neon-line dot net
Segmentation fault with php -v

Reproduce code:
php -v

Expected result:
PHP 5.0.0-dev (cli) (built: Jun 18 2003 08:06:52) (DEBUG)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v2.0.0, Copyright (c) 1998-2003 Zend Technologies

Actual result:
(gdb) run -v
Starting program: /usr/home/neon/php5-200306180930/sapi/cli/php -v

Program received signal SIGSEGV, Segmentation fault.
0x810c437 in zend_hash_find (ht=0x0, arKey=0xbfbfe988 "lwp", nKeyLength=4, pData=0xbfbfe9c8) at /usr/home/neon/php5-200306180930/Zend/zend_hash.c:840
840             nIndex = h & ht->nTableMask;
(gdb) bt
#0  0x810c437 in zend_hash_find (ht=0x0, arKey=0xbfbfe988 "lwp", nKeyLength=4, pData=0xbfbfe9c8) at /usr/home/neon/php5-200306180930/Zend/zend_hash.c:840
#1  0x8100732 in zend_lookup_class (name=0xbfbfe988 "lwp", name_length=3, ce=0xbfbfe9c8) at /usr/home/neon/php5-200306180930/Zend/zend_execute_API.c:703
#2  0x80ff2b8 in zend_get_constant (name=0x81d0880 "LWP::Simple", name_len=11, result=0xbfbfea00)
    at /usr/home/neon/php5-200306180930/Zend/zend_constants.c:251
#3  0x80f71c8 in zend_ini_get_constant (result=0xbfbfea70, name=0xbfbfead0) at Zend/zend_ini_parser.c:121
#4  0x80f77a8 in ini_parse () at Zend/zend_ini_parser.c:928
#5  0x80f72ea in zend_parse_ini_file (fh=0xbfbff8f0, unbuffered_errors=1, ini_parser_cb=0x8091560 <php_browscap_parser_cb>, arg=0x8170e60)
    at Zend/zend_ini_parser.c:176
#6  0x809180c in zm_startup_browscap (type=1, module_number=2) at /usr/home/neon/php5-200306180930/ext/standard/browscap.c:165
#7  0x808cc6f in zm_startup_basic (type=1, module_number=2) at /usr/home/neon/php5-200306180930/ext/standard/basic_functions.c:1084
#8  0x8109d46 in zend_startup_module (module=0x8167460) at /usr/home/neon/php5-200306180930/Zend/zend_API.c:1126
#9  0x80ded27 in php_startup_extensions (ptr=0x816fc88, count=7) at /usr/home/neon/php5-200306180930/main/main.c:1222
#10 0x812f7b1 in php_startup_internal_extensions () at main/internal_functions_cli.c:62
#11 0x80df115 in php_module_startup (sf=0x816fbe0, additional_modules=0x0, num_additional_modules=0) at /usr/home/neon/php5-200306180930/main/main.c:1387
#12 0x812e8aa in main (argc=2, argv=0xbfbffb88) at /usr/home/neon/php5-200306180930/sapi/cli/php_cli.c:592


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-18 06:37 UTC] neon at neon-line dot net
Browscap causes this segfault. Without it everything goes like it should.
 [2003-06-18 11:17 UTC]
As a temporary fix, you can put quotation marks around 
"LWP::Simple" where it says browser=LWP::Simple in 
browscap.ini. It's the double-colons that are messing 
things up, as zend_get_constant is trying to do a class 
lookup on the lwp class, which will obviously fail. 
Perhaps a flag argument could be added to 
zend_get_constant to prevent checking for '::' and that 
class lookup? (Or rather, zend_get_constant_ex or whatever 
with new defines for BC?)  
 [2003-07-16 23:35 UTC] php_bugs at garykeith dot com
As the offical source of browscap.ini for PHP I have to let you know that I'd love to modify the files I distribute to include quotes in the browser name. Unfortunately in IIS the quotes are included as part of the browser name. So as much as I'd like to help I guess we'll just have to wait for a bug fix.

 [2004-01-13 13:00 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 03:01:27 2023 UTC