Dynamic import in extension crashes gnome-shell 44.1 at login
Using dynamic import()
syntax in an extesion causes the Gnome Shell to segfault and crash when loading the extension at startup. The crash happens at libmutter-12.so
as can be seen in the reduced logs below or in the full logs.
Stack trace in journalctl.
May 11 16:40:03 marmis-arch kernel: gnome-shell[600]: segfault at 18 ip 00007f823ad15479 sp 00007ffea2d8a520 error 4 in libmutter-12.so.0.0.0[7f823ac49000+17d000] likely on CPU 1 (core 1, socket 0)
May 11 16:40:03 marmis-arch kernel: Code: 89 d7 ff 15 39 92 14 00 e9 a4 ef ff ff 48 63 15 21 d6 14 00 48 8b b5 60 fe ff ff 48 8b 14 13 8b 06 4a 8b 14 32 48 8b 54 0a 38 <48> 8b 52 18 8b 92 f4 05 00 00 83 c2 01 39 d0 0f 85 ee ed ff ff 8b
May 11 16:40:04 marmis-arch systemd-coredump[815]: Process 600 (gnome-shell) of user 1000 dumped core.
Stack trace of thread 600:
#0 0x00007f823ad15479 n/a (libmutter-12.so.0 + 0x115479)
#1 0x00007f823ad17c5e n/a (libmutter-12.so.0 + 0x117c5e)
#2 0x00007f823b33a53b g_main_context_dispatch (libglib-2.0.so.0 + 0x5a53b)
#3 0x00007f823b397219 n/a (libglib-2.0.so.0 + 0xb7219)
#4 0x00007f823b3391a2 g_main_context_iteration (libglib-2.0.so.0 + 0x591a2)
#5 0x00007f823b1d9eee n/a (libgjs.so.0 + 0x91eee)
#6 0x00007f823b1d555b gjs_context_eval_module (libgjs.so.0 + 0x8d55b)
#7 0x00007f823b1d5791 gjs_context_eval_module_file (libgjs.so.0 + 0x8d791)
#8 0x00007f823b622620 n/a (libshell-12.so + 0x22620)
#9 0x00007f823acb5f3a n/a (libmutter-12.so.0 + 0xb5f3a)
#10 0x00007f823acd278c meta_context_start (libmutter-12.so.0 + 0xd278c)
#11 0x000055e5d97ed511 n/a (gnome-shell + 0x3511)
#12 0x00007f823aa39850 n/a (libc.so.6 + 0x23850)
#13 0x00007f823aa3990a __libc_start_main (libc.so.6 + 0x2390a)
#14 0x000055e5d97ed835 n/a (gnome-shell + 0x3835)
Stack trace of thread 602:
#0 0x00007f823ab192ed syscall (libc.so.6 + 0x1032ed)
#1 0x00007f823b3907b5 g_cond_wait (libglib-2.0.so.0 + 0xb07b5)
#2 0x00007f823b304fb4 n/a (libglib-2.0.so.0 + 0x24fb4)
#3 0x00007f823b36bf9e n/a (libglib-2.0.so.0 + 0x8bf9e)
#4 0x00007f823b367315 n/a (libglib-2.0.so.0 + 0x87315)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 605:
#0 0x00007f823ab1950b __mprotect (libc.so.6 + 0x10350b)
#1 0x00007f823aaabb3e n/a (libc.so.6 + 0x95b3e)
#2 0x00007f823aaace93 n/a (libc.so.6 + 0x96e93)
#3 0x00007f823aaad72d malloc (libc.so.6 + 0x9772d)
#4 0x00007f823b33ee1a g_malloc (libglib-2.0.so.0 + 0x5ee1a)
#5 0x00007f823b383331 g_variant_new_from_bytes (libglib-2.0.so.0 + 0xa3331)
#6 0x00007f823b3835a7 g_variant_new_string (libglib-2.0.so.0 + 0xa35a7)
#7 0x00007f823b569cf6 n/a (libgio-2.0.so.0 + 0x13ecf6)
#8 0x00007f823b56a220 n/a (libgio-2.0.so.0 + 0x13f220)
#9 0x00007f823b5698e7 n/a (libgio-2.0.so.0 + 0x13e8e7)
#10 0x00007f823b569f62 n/a (libgio-2.0.so.0 + 0x13ef62)
#11 0x00007f823b533dd5 g_dbus_message_new_from_blob (libgio-2.0.so.0 + 0x108dd5)
#12 0x00007f823b54219e n/a (libgio-2.0.so.0 + 0x11719e)
#13 0x00007f823b4d33f4 n/a (libgio-2.0.so.0 + 0xa83f4)
#14 0x00007f823b4d342d n/a (libgio-2.0.so.0 + 0xa842d)
#15 0x00007f823b33a53b g_main_context_dispatch (libglib-2.0.so.0 + 0x5a53b)
#16 0x00007f823b397219 n/a (libglib-2.0.so.0 + 0xb7219)
#17 0x00007f823b339c7f g_main_loop_run (libglib-2.0.so.0 + 0x59c7f)
#18 0x00007f823b539d3c n/a (libgio-2.0.so.0 + 0x10ed3c)
#19 0x00007f823b367315 n/a (libglib-2.0.so.0 + 0x87315)
#20 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#21 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 603:
#0 0x00007f823ab13c0f __poll (libc.so.6 + 0xfdc0f)
#1 0x00007f823b39717f n/a (libglib-2.0.so.0 + 0xb717f)
#2 0x00007f823b3391a2 g_main_context_iteration (libglib-2.0.so.0 + 0x591a2)
#3 0x00007f823b3391f2 n/a (libglib-2.0.so.0 + 0x591f2)
#4 0x00007f823b367315 n/a (libglib-2.0.so.0 + 0x87315)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 622:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 629:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 604:
#0 0x00007f823ab192ed syscall (libc.so.6 + 0x1032ed)
#1 0x00007f823b390d03 g_cond_wait_until (libglib-2.0.so.0 + 0xb0d03)
#2 0x00007f823b304f83 n/a (libglib-2.0.so.0 + 0x24f83)
#3 0x00007f823b36c9fb n/a (libglib-2.0.so.0 + 0x8c9fb)
#4 0x00007f823b367315 n/a (libglib-2.0.so.0 + 0x87315)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 623:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 606:
#0 0x00007f823ab13c0f __poll (libc.so.6 + 0xfdc0f)
#1 0x00007f823b39717f n/a (libglib-2.0.so.0 + 0xb717f)
#2 0x00007f823b3391a2 g_main_context_iteration (libglib-2.0.so.0 + 0x591a2)
#3 0x00007f82363d6fde n/a (libdconfsettings.so + 0x5fde)
#4 0x00007f823b367315 n/a (libglib-2.0.so.0 + 0x87315)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 624:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 667:
#0 0x00007f823ab192ed syscall (libc.so.6 + 0x1032ed)
#1 0x00007f823b390d03 g_cond_wait_until (libglib-2.0.so.0 + 0xb0d03)
#2 0x00007f823b304f83 n/a (libglib-2.0.so.0 + 0x24f83)
#3 0x00007f823b36c9fb n/a (libglib-2.0.so.0 + 0x8c9fb)
#4 0x00007f823b367315 n/a (libglib-2.0.so.0 + 0x87315)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 625:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 626:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 627:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 628:
#0 0x00007f823aa99f0e n/a (libc.so.6 + 0x83f0e)
#1 0x00007f823aa9c7a0 pthread_cond_wait (libc.so.6 + 0x867a0)
#2 0x00007f8239792a61 _ZN7mozilla6detail21ConditionVariableImpl8wait_forERNS0_9MutexImplERKNS_16BaseTimeDurationINS_27TimeDurationValueCalculatorEEE (libmozjs-102.so + 0x1592a61)
#3 0x00007f8239792962 n/a (libmozjs-102.so + 0x1592962)
#4 0x00007f823994ae4e n/a (libmozjs-102.so + 0x174ae4e)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
Stack trace of thread 666:
#0 0x00007f823ab192ed syscall (libc.so.6 + 0x1032ed)
#1 0x00007f823b390d03 g_cond_wait_until (libglib-2.0.so.0 + 0xb0d03)
#2 0x00007f823b304f83 n/a (libglib-2.0.so.0 + 0x24f83)
#3 0x00007f823b36c9fb n/a (libglib-2.0.so.0 + 0x8c9fb)
#4 0x00007f823b367315 n/a (libglib-2.0.so.0 + 0x87315)
#5 0x00007f823aa9d44b n/a (libc.so.6 + 0x8744b)
#6 0x00007f823ab20e40 n/a (libc.so.6 + 0x10ae40)
ELF object binary architecture: AMD x86-64
May 11 16:40:04 marmis-arch systemd[1]: systemd-coredump@0-810-0.service: Deactivated successfully.
If the extension is enabled via gnome-extensions
or gnome-extesions-app
, it should work as expected. However, when the extension is automatically loaded via autologin (couldn't test via normal login), then gnome-shell crashes and needs to be restarted without extensions.
Example extension
The following code can be placed in an extentension.js
.
function init({ metadata }) {
const { uuid } = metadata;
function enable() {
log(`Enabling ${uuid}`);
import('./file.js').catch((reason) => {
log(`Error ${uuid}: ${reason}`);
if (reason instanceof Error) {
logError(reason, uuid);
}
});
}
function disable() {
log(`Disabling ${uuid}`);
}
return { enable, disable };
}
It doesn't matter if the module ./file.js
is present or not, the shell crashes either way.
System Information
marmis@marmis-arch
------------------
OS: Arch Linux x86_64
Host: B450M Steel Legend
Kernel: 6.3.1-zen2-1-zen
Uptime: 23 mins
Packages: 1759 (pacman)
Shell: zsh 5.9
Resolution: 1920x1080
DE: GNOME 44.1
WM: Mutter
WM Theme: Orchis-Dark-Compact
Theme: Orchis-Dark-Compact [GTK2/3]
Icons: Tela-circle-dracula-dark [GTK2/3]
Terminal: tilix
CPU: AMD Ryzen 5 1500X (8) @ 3.599GHz
GPU: NVIDIA GeForce GTX 960
Memory: 3960MiB / 15917MiB