diff options
author | Sebastian Keller <skeller@gnome.org> | 2023-03-16 22:13:09 +0100 |
---|---|---|
committer | Sebastian Keller <skeller@gnome.org> | 2023-04-06 02:11:01 +0200 |
commit | 5b1e0a3ccdcf394cf746ef4e75b7b69f1535a710 (patch) | |
tree | 67e5c5249295ee0cadfeb0f99c0deae6e601558b /installed-tests/js/testGObjectDestructionAccess.js | |
parent | c8f4b63cdd236ebfb23094a54050ebe156cd44cb (diff) | |
download | gjs-5b1e0a3ccdcf394cf746ef4e75b7b69f1535a710.tar.gz |
stack: Print stack trace using glib logging functions
When the gjs process is logging to the systemd journal directly via the
glib logging functions, the stack trace would get logged indirectly via
stderr. This however is not guaranteed to get added to the journal at
the same time as the error messages logged via glib. This is especially
noticeable when triggered from an endless loop or an idle callback. In
some cases it even can result in the stack trace not getting logged at
all.
There is currently no public API in mozjs to dump a stack trace directly
to a string from arbitrary threads, only to files, so this uses
open_memstream() as a workaround.
Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1868
Diffstat (limited to 'installed-tests/js/testGObjectDestructionAccess.js')
-rw-r--r-- | installed-tests/js/testGObjectDestructionAccess.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/installed-tests/js/testGObjectDestructionAccess.js b/installed-tests/js/testGObjectDestructionAccess.js index 889cebd7..8f079afd 100644 --- a/installed-tests/js/testGObjectDestructionAccess.js +++ b/installed-tests/js/testGObjectDestructionAccess.js @@ -381,9 +381,7 @@ describe('Disposed or finalized GObject', function () { file = null; GLib.test_expect_message('Gjs', GLib.LogLevelFlags.LEVEL_CRITICAL, - '*during garbage collection*'); - GLib.test_expect_message('Gjs', GLib.LogLevelFlags.LEVEL_CRITICAL, - '*dispose*'); + '*during garbage collection*offending callback was dispose()*'); System.gc(); GLib.test_assert_expected_messages_internal('Gjs', 'testGObjectDestructionAccess.js', 0, 'calls dispose vfunc on explicit disposal only'); |