On Sun, Apr 8, 2012 at 2:26 AM, Derick Rethans <der...@php.net> wrote:
> On Sat, 7 Apr 2012, Matthew Hernandez wrote: > > > How can I valgrind my extension? Google isn't bringing up many php > > extension topics :/ > > On the shell: > > export USE_ZEND_ALLOC=0 > export ZEND_DONT_UNLOAD_MODULES=1 > valgrind php -dextension=yourextension.so yourscript.php > > See for some more info here: > http://derickrethans.nl/valgrinding-shared-modules.html thanks, this solved the seg fault issue in no time. > > > > I can't figure out why I keep getting a seg fault: > > > > typedef struct _foo_object { > > zend_object std; > > zval *elements; > > } foo_object; > > > > static foo_object *foo_object_ptr; > > You really want to avoid real globals like this though, as it makes > things not thread-safe. > thanks, I'll avoid doing it like this. Which reminds me. Would you happen to have a "best practices" for php-extension development that I could reference? I've found a few articles around, mostly out dated. > Also, please don't top-reply on this list. > sorry. > > cheers, > Derick > > -- > http://derickrethans.nl | http://xdebug.org > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > twitter: @derickr and @xdebug >