php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28429 php CLI crashes when using FAM
Submitted: 2004-05-18 11:49 UTC Modified: 2005-03-14 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mg at connection-net dot de Assigned: sas (profile)
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.0.0RC2 OS: Gentoo Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mg at connection-net dot de
New email:
PHP Version: OS:

 

 [2004-05-18 11:49 UTC] mg at connection-net dot de
Description:
------------
php cli crashes when accessing the filenames of a FAM event.



Reproduce code:
---------------
        while (fam_pending($this->fam)) {
            $event = fam_next_event($this->fam);
            $code = $event["code"];
            $filename = $event["filename"];
            if (($code == FAMCreated) || ($code == 8) || ($code == 1)) {
               $tmp = "Test";
               if ($filename == $tmp) echo "1";
             }
         }

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 28225)]
0x4061a37b in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x4061a37b in strlen () from /lib/libc.so.6
#1  0x081e11f3 in add_assoc_string_ex (arg=0x40a8c863,
    key=0x40a8c863 <Address 0x40a8c863 out of bounds>, key_len=1084803171,
    str=0x40a8c863 <Address 0x40a8c863 out of bounds>, duplicate=1082028080)
    at /usr/src/php-5.0.0RC2/Zend/zend_API.c:794
#2  0x080a2a04 in zif_fam_next_event (ht=1084803171, return_value=0x40a8c863, this_ptr=0x0,
    return_value_used=1) at /usr/src/php-5.0.0RC2/ext/fam/fam.c:428
#3  0x081fe81a in zend_do_fcall_common_helper (execute_data=0xbfffccb0, opline=0x407e7014,
    op_array=0x407e5114) at /usr/src/php-5.0.0RC2/Zend/zend_execute.c:2699
#4  0x081fb599 in execute (op_array=0x407e5114)
    at /usr/src/php-5.0.0RC2/Zend/zend_execute.c:1391
#5  0x081fe60c in zend_do_fcall_common_helper (execute_data=0xbfffd030, opline=0x407df938,
    op_array=0x407de9b4) at /usr/src/php-5.0.0RC2/Zend/zend_execute.c:2728
#6  0x081fb599 in execute (op_array=0x407de9b4)
    at /usr/src/php-5.0.0RC2/Zend/zend_execute.c:1391
#7  0x081dfbe4 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /usr/src/php-5.0.0RC2/Zend/zend.c:1058
#8  0x081accad in php_execute_script (primary_file=0xbffff3e0)
    at /usr/src/php-5.0.0RC2/main/main.c:1630
#9  0x08207106 in main (argc=2, argv=0xbffff464)
    at /usr/src/php-5.0.0RC2/sapi/cli/php_cli.c:943
#10 0x405b8dcc in __libc_start_main () from /lib/libc.so.6

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-18 11:56 UTC] mg at connection-net dot de
it seems to be some problem with the fe.hostname in fam.c, when commented out, it does not crash anymore. Fam version is  2.7.0.

--- fam.c~      2004-05-18 11:52:39.564138166 +0200
+++ fam.c       2004-05-18 11:52:39.581135676 +0200
@@ -424,8 +424,8 @@
                RETURN_FALSE;

        array_init(return_value);
-       if (fe.hostname)
-               add_assoc_string(return_value, "hostname", fe.hostname, 1);
+//     if (fe.hostname)
+//             add_assoc_string(return_value, "hostname", fe.hostname, 1);
        add_assoc_string(return_value, "filename", fe.filename, 1);
        add_assoc_long(return_value, "code", fe.code);
 }
 [2004-05-18 21:55 UTC] derick@php.net
Assigning to the maintainer, sascha.
 [2005-03-06 22:10 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2005-04-08 21:00 UTC] felix at cdtinc dot ca
According to the SGI FAM documentation, the hostname field is deprecated:

http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/0650/bks/SGI_Developer/books/IIDsktp_IG/sgi_html/ch08.html#LE33384-PARENT
"hostname is an obsolete field. Don't use it in your applications."
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 21:03:34 2021 UTC