CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.89k stars 711 forks source link

`loolwsd` sends "terminate called without an active exception" to `stderr` after each command #4662

Closed tholewebgods closed 2 years ago

tholewebgods commented 2 years ago

Describe the bug The loolwsd binary ends with an error message (warning) on a terminate() even for successful commands (i.e. help screen, version info). The error message is shown in the "actual behavior" section.

To Reproduce Steps to reproduce the behavior:

  1. Build an Ubuntu 18.04 Docker image from the 6.4.24-1 version
  2. Run the container with a shell (i.e. podman run -it --rm collabora-tmp /bin/bash)
  3. Run /usr/bin/loolwsd with --help or --version-hash
  4. Find the expected output (help screen, version hash, ...)

Expected behavior No further text is sent to stderr.

Actual behavior

terminate called without an active exception

Is printed.

With 6.4.24-1 (not good):

lool@e20fab01a0c1:/$ /usr/bin/loolwsd --version-hash >/dev/null
terminate called without an active exception
Aborted (core dumped)
lool@e20fab01a0c1:/$ /usr/bin/loolwsd --version-hash 2>/dev/null
7aa1cd2
Aborted (core dumped)
lool@ae9db0385412:/$ /usr/bin/loolwsd --version-hash ; echo $?
7aa1cd2
terminate called without an active exception
Aborted (core dumped)
134

With 6.4.16-1 (good):

lool@e7d0c146bf24:/$ /usr/bin/loolwsd --version-hash 2>/dev/null
e17cab4
lool@e7d0c146bf24:/$ /usr/bin/loolwsd --version-hash >/dev/null
lool@e7d0c146bf24:/$
lool@e7d0c146bf24:/$ /usr/bin/loolwsd --version-hash ; echo $?
e17cab4
0

Screenshots N/A, see console output

Desktop (please complete the following information) N/A

Smartphone (please complete the following information) N/A

Additional context None.

thebearon commented 2 years ago

I see AdminModel construction/destruction on the console in a local 6.4 build (it doesn't crash, but I assume that's the reason):

<shutdown>-438063 2022-04-26 21:32:20.037729 +0200 [ loolwsd ] INF  AdminModel ctor.| wsd/AdminModel.hpp:315
<shutdown>-438063 2022-04-26 21:32:20.037815 +0200 [ loolwsd ] INF  Admin ctor.| wsd/Admin.cpp:397
<shutdown>-438063 2022-04-26 21:32:20.040110 +0200 [ loolwsd ] INF  ~Admin dtor.| wsd/Admin.cpp:416
<shutdown>-438063 2022-04-26 21:32:20.040139 +0200 [ loolwsd ] INF  AdminModel dtor.| wsd/AdminModel.cpp:215

This started in 6.4 with the following commit: f612c6673d48d8bbb343eedba92da093217d4f80

Author:     Michael Meeks <michael.meeks@collabora.com>
AuthorDate: Wed Mar 2 17:40:33 2022 +0000
Commit:     Michael Meeks <michael.meeks@collabora.com>
CommitDate: Thu Mar 3 09:04:15 2022 +0000

    Admin: shutdown cleanly to avoid races during close.

The commit is also in the master branch, but no problem there.

CC @mmeeks.

Ashod commented 2 years ago

Interestingly, I had a patch to fix this issue with --cleanup, after the https://github.com/CollaboraOnline/online/commit/f612c6673d48d8bbb343eedba92da093217d4f80 commit:

commit 231fae4ebd990cb344143759cbdfa19c4f30d4f2 (github/distro/collabora/co-6-4)
Author: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Date:   Tue Mar 8 08:53:40 2022 -0500

    wsd: forced exit after cleaning up jails

    The static instances cause a lot of grief
    when they aren't called in the correct order.
    Worse, when we are cleaning up, we don't
    even initialize some of them (Admin, for one).
    This means that a normal exit will destroy
    what isn't created, in some cases (Admin) it
    will even force creating instances when we
    are destroying others.

    This avoid all this by simply exiting bluntly.

And here is the fix for the cases reported here: #4687

mmeeks commented 2 years ago

Thanks Ash =)