Skip to content

memory leak #19687

@chongwick

Description

@chongwick

Description

The following code:

<?php
$v_20552 = '�~Bе�~A�~B';
$v_20553 = __DIR__;
$v_20554 = DIRECTORY_SEPARATOR;
$v_20555 = $v_20553 . $v_20554;
$v_20556 = 'bug75063-utf8';
$v_20557 = $v_20555 . $v_20556;
$v_20579 = zend_test_create_throwing_resource();
$v_20560 = $v_20579 . $v_20552;
$v_20561 = mkdir($v_20557,);
$v_20580 = zend_test_create_throwing_resource();

Resulted in this output:

Warning: mkdir(): File exists in 78514ab7a0a4b165e021.php.er on line 10

Fatal error: Uncaught Exception: Throwing resource destructor called in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0

Fatal error: Couldn't execute method Exception::__toString in Unknown on line 0
Stack trace:
#0 {main}

=================================================================
==1870783==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 51 byte(s) in 1 object(s) allocated from:
    #0 0x66cd54 in strdup (/home/w023dtc/nightly_php/php-src/sapi/cli/php+0x66cd54)
    #1 0x6887c19 in do_cli /home/w023dtc/nightly_php/php-src/sapi/cli/php_cli.c:892:24
    #2 0x6883e0f in main /home/w023dtc/nightly_php/php-src/sapi/cli/php_cli.c:1363:18
    #3 0x1463215c6d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: AddressSanitizer: 51 byte(s) leaked in 1 allocation(s).

But I expected this output instead:

PHP Version

nightly

Operating System

ubuntu 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