php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8621 be careful with interactive cmd line mode
Submitted: 2001-01-09 18:26 UTC Modified: 2001-04-30 01:30 UTC
From: boian at bonev dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.3pl1 - 4.0.6-dev OS: Linux glibc 2.1
Private report: No CVE-ID: None
 [2001-01-09 18:26 UTC] boian at bonev dot com
tst.php: <? $malei='something'; ?>

php -a tst.php 

produces:

Interactive mode enabled

X-Powered-By: PHP/4.0.3pl1
Content-type: text/html

Segmentation fault

-----------------------

another command line example:

php -a
Interactive mode enabled

<? $bassi='aaaaa'; ?>

X-Powered-By: PHP/4.0.3pl1
Content-type: text/html


Segmentation fault


same result with 4.0.4 soon will test with latest CVS

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-10 15:47 UTC] boian at bonev dot com
really i think that merely noone cares about interactive mode but... problem exists in latest CVS:

Interactive mode enabled

<? $boza='kosmi'; ?>

X-Powered-By: PHP/4.0.5-dev
Content-type: text/html


Segmentation fault
 [2001-04-28 14:20 UTC] derick@php.net
I can not reproduce this with the latest CVS (28/04/2001)
so closing.
 [2001-04-29 12:00 UTC] derick@php.net
user reports:
bbonev@orange:~/php/php4$ ./php -a
Interactive mode enabled

<? $a=1 ?>
X-Powered-By: PHP/4.0.6-dev
Content-type: text/html

Segmentation fault
bbonev@orange:~/php/php4$

it still exists, maybe this does not crash on win32?

what about interactive mode with win32 cgi php? i am not sure but it may be
handled differently on *nix and win32

---------------

I tried this on Linux, and it didn't segfault for me.

Can you make a backtrace of it and add it here?
 [2001-04-29 13:05 UTC] bbonev@php.net
date: Sun Apr 29 19:59:15 EEST 2001
cvs up
./cvsclean
./buildconf
./configure
make
gdb
file ./php
set args -a
run

Interactive mode enabled

<? $a=1 ?>
X-Powered-By: PHP/4.0.6-dev
Content-type: text/html


Program received signal SIGSEGV, Segmentation fault.
0x80c09b9 in _zval_ptr_dtor (zval_ptr=0x8169130) at zend_execute_API.c:259
259             (*zval_ptr)->refcount--;
(gdb) bt full
#0  0x80c09b9 in _zval_ptr_dtor (zval_ptr=0x8169130) at zend_execute_API.c:259
        zval_ptr = (zval **) 0x8169130
#1  0x80c9d81 in zend_hash_destroy (ht=0x813dfac) at zend_hash.c:560
        ht = (HashTable *) 0x813dfac
        p = (Bucket *) 0x0
        q = (Bucket *) 0x8169124
#2  0x80c085a in shutdown_executor () at zend_execute_API.c:165
No locals.
#3  0x80c6c7f in zend_deactivate () at zend.c:536
No locals.
#4  0x805e89e in php_request_shutdown (dummy=0x0) at main.c:660
No locals.
#5  0x805dc9e in main (argc=2, argv=0xbffff904) at cgi_main.c:768
        exit_status = 0
        cgi = 0
        c = 31
        i = -1073743732
        len = 135668168
        file_handle = {type = 2 '\002', filename = 0x80f2885 "-", opened_path = 0x0, handle = {fd = 1075232896, 
    fp = 0x4016c080}, free_filename = 0 '\000'}
        s = 0x81621c8 ""
        behavior = 1
        no_headers = 0
        orig_optind = 1
        orig_optarg = 0x0
        argv0 = 0x0
        script_file = 0x0
        global_vars = {head = 0x0, tail = 0x0, size = 4, dtor = 0, persistent = 0 '\000', traverse_ptr = 0x4000aa70}
        interactive = 1
#6  0x400a1577 in __libc_start_main () from /lib/libc.so.6

 [2001-04-29 17:50 UTC] jmoore@php.net
---------- Forwarded message ----------
Date: Sun, 29 Apr 2001 20:13:24 +0300
From: Boian Bonev <boian@bonev.com>
To: Derick Rethans <d.rethans@jdimedia.nl>
Subject: bug 8621

i think this is a (e)free on something that is not (e)malloc-ed. or freed twice. i know nothing about the interactive mode and could not get the idea from the source

i have tried to track this down several weeks ago but i could not find a simple reason for the segfault

b.

 [2001-04-30 01:30 UTC] andi@php.net
Should be fixed in latest CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC