NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
debugger causes segfault with MultipleIterator


Joined: 27 Nov 2009
Posts: 98
Reply with quote
The below script will execute without error if debugger is not configured in php.ini. It will also execute without error with debugger configured for the first time $a1->test() is called but causes the following segfault on the second call to $a2->test(). This occurs both when debugging with PhpED IDE or executing by Apache. I am running PHP 7.4.7 on Centos 7.8.2003 with PhpED Professional 19.2 Build 19214 64 bit. Can someone try executing it to see if you get the same results? Anyone know whether it is fixed for the new 19.3? If so, is it possible to upgrade the debugger without upgrading the IDE? If not fixed, what is the process of reporting a bug? Thanks

EDIT. Appears to only happen if the MultipleIterator is fed a generator and I do not experience the same issues when giving it ArrayIterators. Unfortunately, I don't wish to give it an ArrayIterator.


kernel: php-fpm[29788]: segfault at 7f51ad5e4120 ip 0000565042e87fcd sp 00007ffe5e56f048 error 4 in php-fpm[565042b67000+471000]


Code:
<?php
ini_set('display_errors', 1);

class A
{
    public function test()
    {
        $iterator = new \MultipleIterator(\MultipleIterator::MIT_NEED_ALL|\MultipleIterator::MIT_KEYS_ASSOC);
        $iterator1 = $this->getIterator(1);
        $iterator2 = $this->getIterator(2);
        $iterator->attachIterator($iterator1, 'iterator1');
        $iterator->attachIterator($iterator2, 'iterator2');
        $values = [];
        foreach($iterator as $v) {
            $values[] = $v['iterator2'] - $v['iterator1'];
        }
        return $values;
    }

    public function getIterator($x)
    {
        for($index=0; $index < 10; $index++) {
            yield $x*$index;
        }
    }
}

$a1 = new A();
$o1=$a1->test();
print_r($o1);

//Second pass causes segfault

$a2 = new A();
$o2=$a2->test();
print_r($o2);
View user's profileFind all posts by NotionCommotionSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Sounds like http://forum.nusphere.com/dbg-9-2-8-segmentation-fault-t10747.html
If so, it's _worked_ around in 19.3 as it wasn't debugger fault. at least not entirely.
As of upgrading only debugger, sorry it's not possible as old IDE is not compatible with new debugger

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 27 Nov 2009
Posts: 98
Reply with quote
dmitri wrote:
Sounds like http://forum.nusphere.com/dbg-9-2-8-segmentation-fault-t10747.html
If so, it's _worked_ around in 19.3 as it wasn't debugger fault. at least not entirely.
As of upgrading only debugger, sorry it's not possible as old IDE is not compatible with new debugger


Thanks. 19.3 works without error.
View user's profileFind all posts by NotionCommotionSend private message
debugger causes segfault with MultipleIterator
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic