|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-11-11 13:21 UTC] cmb@php.net
-Package: pthreads
+Package: SNMP related
[2021-01-13 18:24 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Package: SNMP related
+Package: opcache
-Assigned To:
+Assigned To: cmb
[2021-01-13 18:24 UTC] cmb@php.net
[2021-01-24 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
Description: ------------ segmentation the error is in that function $sessionout = new SNMP(SNMP::VERSION_2C, $ip_addr_comm, "public"); $aout = @$sessionout->walk(array("ifOutOctets")); Similarly, this function snmpwalk($ip_addr_comm, "public", "ifOutOctets"); Test script: --------------- <?php class My extends Thread{ public function __construct($comm_ip){ $this->comm_ip=$comm_ip; } function run(){ $ip_addr_comm=$this->comm_ip; $sessionout = new SNMP(SNMP::VERSION_2C, $ip_addr_comm, "public"); $aout = @$sessionout->walk(array("ifOutOctets")); if ($sessionout->getErrno() == SNMP::ERRNO_TIMEOUT) { echo "234";}; $sessionout->close(); }} $row = array('ipaddres1' => '172.16.12.6','ipaddres2' => '172.16.12.5','ipaddres3' => '172.16.12.4','ipaddres4' => '172.16.12.7','ipaddres5' => '172.16.12.3','ipaddres6' => '172.16.11.3','ipaddres6' => '172.16.11.3'); foreach ($row as $d) { $comm_ip = $d; $pool[] = new My($comm_ip); } foreach($pool as $worker){ $worker->start(); } foreach($pool as $worker){ $worker->join(); } Expected result: ---------------- Segmentation fault Actual result: -------------- 7f7f417a0000-7f7f419a0000[7163]: ---p 00010000 08:03 1679689 /usr/lib64/php7.0/lib/extensions/no-debug-zts-20151012/ssh2.so 7f7f419a0000-7f7f419a1000 r--p 00010000 08:03 1679689 /usr/lib64/php7.0/lib/extensions/no-debug-zts-20151012/ssh2.so 7f7f419a1000-7f7f419a2000 rw-p 00011000 08:03 1679689 /usr/lib64/php7.0/lib/extensions/no-debug-zts-20151012/ssh2.so 7f7f419a2000-7f7f419a8000 r-xp 00000000 08:03 3039937 /lib64/librt-2.23.so 7f7f419a8000-7f7f41ba8000 ---p 00006000 08:03 3039937 /lib64/librt-2.23.so 7f7f41ba8000-7f7f41ba9000 r--p 00006000 08:03 3039937 /lib64/librt-2.23.so 7f7f41ba9000-7f7f41baa000 rw-p 00007000 08:03 3039937 /lib64/librt-2.23.so 7f7f41baa000-7f7f41bb2000 r-xp 00000000 08:03 1679690 /usr/lib64/php7.0/lib/extensions/no-debug-zts-20151012/sync.so 7f7f41bb2000-7f7f41db2000 ---p 00008000 08:03 167969 Jan 17 03:42:27 localhost php[7163]: Jan 17 03:42:27 localhost php[7163]: Jan 17 03:42:27 localhost php[7163]: Jan 17 03:42:27 localhost php(execute_ex+0x1b)[7163]: Jan 17 03:42:27 localhost /usr/lib64/php7.0/lib/extensions/no-debug-zts-20151012/pthreads.so(+0x8da5)[7163]: Jan 17 03:42:27 localhost php(zend_call_function+0x99b)[7163]: Jan 17 03:42:27 localhost /usr/lib64/php7.0/lib/extensions/no-debug-zts-20151012/pthreads.so(+0x13205)[7163]: Jan 17 03:42:27 localhost /usr/lib64/php7.0/lib/extensions/no-debug-zts-20151012/pthreads.so(+0x13307)[7163]: Jan 17 03:42:27 localhost /usr/lib64/php7.0/lib64/opcache.so 7f7f41ffd000-7f7f421fd000[7163]: ---p 00031000 08:03 3261137 /usr/lib64/php7.0/lib64/opcache.so 7f7f421fd000-7f7f421fe000 r--p 00031000 08:03 3261137 /usr/lib64/php7.0/lib64/opcache.so 7f7f421fe000-7f7f421ff000 rw-p 00032000 08:03 3261137 /usr/lib64/php7.0/lib64/opcache.so 7f7f421ff000-7f7f42400000 rw-p 00000000 00:00 0