From: sixd
Operating system: Linux
PHP version: 5.4Git-2013-08-18 (Git)
Package: Reproducible crash
Bug Type: Bug
Bug description:Segmentation fault in zend_error() with --enable-dtrace
Description:
------------
A segmentation fault can occur in zend_error() with --enable-dtrace.
The zend_vspprintf() call in the DTRACE_ERROR_ENABLED() block leaves
args undefined:
"If ap is passed to a function that uses va_arg(ap,type) then the
value of ap is undefined after the return of that function."
When args is used again later in zend_error(), a seg fault can occur.
Test script:
---------------
As root:
-------------------
# dtrace -Z -s error.d
dtrace: script 'error.d' matched 0 probes
CPU ID FUNCTION:NAME
0 6 zend_error:error PHP error
--------------------
As a normal user:
--------------------
$ php error.php
Segmentation fault (core dumped)
--------------------
Where error.d is:
php*:::error { printf("PHP error\n"); }
and error.php is:
<?php trigger_error('This is an error', E_USER_ERROR); ?>
--
Edit bug report at https://bugs.php.net/bug.php?id=65470&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=65470&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=65470&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=65470&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65470&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65470&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65470&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65470&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65470&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65470&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65470&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65470&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65470&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65470&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65470&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65470&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65470&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65470&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65470&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65470&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65470&r=mysqlcfg