php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66538 Segfault when accepting client on SSL server
Submitted: 2014-01-21 21:12 UTC Modified: 2014-01-21 23:42 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: grzegorz129 at gmail dot com Assigned:
Status: Open Package: Reproducible crash
PHP Version: 5.5.8 OS: OSX 10.9
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-01-21 21:12 UTC] grzegorz129 at gmail dot com
Description:
------------
After making valid SSL connection (using openssl s_client) to server with SSL context PHP segfaults.
I've tested this with latest CLI version bundled with OSX - 5.4.17.

I think issue source can similar to this one: https://mail.python.org/pipermail/python-dev/2013-October/129832.html

Test script:
---------------
<?php
 $serverSSLContext = stream_context_create();
 stream_context_set_option($serverSSLContext, 'ssl', 'local_cert', "./test.pem"); 
 $serverSocket = stream_socket_server("ssl://127.0.0.1:8000", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $serverSSLContext);
 while(stream_socket_accept($serverSocket));

Actual result:
--------------
Since gdb isn't supported on Mavericks I've used lldb:
$ lldb php testssl.php
Current executable set to 'php' (x86_64).
(lldb) run
Process 40595 launched: '/usr/bin/php' (x86_64)
Process 40595 stopped
* thread #1: tid = 0x3f395f, 0x00007fff8f0d18f7 libssl.0.9.8.dylib`ssl_set_cert_masks + 39, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x20)
    frame #0: 0x00007fff8f0d18f7 libssl.0.9.8.dylib`ssl_set_cert_masks + 39
libssl.0.9.8.dylib`ssl_set_cert_masks + 39:
-> 0x7fff8f0d18f7:  movb   32(%rsi), %cl
   0x7fff8f0d18fa:  andb   $8, %cl
   0x7fff8f0d18fd:  shrb   $3, %cl
   0x7fff8f0d1900:  movl   $512, %edx
(lldb)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-21 23:42 UTC] grzegorz129 at gmail dot com
-PHP Version: Irrelevant +PHP Version: 5.5.8
 [2014-01-21 23:42 UTC] grzegorz129 at gmail dot com
After installing 5.5.8 problem still exists.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 15:01:28 2019 UTC