nikic / scalar_objects

Extension that adds support for method calls on primitive types in PHP
MIT License
1.13k stars 44 forks source link

Segmentation Fault 11 #6

Closed CHH closed 9 years ago

CHH commented 11 years ago

I have this code, running it with 5.4.9 and the scalar_objects extension makes a "Segmentation Fault: 11" error.

<?php

namespace arrays;

class ArrayHandler
{
    function length()
    {
        var_dump($this);
        return count($this);
    }
}

register_primitive_type_handler('array', '\arrays\ArrayHandler');

$a = ['foo'];

var_dump($a->length());
nikic commented 11 years ago

I can't reproduce this segfault neither on 5.4 nor 5.5 (tried cli and built-in server). I'm not getting any valgrind warnings either.

Do you have a backtrace for this segfault? Easiest way to get one is valgrind php args.... Or alternatively gdb php followed by r args....

CHH commented 11 years ago

I forgot, I'm using OSX 10.8.

Interestigly, now by running with valgrind I exceed the memory limit when running:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 581067329 bytes)
nikic commented 9 years ago

Closing as whatever the issue was, it likely doesn't apply anymore to the current implementation.