Bug 1508986

Summary: Segfault with ssl with 6.11.3
Product: Red Hat Software Collections Reporter: Shannon Poole <spoole>
Component: nodejsAssignee: Zuzana Svetlikova <zsvetlik>
Status: CLOSED ERRATA QA Contact: Mirek Długosz <mzalewsk>
Severity: high Docs Contact:
Priority: unspecified    
Version: rh-nodejs6CC: jorton, kwalker, mzalewsk, pandrade, spoole, zsvetlik
Target Milestone: alphaKeywords: Regression
Target Release: 3.1Flags: zsvetlik: needinfo+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Upstream commit introduced incompatibilities with system openssl Consequence: Using https module causes segfaults. Fix: Upstream commits were reverted. Result: Segfaults are no longer present in modules using ssl.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-22 10:51:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shannon Poole 2017-11-02 15:42:45 UTC
Description of problem:

Nodejs segfaults on subsequent https requests. 

This looks to be the same problem that was patched in the Fedora EPEL stream here: https://bugzilla.redhat.com/show_bug.cgi?id=1436445

That patch should probably be included in the RHEL stream as well.


Version-Release number of selected component (if applicable): rh-nodejs v6.11.3


How reproducible:

All the time


Steps to Reproduce:
1. Create a new file called https-test.js
2. Add the following three lines of code
```
var https = require('https');
https.get('https://google.com/');
https.get('https://google.com/');
```
3. run `node https-test.js`

Actual results:

Segfault

Expected results:

Clean exit

Additional info:

Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff7ff8700 (LWP 26033)]
[New Thread 0x7ffff4e51700 (LWP 26034)]
[New Thread 0x7ffff4450700 (LWP 26035)]
[New Thread 0x7ffff3a4f700 (LWP 26036)]
[New Thread 0x7ffff304e700 (LWP 26037)]
[New Thread 0x7ffff264d700 (LWP 26038)]
[New Thread 0x7ffff1c4c700 (LWP 26039)]
[New Thread 0x7ffff124b700 (LWP 26040)]
[New Thread 0x7fffebfff700 (LWP 26041)]

Thread 1 "node" received signal SIGSEGV, Segmentation fault.
*__GI___libc_free (mem=0x641) at malloc.c:3716
3716	  if (chunk_is_mmapped(p))                       /* release mmapped memory. */
#0  *__GI___libc_free (mem=0x641) at malloc.c:3716
#1  0x00007ffff7427d5d in CRYPTO_free (str=0x641) at mem.c:397
#2  0x00007ffff74a1d27 in sk_free (st=0x1bca1f0) at stack.c:290
#3  0x00007ffff74e0c14 in X509_STORE_free (vfy=0x1bca200) at x509_lu.c:248
#4  0x00007ffff719434a in SSL_CTX_free (a=0x1a8ace0) at ssl_lib.c:1973
#5  0x0000000000e935bc in node::crypto::SecureContext::FreeCTXMem (this=0x1aa1840) at ../src/node_crypto.h:154
#6  node::crypto::SecureContext::Close (args=...) at ../src/node_crypto.cc:1132
#7  0x00000000007b1aa1 in v8::internal::FunctionCallbackArguments::Call (this=0x7fffffffd920, f=f@entry=0xe93560 <node::crypto::SecureContext::Close(v8::FunctionCallbackInfo<v8::Value> const&)>) at ../deps/v8/src/api-arguments.cc:16
#8  0x0000000000800718 in v8::internal::(anonymous namespace)::HandleApiCallHelper (isolate=isolate@entry=0x1a4dcc0, args=...) at ../deps/v8/src/builtins.cc:4311
#9  0x0000000000800e5f in v8::internal::Builtin_Impl_HandleApiCall (args=..., isolate=isolate@entry=0x1a4dcc0) at ../deps/v8/src/builtins.cc:4329
#10 0x0000000000800fae in v8::internal::Builtin_HandleApiCall (args_length=<optimized out>, args_object=0x7fffffffdac8, isolate=0x1a4dcc0) at ../deps/v8/src/builtins.cc:4326
#11 0x00003b4db09092a7 in ?? ()
#12 0x00003b4db09091e1 in ?? ()
#13 0x00007fffffffda90 in ?? ()
#14 0x0000000300000000 in ?? ()
#15 0x00007fffffffdae8 in ?? ()
#16 0x00003b4db0adae52 in ?? ()
#17 0x00003e0072f04381 in ?? ()
#18 0x0000314540c8c189 in ?? ()
#19 0x0000086cc1481289 in ?? ()
#20 0x0000314540c8c189 in ?? ()
#21 0x0000086cc14c80a1 in ?? ()
#22 0x0000086cc14c7f51 in ?? ()
#23 0x00007fffffffdb18 in ?? ()
#24 0x00003b4db0937f83 in ?? ()
#25 0x0000086cc1482619 in ?? ()
#26 0x0000086cc14c80a1 in ?? ()
#27 0x00003b4db0937ea1 in ?? ()
#28 0x0000000c00000000 in ?? ()
#29 0x00007fffffffdb80 in ?? ()
#30 0x00003b4db09227ef in ?? ()
#31 0x0000000000000000 in ?? ()
A debugging session is active.

Comment 11 errata-xmlrpc 2017-11-22 10:51:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:3258