Bug 1564636 - unit test implementation causes glib to abort
Summary: unit test implementation causes glib to abort
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: lasso
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Hrozek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-06 18:24 UTC by John Dennis
Modified: 2020-11-24 20:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 20:07:26 UTC
Type: Bug


Attachments (Terms of Use)

Description John Dennis 2018-04-06 18:24:04 UTC
When running the unit tests in Lasso an unexpected log message will cause corruption in the glib logging implementation which then causes glib to abort the process.

g_logv() [glib/gmessages.c:1273] is the low level logging function in glib. To prevent re-entry into the function (e.g. recursion) g_logv() increments a thread local counter like this:

g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));

On exit from g_logv() it decrements the counter. If the counter is non-zero on entry g_logv() concludes it has been re-entered and deems this a fatal error and calls _g_log_abort().

In between the increment and decrement of the recursion counter g_logv() calls the log handler for the logging domain to emit the log message.

The Lasso unit test installs it's own log handler fail_logger() [tests/tests.c:67] to capture unexpected log messages during the test. The assumption is a successful test should never cause glib to emit a message and if the fail_logger() is invoked it means the test should be marked as a failure. It does so by calling the fail() function of the unit test library (e.g. check).

check.h defines fail() like this:

/*
 * Fail the test
 *
 * This call is deprecated.
 */
#define fail ck_abort_msg

ck_abort_msg is defined to be the function _ck_assert_failed() which after recording the message executes a longjump back up to the test runner.

The longjump executed by the log handler causes a non-local early exit from the  g_logv() function prior to its decrement of the recursion counter. This causes the glib logging implementation to be left in an inconsistent state. The next time a log message is emitted the recursion counter upon entry to g_logv() is non-zero. This then causes glib to abort.

Comment 1 Ben Cotton 2019-05-02 21:57:02 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Ben Cotton 2019-05-28 19:50:54 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 John Dennis 2019-05-28 20:27:40 UTC
Jakub: if memory serves me right this was reported upstream and upstream made some fixes, albeit in a slightly different way. We should probably verify this bug no longer exists with a lasso version containing the upstream fixes (should be easy to determine from the git commit messages). If it's not fixed we should do something, it's a pernicious bug, I wasted way too much time diagnosing what was going wrong when I encountered this.

Comment 4 John Dennis 2019-05-28 20:35:33 UTC
FYI, upstream commit:

commit 87da2e6e1471616805c6dabaaa6e8e58890384ca
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 6 15:11:03 2018 +0200

    tests: prevent crash in glib caused by abort on recursive logging

Comment 5 Ben Cotton 2019-08-13 17:11:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 6 Ben Cotton 2019-08-13 19:17:22 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 7 Ben Cotton 2020-11-03 15:00:32 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Ben Cotton 2020-11-24 20:07:26 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.