1

Setup: Windows 11 Enterprise, version 22H2. WSL 2 enabled from command line. Ubuntu 20.04 installed through Microsoft Store.

LxTerminal was installed and pinned to taskbar. Here is some version information:

ktuulos@SATKT22:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:    20.04
Codename:   focal
ktuulos@SATKT22:~$ apt -qq list lxterminal
lxterminal/focal,now 0.3.2-1 amd64 [installed]

After Windows 11 computer is started and the LxTerminal is executed for the first time (by clicking the icon on taskbar), it always crashes and closes after the first key press. When it is re-opened (again by clicking the icon on taskbar), it works fine.

Dmesg reveals following:

[    8.813388] lxterminal[241]: segfault at 245 ip 00007f85df394cfe sp 00007ffc0a71b490 error 4 in libgdk-3.so.0.2404.16[7f85df37c000+81000]
[    8.814005] Code: 41 56 41 55 41 54 55 53 48 85 ff 74 5f 48 89 fd 41 89 f6 49 89 d4 49 89 cd e8 5e fc ff ff 48 8b 5d 00 48 89 c6 48 85 db 74 05 <48> 39 03 74 0c 48 89 ef e8 b5 c0 fe ff 85 c0 74 31 4d 85 e4 74 7c
[    8.814589] potentially unexpected fatal signal 11.
[    8.814737] CPU: 9 PID: 241 Comm: lxterminal Not tainted 5.15.74.2-microsoft-standard-WSL2 #1
[    8.814995] RIP: 0033:0x7f85df394cfe
[    8.815106] Code: 41 56 41 55 41 54 55 53 48 85 ff 74 5f 48 89 fd 41 89 f6 49 89 d4 49 89 cd e8 5e fc ff ff 48 8b 5d 00 48 89 c6 48 85 db 74 05 <48> 39 03 74 0c 48 89 ef e8 b5 c0 fe ff 85 c0 74 31 4d 85 e4 74 7c
[    8.815616] RSP: 002b:00007ffc0a71b490 EFLAGS: 00010202
[    8.815763] RAX: 00005622747a5b40 RBX: 0000000000000245 RCX: 00005622748e6618
[    8.815982] RDX: 00005622748e6610 RSI: 00005622747a5b40 RDI: 000056227478cb00
[    8.816201] RBP: 000056227478cb00 R08: 0000562274bcfb70 R09: 0000000000000008
[    8.816421] R10: 000056227471e018 R11: 00007ffc0a71b7f0 R12: 00005622748e6610
[    8.816641] R13: 00005622748e6618 R14: 0000000000000066 R15: 000056227472a5c0
[    8.816865] FS:  00007f85db85fcc0 GS:  0000000000000000

How this should be approached?

0

1 Answer 1

1

This was related to starting WSL in Windows 11. If the very first action in WSL was to open LxTerminal, LxTerminal would segfault on the first key press. But if WSL was started e.g. from start menu using the "Ubuntu 20.04 on Windows", or any other WSL command is executed before starting LxTerminal, crash does not occur.

So, my work-around for this was:

  1. Created /home/ktuulos/scripts/init-wsl.sh with following content, and chmodded it as executable:

    #!/bin/sh
    sudo service rsyslog start
    sudo service cron start
    
  2. Created /etc/sudoers.d/10-service (using visudo):

    %sudo   ALL=(ALL) NOPASSWD: /usr/sbin/service
    
  3. Opened Windows File Explorer, went to shell:startup folder and created file init-wsl.cmd:

    wsl /home/ktuulos/scripts/init-wsl.sh
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .