Bug #68623 [NEW]: php - switch return - php-fpm SIGSEGV
| From: | claude dot ws01 at gmail dot com | Date: | Thu, 18 Dec 2014 17:06:36 +0000 |
| Subject: | Bug #68623 [NEW]: php - switch return - php-fpm SIGSEGV | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-189111@lists.php.net to get a copy of this message | ||
From: claude dot ws01 at gmail dot com
Operating system: CentOS 6.6
PHP version: Irrelevant
Package: FPM related
Bug Type: Bug
Bug description:php - switch return - php-fpm SIGSEGV
Description:
------------
php v5.5.19 centos 6.6 nginx v1.6.2 (tracking sys would not accept
5.5.19 as php version)
Getting a SIGSEGV in php-fpm on the return statement within a
switch-case block.
I did not analyse the core dump. But pin-pointed the location in the php
code.
A while ago, after updating php, recompiling nginx, I got the same
issue, same class, other function, same switch-return concept, that I
solved by changing it with an if-then-else.
Last week I did another php update, and then another function caused
same SIGSEGV, same class, same switch-return concept, and solved it by
putting the return after the switch.
I'm using same php v5.5.19 in a windows stack and linux server, and this
issue is only on the linux server.
I do not know what more information I can provide.
My objective is only to report it, as I have solved it, but worth
reporting
Kind regards
Claude.
Test script:
---------------
static function get-a-SIGSEGV-without-any-result-returned()
{
switch (PHP_OS) {
case 'WINNT':
$result =
utf8_encode(strftime($Language->getDateFormatLong(), mktime($hour,
$minute, $second, $month, $day, $year)));
return $result;
default:
$result = strftime($Language->getDateFormatLong(),
mktime($hour, $minute, $second, $month, $day, $year));
return $result;
}
}
static function get-the-result-returned-without-SIGSEGV()
{
switch (PHP_OS) {
case 'WINNT':
$result =
utf8_encode(strftime($Language->getDateFormatLong(), mktime($hour,
$minute, $second, $month, $day, $year)));
break;
default:
$result = strftime($Language->getDateFormatLong(),
mktime($hour, $minute, $second, $month, $day, $year));
}
return $result;
}
--
Edit bug report at https://bugs.php.net/bug.php?id=68623&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68623&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68623&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68623&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68623&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68623&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68623&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68623&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68623&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68623&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68623&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68623&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68623&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68623&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68623&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68623&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68623&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68623&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68623&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68623&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68623&r=mysqlcfg