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 ...
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-bugcaseThe 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/Linuxcat /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: 220090626and 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 TechnologiesPlease come back to me if you need anything more ...
--
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
Hi,
fixed: https://gist.github.com/bukka/9936176 [3]
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 [4] )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
Thanks, Jakub, very much for your insight. Yes, obviously saving a
return_value into a static property was a bad idea. But how can I then
create a persistent object and assign it to a static property? Here I'm
after a typical singleton class where the only instance of the object is
kept in a private static property.
Kajetan