Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault using TLS after uprgrade to nodejs 6.7.0 / CentOS 7 #1655

Closed
deburau opened this issue Oct 10, 2016 · 5 comments
Closed

Comments

@deburau
Copy link

deburau commented Oct 10, 2016

Haraka version

Version: 2.8.9

Node.js version

v6.7.0

Expected behavior

TLS is working

Observed behavior

Segmentation fault using TLS after uprgrade to nodejs 6.7.0 / CentOS 7

Steps to reproduce

Last week nodejs was updated to version 6.7.0 on my CentOS 7 server.

After that, TLS stopped working. Everytime a client started using TLS, haraka crashed with a segmentation fault. I am using a certificate from Let's Encrypt.

The last line in the logfile is always like this

2016-10-08T02:06:27.807Z [DEBUG] [-] [core] Upgrading to TLS

I don't know if it is an error in nodejs or in the way haraka is using it. In the latter case, the following information from the core dump may be helpful:

Core was generated by `node /usr/bin/haraka -c /root/haraka-test'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f39c2e8dce0 in asn1_enc_restore (len=len@entry=0x7fff46fb1d74, out=out@entry=0x0, pval=pval@entry=0x1eec3f0, it=it@entry=0x7f39c3150480 <X509_CINF_it>)

at tasn_utl.c:190
190 if (!enc || enc->modified)

(gdb) bt
#0 0x00007f39c2e8dce0 in asn1_enc_restore (len=len@entry=0x7fff46fb1d74, out=out@entry=0x0, pval=pval@entry=0x1eec3f0, it=it@entry=0x7f39c3150480 <X509_CINF_it>)

at tasn_utl.c:190
#1 0x00007f39c2e8af3b in ASN1_item_ex_i2d (pval=pval@entry=0x1eec3f0, out=out@entry=0x0, it=0x7f39c3150480 <X509_CINF_it>, tag=tag@entry=-1, aclass=aclass@entry=0)

at tasn_enc.c:202
#2 0x00007f39c2e8b3e1 in asn1_template_ex_i2d (pval=0x1eec3f0, out=out@entry=0x0, tt=tt@entry=0x7f39c3156760 <X509_seq_tt>, tag=tag@entry=-1, iclass=iclass@entry=0)

at tasn_enc.c:413
#3 0x00007f39c2e8b1bb in ASN1_item_ex_i2d (pval=pval@entry=0x7fff46fb1ed8, out=out@entry=0x0, it=it@entry=0x7f39c3150400 <X509_it>, tag=16, tag@entry=-1,

aclass=aclass@entry=0) at tasn_enc.c:231
#4 0x00007f39c2e8b2bf in asn1_item_flags_i2d (val=val@entry=0x1eec3f0, out=out@entry=0x0, it=it@entry=0x7f39c3150400 <X509_it>, flags=flags@entry=0) at tasn_enc.c:122
#5 0x00007f39c2e8b367 in ASN1_item_i2d (val=val@entry=0x1eec3f0, out=out@entry=0x0, it=it@entry=0x7f39c3150400 <X509_it>) at tasn_enc.c:91
#6 0x00007f39c2e868cc in i2d_X509 (a=a@entry=0x1eec3f0, out=out@entry=0x0) at x_x509.c:141
#7 0x00007f39c319a7bd in ssl3_add_cert_to_buf (buf=0x1e41510, l=0x7fff46fb1f78, x=0x1eec3f0) at s3_both.c:335
#8 0x00007f39c319ae93 in ssl3_output_cert_chain (s=s@entry=0x1eedd40, x=) at s3_both.c:405
#9 0x00007f39c318e645 in ssl3_send_server_certificate (s=s@entry=0x1eedd40) at s3_srvr.c:3398
#10 0x00007f39c318fabd in ssl3_accept (s=0x1eedd40) at s3_srvr.c:417
#11 0x00007f39c319d368 in ssl23_accept (s=0x1eedd40) at s23_srvr.c:210
#12 0x0000000000e55e95 in node::crypto::Connection::ClearOut (args=...) at ../src/node_crypto.cc:3113
#13 0x0000000000729644 in v8::internal::FunctionCallbackArguments::Call (this=this@entry=0x7fff46fb22c0,

f=f@entry=0xe55c80 node::crypto::Connection::ClearOut(v8::FunctionCallbackInfo<v8::Value const&)>) at ../deps/v8/src/api-arguments.cc:16
#14 0x00000000007831e4 in v8::internal::(anonymous namespace)::HandleApiCallHelper (isolate=isolate@entry=0x1d2f7a0, args=...) at ../deps/v8/src/builtins.cc:4322
#15 0x00000000007839ce in v8::internal::Builtin_Impl_HandleApiCall (args=..., isolate=isolate@entry=0x1d2f7a0) at ../deps/v8/src/builtins.cc:4340
#16 0x0000000000783b7e in v8::internal::Builtin_HandleApiCall (args_length=, args_object=0x7fff46fb24c0, isolate=0x1d2f7a0) at ../deps/v8/src/builtins.cc:4337
#17 0x00001498485092a7 in ?? ()
#18 0x0000000000000000 in ?? ()

@Dexus
Copy link
Member

Dexus commented Oct 10, 2016

I have reported this Issue to https://github.com/nodejs/node

@msimerson
Copy link
Member

Did you run a command like this after upgrading node.js?

cd /some/where/lib/node_modules/Haraka && npm install

That is generally required after upgrading node.js. Especially for modules that did any compilation. Also, if you did run npm install after upgrading node, consider doing an rm -rf node_modules/* && npm install. That rm shouldn't be necessary, as npm usually does the right thing, but it doesn't hurt to try.

@mscdex
Copy link

mscdex commented Oct 11, 2016

What node version were you using before where it worked?

@deburau
Copy link
Author

deburau commented Oct 11, 2016

@msimerson After discovering the issue, I deinstalled nodejs, npm etc and did a fresh install

@mscdex The upgrade was from nodejs-0.10.46 to nodejs-6.7.0

@deburau
Copy link
Author

deburau commented Oct 13, 2016

Follow up:

I installed nodejs 6.8.0 from nodejs.org, same error.

Then I installed openssl 1.1.0b from source and now the error is gone.

So I think this is not a haraka issue.

@deburau deburau closed this as completed Oct 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants