Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56265 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3887 invoked from network); 11 Nov 2011 00:17:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2011 00:17:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.215.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:50827] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/D3-17932-D896CBE4 for ; Thu, 10 Nov 2011 19:17:18 -0500 Received: by eyg7 with SMTP id 7so3268393eyg.29 for ; Thu, 10 Nov 2011 16:17:14 -0800 (PST) Received: by 10.68.36.103 with SMTP id p7mr18776008pbj.74.1320970633778; Thu, 10 Nov 2011 16:17:13 -0800 (PST) Received: from [192.168.200.5] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPS id lt8sm25465902pbb.0.2011.11.10.16.17.11 (version=SSLv3 cipher=OTHER); Thu, 10 Nov 2011 16:17:12 -0800 (PST) Message-ID: <4EBC6986.3090709@lerdorf.com> Date: Thu, 10 Nov 2011 16:17:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: PHP internals CC: arpad@php.net X-Enigmail-Version: 1.4a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Hash problems in session-oo code From: rasmus@lerdorf.com (Rasmus Lerdorf) Hey Arpad, looking through the code you added to ext/standard/basic_functions.c it looks like you are doing some weird key handling in the shutdown function hash. In register_user_shutdown_function() you have: zend_hash_update(BG(user_shutdown_function_names), function_name, sizeof(function_name), shutdown_function_entry, sizeof(php_shutdown_function_entry), NULL) And in remove_user_shutdown_function() you have: zend_hash_del_key_or_index(BG(user_shutdown_function_names), function_name, sizeof(function_name), 0, HASH_DEL_KEY) In both cases function_name is a char* so sizeof(function_name) is always going to be the size of a char* on whatever architecture you are on. But the way hash keys work, it is the actual string that is the key and you should be passing the length of that string here. -Rasmus