Bug #70078 [NEW]: Memleak when calling PHP functions from XSL with nodes as parameter

From: Date: Tue, 14 Jul 2015 18:55:59 +0000
Subject: Bug #70078 [NEW]: Memleak when calling PHP functions from XSL with nodes as parameter
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194441@lists.php.net to get a copy of this message
From:             mplomer at gmx dot de
Operating system: any
PHP version:      5.6.11
Package:          XSLT related
Bug Type:         Bug
Bug description:Memleak when calling PHP functions from XSL with nodes as parameter

Description:
------------
When calling registered PHP functions in XSLTProcessor from a XSL
stylesheet with references to nodes as parameter, you will notice bad
performence and - depending on XML structure - a big memleak.

Test-Script see:
https://gist.github.com/not-implemented/bb41831a4892f1459e5b

Until 5.4.23 you have ~25 MB RAM usage of the process at the end
Starting with 5.4.24 you have ~1030 MB RAM usage of the process at the
end

Please notice, that this high usage is NOT covered by
memory_get_usage().

When passing a fixed string to the function instead of ".", the problem
ist not reproducable.

This seems to be introduced in Bug #49634 between 5.4.23 and 5.4.24 (or
maybe ~5.5.7 and 5.5.8) where nodes are recursively duplicated now.

Expected result:
----------------
Memory usage ~25 MB RAM

Actual result:
--------------
Memory usage ~1030 MB RAM

-- 
Edit bug report at https://bugs.php.net/bug.php?id=70078&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70078&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70078&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70078&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70078&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70078&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70078&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70078&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70078&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70078&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70078&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70078&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70078&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70078&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70078&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70078&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70078&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70078&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70078&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70078&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70078&r=mysqlcfg



Thread (16 messages)

« previous php.bugs (#194441) next »