Bug #69846 [NEW]: Segmenation fault (access violation) when iterating over DOMNodeList

From: Date: Tue, 16 Jun 2015 07:05:04 +0000
Subject: Bug #69846 [NEW]: Segmenation fault (access violation) when iterating over DOMNodeList
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193536@lists.php.net to get a copy of this message
From:             jan dot slabon at setasign dot com
Operating system: Windows 7 Pro (x64)
PHP version:      7.0.0alpha1
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Segmenation fault (access violation) when iterating over DOMNodeList

Description:
------------
I'm using the "VC14 x64 Thread Safe" version with following extensions
enabled:
extension=php_mbstring.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_soap.dll
extension=php_sqlite3.dll

I encounter a problem when iterating over a DOMNodeList object while
overwriting the $value:

foreach ($dataNodes AS $node) {
    $node = $datasetDom->importNode($node, true);
    // ...
}

Actually I'm not able to reproduce this separated from our unit tests
but at least I have a backtrace (that's what I get, if I follow this
guide: https://bugs.php.net/bugs-generating-backtrace-win32.php)
- see
actual result.

I can provide the full dump if necessary.

The behaviour is very strange because it can be manipulated/suppressed
by simply removing an entry from another array in another scope which
will never be used. Or by simply running the test wihout another which
are absolutely independed from each other.

Actual result:
--------------
Thread report

Thread 0 - System ID 8580

Entry point
  php!mainCRTStartup
Create time
  15.06.2015 23:06:26

Time spent in user mode
  0 Days 00:00:00.093

Time spent in kernel mode
  0 Days 00:00:00.312


Function
php7ts!php_dom_create_object+36
php7ts!php_dom_iterator_move_forward+154
php7ts!ZEND_FE_FETCH_R_SPEC_VAR_HANDLER+206
php7ts!execute_ex+38
php7ts!zend_call_function+367bd3
php7ts!zim_reflection_method_invokeArgs+363
php7ts!ZEND_DO_FCALL_SPEC_HANDLER+10a
php7ts!execute_ex+38
php7ts!zend_execute+1db
php7ts!zend_execute_scripts+13e
php7ts!php_execute_script+521
php!do_cli+73c
php!main+400
php!__scrt_common_main_seh+124
kernel32!BaseThreadInitThunk+d
ntdll!RtlUserThreadStart+1d

Exception Information

PHP7TS!PHP_DOM_CREATE_OBJECT+36In
php__PID__8788__Date__06_15_2015__Time_11_06_29PM__945__Second_Chance_Exception_C0000005.dmp
the assembly instruction at php7ts!php_dom_create_object+36 in C:\php
7.0.0alpha1\php7ts.dll from The PHP Group has caused an access violation
exception (0xC0000005) when trying to read from memory location
0x00000000 on thread 0

-- 
Edit bug report at https://bugs.php.net/bug.php?id=69846&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69846&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69846&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69846&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69846&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69846&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69846&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69846&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69846&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69846&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69846&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69846&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69846&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69846&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69846&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69846&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69846&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69846&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69846&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69846&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69846&r=mysqlcfg



Thread (13 messages)

« previous php.bugs (#193536) next »