Re: shutdown_memory_manager and resource handling
| From: | Rasmus Lerdorf | Date: | Mon, 11 Aug 2003 14:53:38 +0000 |
| Subject: | Re: shutdown_memory_manager and resource handling | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-3856@lists.php.net to get a copy of this message | ||
Can't you get a line number and the actual address being accessed to cause
that crash?
On Mon, 11 Aug 2003, Justin Hannus wrote:
> I'm writing an ext for Apples OpenDirectory (directory services) API and it
> makes heavy use of registering resources in the zend internal list. I'm also
> new to the Zend API.
>
>
> As of now I have about 4 resource types so far. In Short, my resource life
> span goes like:
> 1. zend_register_list_destructors_ex(... for each resource in
> ZEND_MINIT_FUNCTION()
> 2. register a resource and return it, RETURN_RESOURCE(zend_list_insert(rsrc,
> le_rsrc));
> 3. upon user destruction function, zend_list_delete(Z_LVAL_P(z_rsrc));
> 4. resource destructor is called when deleted from the internal list, frees
> all assoc memory allocated/closes any connections then uses efree to free up
> memory alloced to the resource with emalloc.
>
> My problem is, all my resources get deleted from the list and my destructors
> are called an exit properly but at the end of my php script, while testing,
> I get a bus error on the very last line. The backtrace boils down to
> shutdown_memory_manager. My thoughts are that I must have something wrong in
> the destruction of resources, does anyone know what would cause the bus
> error in shutdown_memory_manager? A backtrace is below, I can also provide
> more detailed code snippets.
>
> $ php -v
> PHP 4.3.0 (cli) (built: Dec 27 2002 20:26:15)
> Copyright (c) 1997-2002 The PHP Group
> Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
> $ tail ~/Library/Logs/CrashReporter/php.crash.log
> **********
>
> Date/Time: 2003-08-11 09:25:46 -0400
> OS Version: 10.2.5 (Build 6L29)
> Host: 128kb.com
>
> Command: php
> PID: 12508
>
> Exception: EXC_BAD_ACCESS (0x0001)
> Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
>
> Thread 0 Crashed:
> #0 0x0018aeb0 in shutdown_memory_manager
> #1 0x0015e354 in php_request_shutdown
> #2 0x001c25c0 in main
> #3 0x00001d24 in _start
> #4 0x00001b54 in start
>
> PPC Thread State:
> srr0: 0x0018aeb0 srr1: 0x0200f030 vrsave: 0x00000000
> xer: 0x00000000 lr: 0x0018aee0 ctr: 0x90003da0 mq: 0x00000000
> r0: 0x008a931b r1: 0xbfffdf50 r2: 0x00000000 r3: 0x005bf010
> r4: 0x008b43a0 r5: 0x0000000c r6: 0x002c6100 r7: 0x00000000
> r8: 0x005bf010 r9: 0x00000000 r10: 0x00000002 r11: 0x008b43a0
> r12: 0x90003da0 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
> r16: 0x00000000 r17: 0x00000000 r18: 0x00000000 r19: 0x00000000
> r20: 0x00000000 r21: 0x00000000 r22: 0x00000000 r23: 0x00000000
> r24: 0x00000000 r25: 0x00000000 r26: 0xbffff968 r27: 0x00000010
> r28: 0x00000003 r29: 0xbffff97c r30: 0xbfffdf50 r31: 0x0018ade8
>
>
> --
> Justin Hannus
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>