Re: Overloading methods : segfaults
| From: | Andi Gutmans | Date: | Tue, 28 Sep 2004 03:45:23 +0000 |
| Subject: | Re: Overloading methods : segfaults | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-1406@lists.php.net to get a copy of this message | ||
Yep and you might also want to look at the PECL Perl extension. Both are good resources.
Andi
At 03:15 PM 9/27/2004 +0100, Wez Furlong wrote:
Take a look at the com_handlers.c file in the com_dotnet extension to see how to handle this kind of thing. --Wez. On Tue, 28 Sep 2004 01:04:55 +1100, Andrey Demenev <demenev@on-line.jar.ru> wrote: Hello Not sure if this is appropriate list. Maybe internals? I am writing a PHP extension implementing an embedded Ruby interpreter (http://www.ruby-lang.org/). It requires method and property overloading. Overloading was successfully implemented in ZE1 version of extension. When porting the extension to ZE2, I have faced with segfaults when calling overloaded methods (no problem with property overloading). I suspected that the problem may be caused by external libraries, and wrote a minimalistic test extension (see attachment). It simply prints out name of called method, but the problem is the same. Backtrace : -----------------------8<--------------------------------------- [andrey@andrey php5-STABLE-200409271030]# gdb sapi/cli/php GNU gdb 6.0-2mdk (Mandrake Linux) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-mandrake-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) r Starting program: /home/andrey/Documents/php5-STABLE-200409271030/sapi/cli/php <?php $o=new Test; $o->someMethod(); ?> someMethod called Program received signal SIGSEGV, Segmentation fault. 0x080dfbd5 in shutdown_memory_manager (silent=0, full_shutdown=0)at /home/andrey/Documents/php5-STABLE-200409271030/Zend/zend_alloc.c:485 485 for (j=0; j<AG(cache_count)[i]; j++) {(gdb) bt #0 0x080dfbd5 in shutdown_memory_manager (silent=0, full_shutdown=0)at /home/andrey/Documents/php5-STABLE-200409271030/Zend/zend_alloc.c:485#1 0x080c04c6 in php_request_shutdown (dummy=0x0)at /home/andrey/Documents/php5-STABLE-200409271030/main/main.c:1223#2 0x0811f16f in main (argc=1, argv=0xbffff624)at /home/andrey/Documents/php5-STABLE-200409271030/sapi/cli/php_cli.c:1046(gdb) ----------------------------->8------------------------------------------------- Mandrake Linux 10 Official, PHP 5 stable built on Sep 27, 2004 10:30 GMT gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk) Could someone familiar with ZE2 internals please take a look at the source? Am I missing something? Should I post this to internals list? File a bug report? -- Andrey Demenev aka blindman -- PECL development discussion Mailing List (http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PECL development discussion Mailing List (http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php