Re: Re: [PHP-DEV] Fwd: zend_std_get_method : Address 0xffffffff is not stack'd, malloc'd or (recently) free'd

From: Date: Wed, 02 Apr 2014 15:21:31 +0000
Subject: Re: Re: [PHP-DEV] Fwd: zend_std_get_method : Address 0xffffffff is not stack'd, malloc'd or (recently) free'd
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-73522@lists.php.net to get a copy of this message
On Wed, Apr 2, 2014 at 8:42 AM, Kajetan Dolinar <kajetan@jesej.si> wrote: > Hi Johannes, Stas > > Please find the code with the explanation of how to reproduce the fault > on the following link: > https://github.com/kdolinar/hypx-zend-bugcase > > The main Zend PHP extension logic for the classes is in src/hypx.c. > Much obliged for your opinion. Thanks. > > Kajetan > > ==== Some more info ==== > > On my machine, uname -a says > > Linux machine 3.4.6-2.10-desktop #1 SMP PREEMPT Wed Sep 25 08:50:55 CEST > 2013 i686 i686 i386 GNU/Linux > > cat /etc/os-release says > > NAME=openSUSE > VERSION="12.2 (Mantis)" > VERSION_ID="12.2" > PRETTY_NAME="openSUSE 12.2 (Mantis) (i586)" > ID=opensuse > ANSI_COLOR="0;32" > CPE_NAME="cpe:/o:opensuse:opensuse:12.2" > > phpize says > > PHP Api Version: 20090626 > Zend Module Api No: 20090626 > Zend Extension Api No: 220090626 > > and php --version says > > PHP 5.3.15 (cli) > Copyright (c) 1997-2012 The PHP Group > Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies > > Please come back to me if you need anything more ... > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Hi, fixed: https://gist.github.com/bukka/9936176 The main problem was that you are trying to save return_value to static variable and then re-use it ( https://github.com/kdolinar/hypx-zend-bugcase/blob/master/src/hypx.c#L302 ) That won't work because of GC (value can be freed in the meantime). There were also some memory leaks and missing TSRMLS that I fixed. Compare the the gist file and you will see that. I fixed just this case so the index.php works. However there might be more similar case that you need to check... Jakub

« previous php.internals (#73522) next »