php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9311 php -l causes segmentation fault
Submitted: 2001-02-16 21:40 UTC Modified: 2001-02-22 04:57 UTC
From: php at toowards dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.3pl1 OS: RedHat 6.2
Private report: No CVE-ID: None
 [2001-02-16 21:40 UTC] php at toowards dot com
Running "php -l test.php" on a script with a parse error
causes a segmentation fault.

test.php:
<?php

$test = "parse error here"
print $test;

?>

backtrace:
#0  0x80d7564 in destroy_op_array (op_array=0x0) at
zend_opcode.c:143
#1  0x8064c78 in php_lint_script (file=0xbffffc54) at
main.c:1228
#2  0x80635a9 in main (argc=3, argv=0xbffffcb4) at
cgi_main.c:718

One fix is to patch main/main.c (v 1.322) at line 1228
        if( op_array ) {
                destroy_op_array(op_array);
        }

(I tried this and now lint is happy)

A better solution is probably to fix zend_opcode.c though.
Tim

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-22 04:57 UTC] stas@php.net
Fixed in CVS. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC