php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78001 Error 'received signal SIGPIPE, Broken pipe.' when using streams
Submitted: 2019-05-10 20:30 UTC Modified: 2021-08-01 04:22 UTC
Votes:3
Avg. Score:3.7 ± 1.9
Reproduced:2 of 3 (66.7%)
Same Version:0 (0.0%)
Same OS:2 (100.0%)
From: miknazarenko at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: Streams related
PHP Version: 7.2.18 OS: UBUNTU 18.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-05-10 20:30 UTC] miknazarenko at gmail dot com
Description:
------------
PHP 7.2.2 (cli) (built: Apr 29 2019 09:57:40) ( ZTS DEBUG )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Ubuntu 18.04 64bit.

I have a big script which communicates with imap via streams (resource). Script works with pthreads.

It is difficult to provide exact code, because it is not PHP error. But I think error happens when calling some PHP stream related function. 

seems error happens in libcrypto, but the reason might be in PHP core, probably there is wrong some libcrypto calling. 

Some PHP functions which I use:

                $context = stream_context_create([
                    'ssl' => [
                        'verify_peer' => false,
                        'verify_peer_name' => false
                    ]
                ]);

@stream_socket_client("ssl://127.0.0.1:" . $this->port, $errno, $errStr, 5, STREAM_CLIENT_CONNECT, $context);

and also fclose() - I think may make error.


Test script:
---------------
This is the error I get:

Thread 8 "php" received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7fffe1ffb700 (LWP 15249)]
0x00007ffff5ea82b7 in __libc_write (fd=1031, buf=0x7fffccd0ef63, nbytes=31) at ../sysdeps/unix/sysv/linux/write.c:27
27      ../sysdeps/unix/sysv/linux/write.c: No such file or directory.
(gdb) bt
#0  0x00007ffff5ea82b7 in __libc_write (fd=1031, buf=0x7fffccd0ef63, nbytes=31) at ../sysdeps/unix/sysv/linux/write.c:27
#1  0x00007ffff542dcd5 in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#2  0x00007ffff542907a in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#3  0x00007ffff54280d5 in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#4  0x00007ffff5428573 in BIO_write () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#5  0x00007ffff586ac67 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#6  0x00007ffff586bb85 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#7  0x00007ffff58757bc in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#8  0x00007ffff5873835 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#9  0x00007ffff587e96f in SSL_shutdown () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#10 0x000055555578bb2f in php_openssl_sockop_close (stream=0x7fffc5716000, close_handle=1) at /home/mike/Documents/PHP/php-src-php-7.2.2/ext/openssl/xp_ssl.c:2181
#11 0x0000555555e642de in _php_stream_free (stream=0x7fffc5716000, close_options=67) at /home/mike/Documents/PHP/php-src-php-7.2.2/main/streams/streams.c:467
#12 0x0000555555cabbc5 in zif_fclose (execute_data=0x7fffe1424240, return_value=0x7fffe1ffa2a0) at /home/mike/Documents/PHP/php-src-php-7.2.2/ext/standard/file.c:917
#13 0x0000555555f78fdf in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:907
#14 0x0000555556005f10 in execute_ex (ex=0x7fffe1424180) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59749
#15 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1424180) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#16 0x0000555555f78edb in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:888
#17 0x0000555556005f10 in execute_ex (ex=0x7fffe1423b90) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59749
#18 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1423b90) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#19 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
#20 0x0000555556005f1d in execute_ex (ex=0x7fffe1423620) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#21 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1423620) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#22 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
#23 0x0000555556005f1d in execute_ex (ex=0x7fffe1423360) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#24 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1423360) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#25 0x0000555555f78edb in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:888
#26 0x0000555556005f10 in execute_ex (ex=0x7fffe1422ff0) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59749
#27 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1422ff0) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#28 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
#29 0x0000555556005f1d in execute_ex (ex=0x7fffe1422950) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#30 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1422950) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#31 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
---Type <return> to continue, or q <return> to quit---
#32 0x0000555556005f1d in execute_ex (ex=0x7fffe1421e10) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#33 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1421e10) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#34 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
#35 0x0000555556005f1d in execute_ex (ex=0x7fffe1421d10) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#36 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1421d10) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#37 0x0000555555f78edb in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:888
#38 0x0000555556005f10 in execute_ex (ex=0x7fffe1421c20) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59749
#39 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1421c20) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#40 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
#41 0x0000555556005f1d in execute_ex (ex=0x7fffe14218c0) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#42 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe14218c0) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#43 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
#44 0x0000555556005f1d in execute_ex (ex=0x7fffe1421280) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#45 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1421280) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#46 0x0000555555f7967c in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:1013
#47 0x0000555556005f1d in execute_ex (ex=0x7fffe1421030) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_vm_execute.h:59752
#48 0x00007fffeae59583 in pthreads_execute_ex (data=0x7fffe1421030) at /home/mike/Documents/PHP/pthreads/php_pthreads.c:135
#49 0x0000555555eec3a6 in zend_call_function (fci=0x7fffe1ffab80, fci_cache=0x7fffe1ffabb8) at /home/mike/Documents/PHP/php-src-php-7.2.2/Zend/zend_execute_API.c:819
#50 0x00007fffeae6e019 in pthreads_routine_run_function (object=0x7fffeadc5e00, connection=0x7fffe146c900, work=0x7fffe1ffad00) at /home/mike/Documents/PHP/pthreads/src/object.c:481
#51 0x00007fffeae6e3a0 in pthreads_routine (routine=0x7fffffffad70) at /home/mike/Documents/PHP/pthreads/src/object.c:516
#52 0x00007ffff5e9e6db in start_thread (arg=0x7fffe1ffb700) at pthread_create.c:463
#53 0x00007ffff3cc088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-19 11:30 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-07-19 11:30 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-08-01 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC