php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71413 Crash with constants on internal interfaces
Submitted: 2016-01-19 19:04 UTC Modified: 2016-01-21 08:16 UTC
From: mike@php.net Assigned: bwoebi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: master-Git-2016-01-19 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mike@php.net
New email:
PHP Version: OS:

 

 [2016-01-19 19:04 UTC] mike@php.net
Description:
------------
a75c195000 (class constant visibility patch) seems to cause problems, when extensions register constants on interfaces; no problems with PHP-7.0

It's a bit tricky to reproduce, but building e.g. https://github.com/m6w6/ext-pq into PHP-master may trigger the crash; see https://gist.github.com/m6w6/58dd72c02344487d6346#file-valgrind-log and https://travis-ci.org/m6w6/ext-pq/builds/103342033


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-20 16:47 UTC] bwoebi@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: bwoebi
 [2016-01-20 16:47 UTC] bwoebi@php.net
The issue is probably zend_destroy_call_constant_internal immediately freeing.

Can you please verify whether removing the free() in the function body will fix it (in http://lxr.php.net/xref/PHP_MASTER/Zend/zend_compile.c#100)? [And probably cause a mem leak instead]

If that's the issue, I'll prepare a proper patch.
 [2016-01-21 05:34 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=62c1c11ad34103729988df9edea343337a900ba9
Log: Fixed bug #71413 (Crash with constants on internal interfaces)
 [2016-01-21 05:34 UTC] laruence@php.net
-Status: Feedback +Status: Closed
 [2016-01-21 08:16 UTC] mike@php.net
I can confirm, that the workaround got rid of the crash, and that the actual fix works, too.

Thanks a lot!
 [2016-04-18 09:30 UTC] bwoebi@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=62c1c11ad34103729988df9edea343337a900ba9
Log: Fixed bug #71413 (Crash with constants on internal interfaces)
 [2016-07-20 11:34 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=62c1c11ad34103729988df9edea343337a900ba9
Log: Fixed bug #71413 (Crash with constants on internal interfaces)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 22:01:29 2024 UTC