Skip to content

segmentation fault #19685

@chongwick

Description

@chongwick

Description

The following code:

<?php
$v_39192 = 'AAAAAAAA';
$v_39193 = array('blocks' => $v_39192,);
$v_39212 = 'data://text/plain,HTTP/1.1 200 Ok\r\n';
$v_39205 = 'data://text/plain,HTTP/1.1 302 Moved Temporarily\r\n';
$v_39206 = 'Location: /try-again\r\n';
$v_39207 = $v_39205 . $v_39206;
if($v_39207){
$v_39208 = 'Transfer-Encoding: chunked\r\n\r\n';
$v_39209 = $v_39207 . $v_39208;
$v_39197 = fopen($v_39212,$v_39209,);
$v_39198 = 'bzip2.compress';
$v_39199 = STREAM_FILTER_WRITE;
$v_39193 = array('blocks' => $v_39192,);
$v_39221 = $v_39208 . $v_39198;
$v_39200 = stream_filter_append($v_39197,$v_39198,$v_39199,$v_39193,);
$v_39201 = fclose($v_39197,);
}

Resulted in this output:

Warning: stream_filter_append(): Invalid parameter given for number of blocks to allocate (0) in 078610c315f54a6f36d4.php.er on line 16
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1869751==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x7ffee4975890 sp 0x7ffee4975518 T0)
==1869751==Hint: pc points to the zero page.
==1869751==The signal is caused by a READ memory access.
==1869751==Hint: address points to the zero page.
    #0 0x0  (<unknown module>)
    #1 0x15080d9df51f  (/lib/x86_64-linux-gnu/libc.so.6+0x4251f)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>)
==1869751==ABORTING

But I expected this output instead:

PHP Version

PHP 8.5.0-dev (cli) (built: Sep  3 2025 09:48:58) (ZTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0-dev, Copyright (c), by Zend Technologies

Operating System

20.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions