Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19069 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27047 invoked by uid 1010); 17 Sep 2005 17:51:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 27032 invoked from network); 17 Sep 2005 17:51:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2005 17:51:04 -0000 X-Host-Fingerprint: 69.12.155.130 69-12-155-130.dsl.static.sonic.net Linux 2.4/2.6 Received: from ([69.12.155.130:1422] helo=pigeon.alphaweb.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 43/ED-43379-7875C234 for ; Sat, 17 Sep 2005 13:51:03 -0400 Received: from localhost ([127.0.0.1] helo=lighthammer) by pigeon.alphaweb.net with smtp (Exim 4.10) id 1EGgAU-0007Oe-00; Sat, 17 Sep 2005 10:08:02 -0700 Message-ID: <002901c5bbb0$5bec53e0$6c051fac@lighthammer> To: "RG" Cc: References: <29.87.41173.A9FD9234@pb1.pair.com> <00f301c5ba49$455192c0$5c8be5a9@ohr.berkeley.edu> <5A.79.43379.A1E1A234@pb1.pair.com> <001901c5ba69$b6573c70$6c051fac@lighthammer> <87.AB.43379.8F14B234@pb1.pair.com> <432BAFA0.2060401@php.net> <69.8D.43379.B4F4C234@pb1.pair.com> Date: Sat, 17 Sep 2005 10:50:37 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] Re: Segfault From: pollita@php.net ("Sara Golemon") > What I meant to say was that I did use zend_fetch_list_dtor_id in RINIT > at > first, but I noticed that PHP was not calling RINIT. So then I migrated it > MINIT, which is called when the module is loaded. > Doubtful... PHP calls every module's RINIT at the start of every request. If you were "testing" RINIT by launching something like `php -m` or `php -i` or something then sure RINIT wouldn't be called. There's no actual request involved. In a real script execute it most certainly would call RINIT. > As for malloc/emalloc, I tried using malloc(sizeof(struct php_socket)); > which did not work because gcc was erroring with "Incomplete datatype". I > then re-read the Zend API function list and came across emalloc, which I > had > omitted when I first read it. So once I used emalloc, it worked. > The malloc/emalloc issue is genuine enough in that yes, you do need to be using the emalloc() family over the system malloc allocators (except in rare cases involving persistency). The larger issue of the incomplete type comes from the fact that the form of your structure declaration means you'll want to get your size from sizeof(php_socket) not sizeof(struct php_socket). typedef struct { PHP_SOCKET bsd_socket; int type; int error; } php_socket;