php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73937 x86_64, kernel-4.9.1-gentoo
Submitted: 2017-01-14 20:16 UTC Modified: 2021-01-13 18:24 UTC
Votes:9
Avg. Score:4.8 ± 0.6
Reproduced:8 of 8 (100.0%)
Same Version:3 (37.5%)
Same OS:2 (25.0%)
From: vadim dot gunter200 at outlook dot com Assigned: cmb (profile)
Status: Feedback Package: opcache
PHP Version: 7.0.14 OS: Gentoo
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-01-14 20:16 UTC] vadim dot gunter200 at outlook dot com
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [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
Do you still get the segfault with any of the actively supported
PHP versions[1]?  If so, please provide a backtrace with debug
symbols[2]?  Also, this looks more like an OPcache issue.

[1] <https://www.php.net/supported-versions.php>
[2] <https://bugs.php.net/bugs-generating-backtrace.php>
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jan 16 03:01:24 2021 UTC