php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #970 get_browser() dumps core
Submitted: 1998-12-03 16:17 UTC Modified: 2000-08-06 09:24 UTC
From: sklar at student dot net Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.7 OS: Linux 2.0.35
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sklar at student dot net
New email:
PHP Version: OS:

 

 [1998-12-03 16:17 UTC] sklar at student dot net
PHP 3.0.5 apache module + Apache 1.3.3 + Linux 2.0.35

<?php $browser = get_browser() ?> dumps core every time.

I've tried this both with Zeev's browscap file and the one from cyscape.

A backtrace:

(gdb) run -X -d ~/apache-test -f conf
Starting program: /home/sklar/apache-test/apache -X -d ~/apache-test -f conf

Program received signal SIGSEGV, Segmentation fault.
0x0 in ?? ()
(gdb) bt
#0  0x0 in ?? ()
#1  0x80635db in _php3_hash_find (ht=0x812d9a4, 
    arKey=0x8157778 "Mozilla/4.5 [en] (Win95; I)", nKeyLength=28, 
    pData=0xbfffebd4) at php3_hash.c:836
#2  0x8085621 in php3_get_browser (ht=0x81585a0, return_value=0x811b678, 
    list=0x812da48, plist=0x812da1c) at functions/browscap.c:104
#3  0x808e544 in phpparse () at control_structures_inline.h:930
#4  0x806237a in php3_parse (yyin=0x81520f0) at main.c:1465
#5  0x8062618 in apache_php3_module_main (r=0x814f87c, fd=20, 
    display_source_mode=0, preprocessed=0) at main.c:1845
#6  0x805fc48 in send_php3 ()
#7  0x805fcac in send_parsed_php3 ()
#8  0x8097deb in ap_invoke_handler ()
#9  0x80a9fa9 in process_request_internal ()
#10 0x80aa008 in ap_process_request ()
#11 0x80a2379 in child_main ()
#12 0x80a2504 in make_child ()
#13 0x80a2667 in startup_children ()
#14 0x80a2c5c in standalone_main ()
#15 0x80a342f in main ()
(gdb) up
#1  0x80635db in _php3_hash_find (ht=0x812d9a4, 
    arKey=0x8157778 "Mozilla/4.5 [en] (Win95; I)", nKeyLength=28, 
    pData=0xbfffebd4) at php3_hash.c:836
836             h = ht->pHashFunction(arKey, nKeyLength);
(gdb) print *ht
$1 = {nTableSize = 0, nHashSizeIndex = 0, nNumOfElements = 0, 
  nNextFreeElement = 0, pHashFunction = 0, pInternalPointer = 0x0, 
  pListHead = 0x0, pListTail = 0x0, arBuckets = 0x0, pDestructor = 0, 
  persistent = 0 '\000'}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-05-13 16:23 UTC] sklar at student dot net
This still happens with 3.0.7. Same coredump.
Is anyone able to reproduce this?
 [1999-12-13 15:36 UTC] joey at cvs dot php dot net
Do you still see this with newer versions of PHP?
 [2000-08-06 09:24 UTC] rasmus@php.net
Fixed in PHP 4 (try a snapshot from snaps.php.net)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 18:01:34 2025 UTC