Bug 114073 - loolwsd segfaults on startup with libssl1.1
Summary: loolwsd segfaults on startup with libssl1.1
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:6.1.0 target:6.0.0.1 target:5....
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-26 19:59 UTC by Rene Engelhard
Modified: 2018-01-31 16:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rene Engelhard 2017-11-26 19:59:37 UTC
Hi,

Nov 26 20:47:02 sid systemd[1]: Started LibreOffice Online WebSocket Daemon.
-- Subject: Unit loolwsd.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit loolwsd.service has finished starting up.
-- 
-- The start-up result is RESULT.
Nov 26 20:47:02 sid loolwsd[5162]: wsd-05162-05162 19:47:02.757881 [ loolwsd ] SIG   Fatal signal received: SIGSEGV
Nov 26 20:47:02 sid loolwsd[5162]: Backtrace 5162:
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(_ZN7SigUtil13dumpBacktraceEv+0x64) [0x55b7782be074]
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(+0x10e082) [0x55b7782bf082]
Nov 26 20:47:02 sid loolwsd[5162]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x123b0) [0x7f3f2464e3b0]
Nov 26 20:47:02 sid loolwsd[5162]: /lib/x86_64-linux-gnu/libssl.so.1.1(SSL_CTX_set_options+0) [0x7f3f26eabfe0]
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(_ZN10SslContextC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_+0xb9) [0x55b7782d41c9]
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(_ZN7LOOLWSD13initializeSSLEv+0x5d4) [0x55b7782358d4]
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(_ZN7LOOLWSD9innerMainEv+0x150) [0x55b77823e5d0]
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(_ZN7LOOLWSD4mainERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EE+0x2a) [0x55b7781e7faa]
Nov 26 20:47:02 sid loolwsd[5162]: /lib/libPocoUtil.so.50(_ZN4Poco4Util11Application3runEv+0x31) [0x7f3f25e482a1]
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(main+0x84) [0x55b7781e7a34]
Nov 26 20:47:02 sid loolwsd[5162]: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7f3f242b9561]
Nov 26 20:47:02 sid loolwsd[5162]: /usr/bin/loolwsd(_start+0x2a) [0x55b7781e8aaa]
Nov 26 20:47:02 sid systemd[1]: loolwsd.service: Main process exited, code=killed, status=11/SEGV
Nov 26 20:47:02 sid systemd[1]: loolwsd.service: Failed with result 'signal'.
Nov 26 20:47:02 sid systemd[1]: loolwsd.service: Service hold-off time over, scheduling restart.
Nov 26 20:47:02 sid systemd[1]: loolwsd.service: Scheduled restart job, restart counter is at 1.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Automatic restarting of the unit loolwsd.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.

etc.

I first thought it broke because there were no (valid) certificates but even with a self-signed certificate it segfaults (not that it should segfault in the first case anyways, but..)

This is a libreoffice-5.4.2.2 tag build against poco 1.8.0.1 and libssl 1.1. 

That is probably the culprit I would assume. Discussions on IRC reveal that it works with poco 1.8.0.1 and libssl 1.0.2..
Comment 1 Rene Engelhard 2017-11-26 20:23:46 UTC
FWIW, from Nov 16 and 17:

11:54 < _rene_> pranavk: a propos wsd... which libssl do you use?
11:54 < DarkStar1> pranavk: I was thinking to rephrase the bug enhancement to make the request perhaps clearer so the issue is better understood
11:54 < _rene_> pranavk: I get reproducible SIGSEGV with ssl=true. libssl1.1
11:54 < loircbot> LibreOffice (core) tml * vcl/source/gdi/pdfwriter_impl.cxx: tdf#113875: Properly export 1bpp greylevel (but not B&W) PNG images to PDF
11:54 -!- iplaw67 [~Thunderbi@178.73.157.19] has joined #libreoffice-dev
11:55 < _rene_> pranavk: first thought it was becasuse there were no files, but even with symlinks to cert/key/ca-chain it sigsegvs.
11:55 < pranavk> _rene_: doesn't sigsegv for me for sure. I have been using it heavily lately. let me check
11:56 < _rene_> (this is the libreoffice-5.4.2.2 tag, fwiw)
11:56 < pranavk> oh. I have been using master only
11:58 < pranavk> didn't check 5-4 recently
11:58 < pranavk> _rene_: openssl-libs-1.0.2k-1.fc25.x86_64
11:58 < _rene_> mmh, ok, so 1.0.2. maybe I should try 1.0.2
11:59 < _rene_> otoh probably I can't since poco uses 1.1...
11:59 -!- bearon [~bearon@217.65.98.36] has joined #libreoffice-dev
12:00 -!- Lucifer_arma [~quassel@cpe-66-68-59-243.austin.res.rr.com] has quit [Remote host closed the connection]
12:00 < pranavk> my poco is 1.7.3
12:00 -!- YuGiOhJCJ [~YuGiOhJCJ@gateway/tor-sasl/yugiohjcj] has quit [Remote host closed the connection]
12:00 -!- ohallot [~Thunderbi@179.218.180.46] has quit [Ping timeout: 248 seconds]
12:01 -!- YuGiOhJCJ [~YuGiOhJCJ@gateway/tor-sasl/yugiohjcj] has joined #libreoffice-dev
12:01 < _rene_> mine is 1.8.0.1
12:02 < _rene_> (and Debian uses libssl1.1. Even for 1.7.x)
12:02 -!- Lucifer_arma [~quassel@cpe-66-68-59-243.austin.res.rr.com] has joined #libreoffice-dev
12:03 < _rene_> (https://packages.debian.org/buster/libpoconetssl48, which I can't use due to the json issue, though. and unstable has that gone and replaced by 1.8.0.1 which has that json issue fixed finally... :))
12:03 < pranavk> DarkStar1: yeah, good idea to rephrase the bug report, etc.
12:08 -!- iplaw67 [~Thunderbi@178.73.157.19] has quit [Ping timeout: 255 seconds]
12:08 < pranavk> _rene_: ah, nice. i see your comment on https://bugs.documentfoundation.org/show_bug.cgi?id=103678 :)
12:08 < IZBot> bug 103678: LibreOffice Online-LibreOffice normal/medium RESOLVED
 WONTFIX please switch from POCO JSON parser to something else
[...]
11:22 < pranavk> _rene_: btw, i tried online master with self built poco 1.8.0 and no sigsegv (but didn't upgrade openssl)
11:25 < _rene_> so then it's probably libssl related...


and the bug was just confirmed today on IRC again
Comment 2 Rene Engelhard 2017-11-27 07:07:06 UTC
probably introduced in https://cgit.freedesktop.org/libreoffice/online/commit/?id=702bbdd5d8dd31eda8a2dfdb726be3c6cd978ec2 (before that it didn't build with OpenSSL 1.1 anyway, though, due to the API changes)
Comment 3 Commit Notification 2017-11-27 11:02:47 UTC
Pranav Kant committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=483a5d68e5f7e6b145d957c50120cd05c436387b

tdf#114073: Potential fix for crash with openssl1.1
Comment 4 Rene Engelhard 2017-11-27 20:03:34 UTC
confirming it starts now
Comment 5 Commit Notification 2017-11-28 07:19:38 UTC
Pranav Kant committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=139a7565bf2c4305c4f915cbff80373a8eff5d40&h=libreoffice-6-0

tdf#114073: Potential fix for crash with openssl1.1
Comment 6 Commit Notification 2018-01-31 16:48:37 UTC
Pranav Kant committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=97aa646a4f57bdde5857ce05f282627893674a36&h=libreoffice-5-4

tdf#114073: Potential fix for crash with openssl1.1