Bug 244049

Summary: lang/php73: php 7.3.14 crashes under ASLR enabled, on FreeBSD 12.1
Product: Ports & Packages Reporter: Özgür Kazancci <ozgur>
Component: Individual Port(s)Assignee: Torsten Zuehlsdorff <tz>
Status: New ---    
Severity: Affects Some People CC: bugs, ozgur
Priority: --- Keywords: crash
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
truss trace dump of the command none

Description Özgür Kazancci 2020-02-11 15:38:59 UTC
Created attachment 211564 [details]
truss trace dump of the command

When I execute:
/usr/local/bin/php -q /var/www/mysite/whmcs/crons/cron.php,
PHP crashes giving: Segmentation Fault (Core Dumped)


However, under /etc/sysctl.conf when I remove/disable the following lines related to ASLR (they were activated/added by me):

kern.elf64.aslr.pie_enable=1
kern.elf64.aslr.honor_sbrk=0
kern.elf64.aslr.enable=1
kern.elf32.aslr.pie_enable=1
kern.elf32.aslr.honor_sbrk=0
kern.elf32.aslr.enable=1

PHP executes the cron.php script fine without crashing.

OS: FreeBSD 12.1, latest stable branch.
PHP version: 7.3.14

Thank you,
Regards.
Comment 1 Özgür Kazancci 2020-02-11 15:45:39 UTC
Comment on attachment 211564 [details]
truss trace dump of the command

I can see that a SEGV_MAPERR is occurring, This usually indicates that PHP is trying to access an invalid memory page for some reason and fails. It is unclear as to whether the issue is with ASLR or PHP itself (and ASLR just happens to reveal it)
Comment 2 Torsten Zuehlsdorff freebsd_committer 2020-02-13 18:02:16 UTC
Hi Özgür,

thank you for the issue. I am unsure if i can do something about it. Did you also opened a bugreport at https://bugs.php.net/? I think this should also be there!

Greetings,
Torsten