php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55705 Omitting a callable typehinted argument causes a segfault
Submitted: 2011-09-16 07:17 UTC Modified: 2011-09-17 00:16 UTC
From: mikko dot petteri dot hirvonen at gmail dot com Assigned: dmitry
Status: Closed Package: Reproducible crash
PHP Version: 5.4.0beta1 OS: Mac OS X 10.7 Lion
Private report: No CVE-ID:
 [2011-09-16 07:17 UTC] mikko dot petteri dot hirvonen at gmail dot com
Description:
------------
Omitting a callable typehinted argument from a function call causes a segmentation fault.

Configured with:
export MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64"
configure --prefix=/usr/local/php-5.4.0beta1


Test script:
---------------
<?php

function f(callable $c) {}
f();


Expected result:
----------------
Catchable fatal error: Argument 1 passed to f() must be of the type callable, none given, called in %s on line 4 and defined in %s on line 3

Actual result:
--------------
Segmentation fault: 11

Patches

bug55705.phpt (last revision 2011-09-16 08:59 UTC) by laruence@php.net)
bug55705.diff (last revision 2011-09-16 08:42 UTC) by laruence@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-16 08:42 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55705.diff
Revision:   1316162548
URL:        https://bugs.php.net/patch-display.php?bug=55705&patch=bug55705.diff&revision=1316162548
 [2011-09-16 08:45 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55705.phpt
Revision:   1316162743
URL:        https://bugs.php.net/patch-display.php?bug=55705&patch=bug55705.phpt&revision=1316162743
 [2011-09-16 08:46 UTC] laruence@php.net
-Assigned To: +Assigned To: dmitry
 [2011-09-16 08:46 UTC] laruence@php.net
dmitry, plz look at this, thanks
 [2011-09-16 08:59 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55705.phpt
Revision:   1316163593
URL:        https://bugs.php.net/patch-display.php?bug=55705&patch=bug55705.phpt&revision=1316163593
 [2011-09-16 20:29 UTC] nikic@php.net
@laruence: Could you maybe change the added error message to use "be callable" instead of "be of the type callback" just like the other callable error message? That way it would be more consistent :)
 [2011-09-17 00:15 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=316887
Log: - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)
  patch by: laruence@php
 [2011-09-17 00:16 UTC] felipe@php.net
-Status: Assigned +Status: Closed
 [2011-09-17 00:16 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-18 09:48 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0ebd2309b1684b38be613d7b8e377cb6e461ea11
Log: - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)   patch by: laruence@php
 [2012-07-24 23:39 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0ebd2309b1684b38be613d7b8e377cb6e461ea11
Log: - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)   patch by: laruence@php
 [2013-11-17 09:36 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0ebd2309b1684b38be613d7b8e377cb6e461ea11
Log: - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)   patch by: laruence@php
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 01:02:05 2014 UTC