|  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
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.
Block user comment
Status: Assign to:
Bug Type:
From: mg at connection-net dot de
New email:
PHP Version: OS:


 [2004-05-18 11:49 UTC] mg at connection-net dot de
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/
(gdb) bt
#0  0x4061a37b in strlen () from /lib/
#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/


Add a Patch

Pull Requests

Add a Pull Request


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 @@

-       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]
Assigning to the maintainer, sascha.
 [2005-03-06 22:10 UTC]
Please try using this CVS snapshot:
For Windows:

 [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:
"hostname is an obsolete field. Don't use it in your applications."
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 09:01:28 2024 UTC