Skip to content

Memory Leak in DOM -> insertBefore #16534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chibinz opened this issue Oct 21, 2024 · 1 comment
Closed

Memory Leak in DOM -> insertBefore #16534

chibinz opened this issue Oct 21, 2024 · 1 comment

Comments

@chibinz
Copy link

chibinz commented Oct 21, 2024

Description

The following code:

<?php
$v0 = new DOMAttr ( "i" );
$v8 = new DOMDocument ( );

$v8 -> insertBefore ( $v0 );

Resulted in this output:


Fatal error: Uncaught Error: Cannot add newnode as the previous sibling of refnode in /workspaces/TriFuzz/triaged/dom_leak2.php:5
Stack trace:
#0 /workspaces/TriFuzz/triaged/dom_leak2.php(5): DOMNode->insertBefore(Object(DOMAttr))
#1 {main}
  thrown in /workspaces/TriFuzz/triaged/dom_leak2.php on line 5

=================================================================
==1231==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x5650eda879ae in malloc /opt/llvm-15-build/llvm-15.x/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x7faa3c34bdad in xmlNewProp (/lib/x86_64-linux-gnu/libxml2.so.2+0x62dad) (BuildId: aebf8e42966c3ce475ff9d9d51a762831adcbb61)

Indirect leak of 2 byte(s) in 1 object(s) allocated from:
    #0 0x5650eda879ae in malloc /opt/llvm-15-build/llvm-15.x/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x7faa3c3cc7f2 in xmlStrdup (/lib/x86_64-linux-gnu/libxml2.so.2+0xe37f2) (BuildId: aebf8e42966c3ce475ff9d9d51a762831adcbb61)

SUMMARY: AddressSanitizer: 98 byte(s) leaked in 2 allocation(s).

PHP Version

PHP 8.5.0-dev

Operating System

No response

@nielsdos
Copy link
Member

Duplicate of your other bug report #16533
#16537 fixes this too.

@nielsdos nielsdos closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants