Bug #73870 [Csd]: php.exe crash in service context

From: Date: Sun, 08 Jan 2017 20:22:31 +0000
Subject: Bug #73870 [Csd]: php.exe crash in service context
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206406@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73870&edit=1 ID: 73870 Updated by: ab@php.net Reported by: jean-baptiste at nahan dot fr Summary: php.exe crash in service context Status: Closed Type: Bug Package: Reproducible crash Operating System: Windows 7 PHP Version: 7.1.0 Assigned To: ab Block user comment: N Private report: N New Comment: @jean-baptiste by the way - would it be something meaningful for you to propose a patch for the PECL package, or join it even? As issues like bug #73733 will for sure hit back. If so, please write to Richard and CC the PECL dev lists. Thanks. Previous Comments: ------------------------------------------------------------------------ [2017-01-06 16:07:11] ab@php.net I don't think it'll be possible to catch this in the extension. I'd also wonder a bit, as it should have been explicitly excluded from php-win.exe. Maybe it was done not a correct way, as i actually had not much to test it. Closing this one now, as the issue looks resolved. Thanks. ------------------------------------------------------------------------ [2017-01-05 15:17:33] jean-baptiste at nahan dot fr The test from PHP 7.1.1-dev on branch PHP-7.1 work fine. How to add error alert if the extension is loaded on PHP 7.1.0 ? Thanks. ------------------------------------------------------------------------ [2017-01-05 14:41:31] ab@php.net Thanks for the patch. Could you please check the current 7.1 dev tree? Several improvements went in since 7.1.0, so i guess the patch won't apply in the form there and this issue might be even fixed already. You can just fetch the latest snapshot from windows.php.net, no need to compile yourself. Or use 7.1.1RC1 which is coming out soon. Thanks. ------------------------------------------------------------------------ [2017-01-05 10:49:12] jean-baptiste at nahan dot fr Description: ------------ Requirements : win32service extension. Available here https://github.com/InExtenso/win32service/tree/php-7.0 This script work fine with php-7.0.x but not with PHP-7.1. On windows system the context of service execution is not a console. php.exe crash in the service context when he get the Codepage. With the patch, the service can started with use php.exe or php-win.exe. An issue is open on the win32service extension. The link is: https://github.com/InExtenso/win32service/issues/6 This issue contains build information and other results tests. Test script: --------------- <?php /** * File : sample.php * This file is part of win32service extension package. * This file install or uninstall the "dummyphp" service. * * Requirements : PHP 7+ * * Usage : * * php sample.php install * net start dummyphp * net stop dummyphp * php sample.php uninstall */ if (!extension_loaded('win32service')) { throw new \Exception('The php_win32service.dll extension is not loaded ! Please configure it into your php configuration file.'); } if ($argv[1] == 'install') { $x = win32_create_service(array( 'service' => 'dummyphp', 'display' => 'sample dummy PHP service', 'params' => __FILE__ . ' run', )); debug_zval_dump($x); exit; } else if ($argv[1] == 'uninstall') { $x = win32_delete_service('dummyphp'); debug_zval_dump($x); exit; } else if ($argv[1] != 'run') { die("bogus args"); } $x = win32_start_service_ctrl_dispatcher('dummyphp'); win32_set_service_status(WIN32_SERVICE_RUNNING); while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) { usleep(250000); } Expected result: ---------------- Service do start. Actual result: -------------- php.exe crash: Message: Une exception non gérée a été levée : violation d'accès en lecture. __imp__php_win32_cp_get_orig(...) retournée nullptr. Stack: > php.exe!main(int argc, char * * argv) Ligne 1358 C [Code externe] ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73870&edit=1

« previous php.bugs (#206406) next »