Bug #68001 [Fbk->Nab]: php crashes with enabled php_snmp.dll

From: Date: Sat, 04 Oct 2014 12:27:08 +0000
Subject: Bug #68001 [Fbk->Nab]: php crashes with enabled php_snmp.dll
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187845@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68001&edit=1 ID: 68001 Updated by: lytboris@php.net Reported by: xbolshe at mail dot ru Summary: php crashes with enabled php_snmp.dll -Status: Feedback +Status: Not a bug Type: Bug Package: SNMP related Operating System: Windows 2008 R2 PHP Version: 5.6.0 Block user comment: N Private report: N New Comment: This is a really bad idea to wrap some external library calls with crash-preventing/recovering techniques. Previous Comments: ------------------------------------------------------------------------ [2014-09-12 23:20:04] xbolshe at mail dot ru Partially agree with you. 1. Crashing of PHP may be fixed. A SEH handler installation for "init_snmp("snmpapp");" with writing a PHP log about trouble with Net-SNMP and possible ways to fix like re-installation of Net-SNMP, removing MIB indexes will make PHP more user friendly. 2. The main reason of my trouble was that one MIB index file was filled with zeros (!). And there was no check for zeros in Net-SNMP! I have fixed Net-SNMP, and now there is no problem with PHP crashing. I will try to report about. ------------------------------------------------------------------------ [2014-09-12 22:11:38] johannes@php.net This is an issue in net-snmp outside our control. Please report at http://sourceforge.net/p/net-snmp/ ------------------------------------------------------------------------ [2014-09-12 21:14:40] xbolshe at mail dot ru I have repeated the problem with my build of PHP. The PHP crash is performed here: File: php-src\ext\snmp\snmp.c PHP_MINIT_FUNCTION(snmp) { netsnmp_log_handler *logh; zend_class_entry ce, cex; le_snmp_session = zend_register_list_destructors_ex(php_snmp_session_destructor, NULL, PHP_SNMP_SESSION_RES_NAME, module_number); init_snmp("snmpapp"); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< HERE ------------------------------------------------------------------------ [2014-09-12 19:20:33] xbolshe at mail dot ru I have found a point of crash: when php.exe(php_snmp.dll) searches for c:\usr\snmp\persist\mib_indexes\ and finds two files with names "0" and "1", it crashes. After deleting of these files "0" and "1" the problem is disappeared. ------------------------------------------------------------------------ [2014-09-11 05:23:35] xbolshe at mail dot ru See a picture: http://i57.tinypic.com/2mmef5j.png As shown on the picture int 3 CPU command is executed as a reason of stack buffer overrun and cause an exception shown previously. It seems that stack buffer size is not enough. A possible reason of this problem may be usage of char strings with fixed size which are overrun. I guess need to to check buffers in /php-src/ext/snmp/snmp.c ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=68001 -- Edit this bug report at https://bugs.php.net/bug.php?id=68001&edit=1

« previous php.bugs (#187845) next »