php-ext-mmap icon indicating copy to clipboard operation
php-ext-mmap copied to clipboard

Segmentation fault on raspian stretch and php7

Open michelpa opened this issue 7 years ago • 7 comments

Hello,

I've got a segmentation fault on pi3 with raspbian stretch and php7.0 when extension is enabled. It works with python script.

No idea what is the problem

michelpa avatar Aug 23 '17 21:08 michelpa

Hi @michelpa - can you give some more details? Is it consistently reproducible?

calcinai avatar Aug 23 '17 21:08 calcinai

I tried to debug where it happens and it is here:

$level = ($this->gpio_register[Register\GPIO::$GPLEV[$bank]] & $mask) >> $shift;

michelpa avatar Aug 23 '17 21:08 michelpa

I have no knowledge in c but i've got two warning during make:

/tmp/php-ext-mmap/mmap.c:39:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     mmap_stream_write,
     ^~~~~~~~~~~~~~~~~
/tmp/php-ext-mmap/mmap.c:39:5: note: (near initialization for ‘mmap_ops.write’)
/tmp/php-ext-mmap/mmap.c:44:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     mmap_stream_seek,
     ^~~~~~~~~~~~~~~~
/tmp/php-ext-mmap/mmap.c:44:5: note: (near initialization for ‘mmap_ops.seek’)

I don't know if it can help...

michelpa avatar Aug 23 '17 21:08 michelpa

I'll look into this - in the mean time, uninstall the extension and use the python fallback if you can handle it being a little slower.

calcinai avatar Aug 23 '17 21:08 calcinai

Yep, no problem for my application with python script.

Thank your for your work!

michelpa avatar Aug 23 '17 21:08 michelpa

His issue is resolved when #5 is merged.

merlinthemagic avatar Nov 19 '17 21:11 merlinthemagic

#5 merged!

calcinai avatar Nov 19 '17 21:11 calcinai