News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Derick Rethans' Blog:
Valgrinding shared modules
August 08, 2011 @ 14:35:20

In the process of some development he's been doing on various shared modules for PHP, Derick Rethans stumbled across an issue with using Valgrind to test his code:

While testing whether I correctly free all memory with Valgrind, I ran into the issue where I couldn't see the stack frames of where the memory leaks occurred in the extensions, and once I even ran into a Valgrind bug. The reason why Valgrind could not show the function names belonging to the stack frames is because PHP had already unloaded the shared extensions from memory.

A work-around he found was compiling the modules, but he wanted something "more correct" and less of a hassle. As a result he added a check for the ZEND_DONT_UNLOAD_MODULES environment flag to the PHP core to handles this case specifically. He includes a snippet of example code showing the Valgrind results with and without the flag.

0 comments voice your opinion now!
valgrind memory flag unload extension patch


blog comments powered by Disqus

Similar Posts

Pierre-Alain Joye's Blog: PECL Zip 1.5.0, features additions, modify OpenDocument

Clay Loveless' Blog: Monitor PHP Extension Releases with Y! Pipes

Christian Stocker's Blog: Upload Progress Meter for Windows - The next take

Scott Mattocks\' Blog: PHP-GTK News #10

Ilia Alshanetsky's Blog: MySQL Binaries and cURL/http extensions in PHP


Community Events

Don't see your event here?
Let us know!


api wordpress laravel opinion library voicesoftheelephpant unittest php7 interview example introduction extension language framework series community version release laravel5 podcast

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework