#50844 [NEW]: misbehaviour of zend_ts_hash_apply_with_arguments

From: Date: Tue, 26 Jan 2010 10:27:16 +0000
Subject: #50844 [NEW]: misbehaviour of zend_ts_hash_apply_with_arguments
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-146951@lists.php.net to get a copy of this message
From:             Martin dot Eisengardt at fiducia dot de
Operating system: Vista64-cygwin
PHP version:      5.3.1
PHP Bug Type:     Reproducible crash
Bug description:  misbehaviour of zend_ts_hash_apply_with_arguments

Description:
------------
I was using a TsHashTable in my extension and assumed that it behaves the
same as normal HashTable. It is almost the same except function
zend_ts_hash_apply_with_arguments.

Reproduce code:
---------------
function applyFunc(void *pDest TSRMLS_DC, int num_args, va_list args,
zend_hash_key *hash_key)
{
    int myint = va_arg(args, int);
    // myint will contain the wrong integer. Hoever the following code
will work
    // va_list args2 = va_arg(args2, va_list);
    // int myint = va_arg(args2, int);
}


zend_ts_hash_apply_with_arguments(ht TSRMLS_CC, applyFunc, 1, myInt);

Expected result:
----------------
Expected that there is no need to extract args2 before extracting the
actual argument. In other word: Expected to use the same applyFunc for
both, TsHashTable and HashTable

Actual result:
--------------
You need to extract another va_list first before extracting the arguments

-- 
Edit bug report at http://bugs.php.net/?id=50844&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=50844&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=50844&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=50844&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=50844&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50844&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=50844&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=50844&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=50844&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=50844&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=50844&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=50844&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=50844&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=50844&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=50844&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50844&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50844&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=50844&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=50844&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=50844&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=50844&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=50844&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#146951) next »