Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault #10927

Closed
1 of 2 tasks
rookierool opened this issue Dec 16, 2023 · 14 comments
Closed
1 of 2 tasks

Segmentation fault #10927

rookierool opened this issue Dec 16, 2023 · 14 comments

Comments

@rookierool
Copy link

Windows Version

Microsoft Windows [Version 10.0.19045.3803]

WSL Version

WSL2

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

openSUSE-Leap-15.5

Other Software

Name : gedit
Version : 40.1
Release : 150400.4.3.1
Architecture: x86_64

Repro Steps

trying to run gedit in openSUSE

DESKTOP-A4H0TLA:/etc # sudo zypper in -t pattern wsl_gui
Loading repository data...
Reading installed packages...
'pattern:wsl_gui' is already installed.

DESKTOP-A4H0TLA:/etc # sudo zypper in gedit nautilus
Loading repository data...
Reading installed packages...
'nautilus' is already installed.

DESKTOP-A4H0TLA:/etc # gedit
Segmentation fault

Expected Behavior

try to use gedit in WSL2

Actual Behavior

DESKTOP-A4H0TLA:/etc # gedit
Segmentation fault

Diagnostic Logs

No response

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@sbradnick
Copy link
Contributor

It's working here without issue (on a fully up-to-date openSUSE-Leap-15.5 install). Only difference is I'm using pattern:wsl_systemd and installed lato-fonts directly.

openSUSE-Leap-15 5-gedit_1702741167

Does xeyes work?

@rookierool
Copy link
Author

@sbradnick yeah, the xeyes works fine, i tried to run gedit on ubuntu20.04, same error occurs. Sorry that i can't upload a screenshot cause i am on another computer now. Another thing is that gnuplot and xeyes also work fine in my ubuntu20.04, and the GUI i'm using is XLaunch

@sbradnick
Copy link
Contributor

Have you tried it using WSLg (the built-in setup where DISPLAY=:0)? Back before WSLg was a thing, I used VcXsrv and it wasn't an issue - but now I just stick w/ WSLg's backend.

@rookierool
Copy link
Author

@sbradnick i haven't. But can you be more specific?i am new to this, still got lots of stuff to learn. but i will give it a try, really appreciate your patience.

@sbradnick
Copy link
Contributor

You shouldn't need to start (or set DISPLAY for) any X server explicitly. When you launch openSUSE-Leap-15.5 and are greeted with a prompt, you should get a default DISPLAY=:0 in which you can run xeyes and you get 👀 😄 ; if that works, but gedit doesn't, there should be more output (related to whatever might be gedit's issue) than just "Segmentation fault", maybe some core dumps can be generated/analyzed.

@rookierool
Copy link
Author

@sbradnick OMG,it worked! I tried it in my Ubuntu20.04 and it works just fine, you can see it in the screenshot below.
1

But in opensuse, it will take about 7 minutes when the gedit window jumps out

2

error:(forgot to take a screenshot)

(gedit:219): dconf-WARNING **: 12:33:06.542: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=9d4052a4da68484c9d84f043dd4ce96c --binary-syntax --close-stderr”: Child process exited with code 1

(gedit:219): dconf-WARNING **: 12:33:06.545: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=9d4052a4da68484c9d84f043dd4ce96c --binary-syntax --close-stderr”: Child process exited with code 1

(gedit:219): dconf-WARNING **: 12:35:34.223: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=9d4052a4da68484c9d84f043dd4ce96c --binary-syntax --close-stderr”: Child process exited with code 1

then i typed this(i used to solve similar error in ubuntu, so i wonder it maybe works in this situation too): echo "export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0" >> ~/.bashrc
and closed the terminal and open it again, the gedit finally jumps immediately, but there are still some error line:

(gedit:358): dconf-WARNING **: 12:42:30.344: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=9d4052a4da68484c9d84f043dd4ce96c --binary-syntax --close-stderr”: Child process exited with code 1

(gedit:358): dconf-WARNING **: 12:42:30.346: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=9d4052a4da68484c9d84f043dd4ce96c --binary-syntax --close-stderr”: Child process exited with code 1

Thanks a lot for your help and advice!

@sbradnick
Copy link
Contributor

then i typed this(i used to solve similar error in ubuntu, so i wonder it maybe works in this situation too): echo "export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0" >> ~/.bashrc
and closed the terminal and open it again, the gedit finally jumps immediately, but there are still some error line:

You really shouldn't need to do that, DISPLAY should be set correctly out of the gate to work for your default [non root] user.

I'm also not sure if you were trying to launch gedit as root in Leap 15.5, the fact your prompt is red and is using a # leads me to believe that's the case. But if you're resetting DISPLAY (as root), then I suppose that could work [since you'd be setting it to the IP of the default route, i.e. the WSL Hyper-V backend].

@rookierool
Copy link
Author

rookierool commented Dec 18, 2023

@sbradnick This is awkward cause when i got back to my desktop, the probelm changed to another one(XLaunch closed)...

(gedit:75): Gtk-WARNING **: 20:23:56.525: cannot open display: my ip address:0

to rule out all possible issues, i tested following codes in ubuntu:

  1. with XLaunch open

root@DESKTOP-A4H0TLA:# export DISPLAY=:0
root@DESKTOP-A4H0TLA:
# xeyes
Error: Can't open display: :0
root@DESKTOP-A4H0TLA:# export DISPLAY=my ip address:0
root@DESKTOP-A4H0TLA:
# xeyes (works fine)
root@DESKTOP-A4H0TLA:~# gedit
Segmentation fault

  1. with XLaunch close

root@DESKTOP-A4H0TLA:# export DISPLAY=:0
root@DESKTOP-A4H0TLA:
# xeyes
Error: Can't open display: :0
root@DESKTOP-A4H0TLA:# export DISPLAY=my ip address:0
Error: Can't open display: my ip address:0
root@DESKTOP-A4H0TLA:
# gedit
Unable to init server: Could not connect: Connection refused
(gedit:572): Gtk-WARNING **: 20:32:54.124: cannot open display: my ip address:0

2
i also changed to guest user, it won't help...

Also, an interesting thing. no matter which ip address i export to, all 'xeyes' works fine with XLanuch open

3
4

@sbradnick
Copy link
Contributor

You're mixing and matching methodologies too much to adequately rule anything out or find a root cause. Also, this concept of "guest user" is concerning. As you run through 'firstboot' when installing openSUSE Leap 15.5, you (should have!) setup a non-root user and THAT USER is the one you should have a prompt for when launching the distro. You really seem to be complicating this by insisting on using root and throwing a non-WSLg X server into the mix.

I'd suggest stopping all XLaunch processes and launching Leap w/ the non-root user (really should be the default), or you can force it with /etc/wsl.conf:

[user]
default=<some non-root user that should already be setup>

and seeing what echo $DISPLAY says. Should simply return :0 and xeyes should work w/o issue. DO NOT reset DISPLAY using an IP or anything related to your XLaunch backend. I can also use gedit and leafpad w/o problems in Leap using WSLg.

It does seem 2.0.14.0 can exhibit issues w/ WSLg and the usage of the /mnt/wslg/.X11-unix -> /tmp/.X11-unix setup (i.e. missing X0 socket, but that's a WSL/WSLg issue - not the distro), and oddly for me (in Tumbleweed) gedit STILL pops up; leafpad and xeyes complain about "Cannot open display:"; simple to fix:

cd /tmp
sudo rm -rf /tmp/.X11-unix
sudo ln -s /mnt/wslg/.X11-unix

@rookierool
Copy link
Author

@sbradnick First i really appreciate your patience, hope i didn't drive you crazy (hah), it seems that i may be wrong even at the first step, so i am going to reinstall the whole distro and packages by 'non-ROOT' this time, and also uninstall XLaunch too. hope i make less mistakes...Anyway, thanks again.

@rookierool
Copy link
Author

rookierool commented Dec 19, 2023

@sbradnick I reinstall the opensuse-leap and ubuntu20.04, and set the default user as non-root user. In opensuse, i run by following codes:

#FOR X11 AND XT FONTS
sudo zypper install patterns-base-x11 patterns-fonts-fonts patterns-fonts-fonts_opt patterns-base-x11
sudo zypper install xorg-x11-fonts libX11-devel libXcursor-devel libXt-devel
sudo zypper in -t pattern fonts

#FOR GEDIT, GNOME AND X11 XT
sudo zypper in -t pattern gnome
sudo zypper in gedit

the error pumps out :

zjlcfd@DESKTOP-A4H0TLA:/OpenFOAM> gedit
(gedit:2074): Gtk-WARNING **: 11:25:08.452: cannot open display:
zjlcfd@DESKTOP-A4H0TLA:
/OpenFOAM> echo $DISPLAY
(returns nothing)

but finally i solved this by update my WSL and installed the cmake-gui:
in powershell administrater
wsl --update

in opensuse distr
sudo zypper update
sudo zypper install cmake-gui

this time it works, so is the 'camke-gui' the WSLg-X server that you mentioned?
image

also, do you think something related to version of wsl? before that i never tried to update my WSL, when the problem was solved, also found that the interface of powershell changed a little, so maybe i have been using the old version of WSL2 which cause those problem?

@sbradnick
Copy link
Contributor

I'm on Win11 and using the latest version of WSLv2 (WSLv1 isn't enabled on purpose, to keep things simple 😛) - maybe these issues you're having come from Win10 and and old revision of WSL.

What does wsl --version show? And wsl --status? Even wsl -l -v would be useful. Personally, I always use the releases from here vs. installing from the Store and/or running wsl --update, if there's a new one I just uninstall the one I have installed and install a new one from the .msi file (previously the .msixbundle file).

The only issue I'm having is with WSLg and the .X11-unix file being goofed up. But that seems to be an issue that's cropped back up - it's not new - but was squashed for a while. At least it's a simple fix.

@rookierool
Copy link
Author

@sbradnick wsl --version shows default Ubuntu 2. my desktop is win10, and my laptop is win11. before this, the update function of win10 was shutted down on my desktop, so maybe that's why though my wsl version is WSL2, but some latest functions are still limited(just a guess).

if there's a new one I just uninstall the one I have installed and install a new one from the .msi file (previously the .msixbundle file).
this is exhausting(>_<)

Finally this problem is gone, again thanks for giving me those useful advices, especially the principle ones. Hope the problem on your WSLg to be fixed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants