|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-11-24 14:01 UTC] elie+php at bouttier dot eu
Description: ------------ I have a segfault in php_ssh2_channel_stream_read. php-ssh version: 756e2f1369f2d5ff006222d978806f4fd91659e1 (Thu Nov 10 09:33:25 2016 +0100) I encounter this error with Pydio version 7.0.1 using the SFTP adaptator. PHP (v7.0.13) is launched by suPHP Apache module. The php_ssh2_channel_stream_read function call zend_fetch_resource(Z_RES_P(zresource), ...). Z_RES_P(zresource) mean Z_RES(*zresource) but accordingly to gdb, zresource is NULL, leading to NULL pointer dereference : (gdb) print zresource $14 = (zval *) 0x0 The zresource is initialized by: zresource = php_ssh2_zval_from_resource_handle(abstract->session_rsrc); (gdb) print abstract->session_rsrc $15 = -1473489792 This does not look like a valid resource handle. Some may be useful values: (gdb) print abstract->streamid $17 = 0 Full backtrace: (gdb) bt #0 0x00007f75abb28758 in php_ssh2_channel_stream_read (stream=0x7f75a95e9700, buf=0x7f75a82a4000 "`\222*\250u\177", count=8192) at /home/elie/pkgbuild/php-ssh-unstable/src/php-ssh-unstable/ssh2_fopen_wrappers.c:98 #1 0x00000000006445ed in _php_stream_fill_read_buffer () #2 0x0000000000644717 in _php_stream_read () #3 0x0000000000645ab9 in _php_stream_copy_to_mem () #4 0x00000000005f7a41 in ?? () #5 0x0000000000712d3f in ?? () #6 0x00000000006cf7db in execute_ex () #7 0x000000000067f3ad in zend_call_function () #8 0x000000000059bd75 in ?? () #9 0x0000000000712d3f in ?? () #10 0x00000000006cf7db in execute_ex () #11 0x000000000067f3ad in zend_call_function () #12 0x000000000067f6f9 in call_user_function_ex () #13 0x000000000064e5ac in ?? () #14 0x000000000064688e in _php_stream_stat_path () #15 0x00000000005aca45 in ?? () #16 0x00000000005af49b in ?? () #17 0x0000000000521236 in ?? () #18 0x0000000000712d3f in ?? () #19 0x00000000006cf7db in execute_ex () #20 0x000000000067f3ad in zend_call_function () #21 0x000000000067f6f9 in call_user_function_ex () #22 0x000000000064e5ac in ?? () #23 0x000000000064688e in _php_stream_stat_path () #24 0x00000000005aca45 in ?? () #25 0x00000000005af49b in ?? () #26 0x0000000000521236 in ?? () #27 0x0000000000712d3f in ?? () #28 0x00000000006cf7db in execute_ex () #29 0x000000000067f3ad in zend_call_function () #30 0x000000000067f6f9 in call_user_function_ex () #31 0x000000000064e5ac in ?? () #32 0x000000000064688e in _php_stream_stat_path () #33 0x00000000005aca45 in ?? () #34 0x00000000005af49b in ?? () #35 0x0000000000521236 in ?? () #36 0x0000000000712d3f in ?? () #37 0x00000000006cf7db in execute_ex () #38 0x000000000067f3ad in zend_call_function () #39 0x000000000059bf4f in ?? () #40 0x0000000000712d3f in ?? () #41 0x00000000006cf7db in execute_ex () #42 0x000000000067f3ad in zend_call_function () #43 0x000000000059bf4f in ?? () #44 0x0000000000712d3f in ?? () #45 0x00000000006cf7db in execute_ex () #46 0x000000000067f3ad in zend_call_function () #47 0x000000000059bf4f in ?? () #48 0x0000000000712d3f in ?? () #49 0x00000000006cf7db in execute_ex () #50 0x000000000067f3ad in zend_call_function () #51 0x000000000059bf4f in ?? () #52 0x0000000000712d3f in ?? () #53 0x00000000006cf7db in execute_ex () #54 0x000000000067f3ad in zend_call_function () #55 0x000000000059bf4f in ?? () #56 0x0000000000712d3f in ?? () #57 0x00000000006cf7db in execute_ex () #58 0x000000000067f3ad in zend_call_function () #59 0x000000000059bf4f in ?? () #60 0x0000000000712d3f in ?? () #61 0x00000000006cf7db in execute_ex () #62 0x000000000067f3ad in zend_call_function () #63 0x000000000059bf4f in ?? () #64 0x0000000000712d3f in ?? () #65 0x00000000006cf7db in execute_ex () #66 0x000000000067f3ad in zend_call_function () #67 0x000000000059bf4f in ?? () #68 0x0000000000712d3f in ?? () #69 0x00000000006cf7db in execute_ex () #70 0x000000000067f3ad in zend_call_function () #71 0x000000000059bf4f in ?? () #72 0x0000000000712d3f in ?? () #73 0x00000000006cf7db in execute_ex () #74 0x000000000067f3ad in zend_call_function () #75 0x000000000059bf4f in ?? () #76 0x0000000000712d3f in ?? () #77 0x00000000006cf7db in execute_ex () #78 0x000000000067f3ad in zend_call_function () #79 0x000000000059bf4f in ?? () #80 0x0000000000712d3f in ?? () #81 0x00000000006cf7db in execute_ex () #82 0x000000000067f3ad in zend_call_function () #83 0x000000000059bd75 in ?? () #84 0x0000000000712d3f in ?? () #85 0x00000000006cf7db in execute_ex () #86 0x00000000007228b7 in zend_execute () #87 0x000000000068d863 in zend_execute_scripts () #88 0x000000000062d490 in php_execute_script () #89 0x000000000043453d in ?? () #90 0x00007f75b66de291 in __libc_start_main () from /usr/lib/libc.so.6 #91 0x0000000000434daa in _start () Test script: --------------- Sorry, I am not a PHP developper, even less a specialist of Pydio code :-/ PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 08:00:01 2025 UTC |
I can reproduce it on PHP 7.1.1 with the newset SSH2 master (756e2f1) on Arch Linux 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 07:24:34 CET 2016 x86_64 GNU/Linux. It's completely same segfault at the same place (but my gdb and C skills are not that greateto give you stack trace - plus I've already downgraded the PHP version). Downgrading to PHP 7.0.12 fixes the problem. Simple test case: ----------------- <?php $ssh = ssh2_connect('host', 22); ssh2_auth_agent($ssh, 'user'); $stream = ssh2_exec($ssh, 'ls -l /'); $out = stream_get_contents($stream);