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

System freeze #3733

Closed
shumvgolove opened this issue Feb 19, 2019 · 35 comments
Closed

System freeze #3733

shumvgolove opened this issue Feb 19, 2019 · 35 comments

Comments

@shumvgolove
Copy link

While sway-1.0-rc2 works perfectly, sway-1.0-rc3 freeze the entire system on sway launch. My system has no logind support, so after compiling sway I have suid the sway binary.

Configuration

  • sway-1.0-rc3

  • wlroots (Feb 20 2019, branch 'mastrer')

  • Void GNU/Linux (Musl)

@emersion
Copy link
Member

Can you upload debug logs?

@shumvgolove
Copy link
Author

shumvgolove commented Feb 19, 2019

Weird. Debug log shows only XDG_RUNTIME_DIR is not set in the environment. Aborting. although in .bash_profile i had set it up:

if test -z "${XDG_RUNTIME_DIR}"; then
    export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
    if ! test -d "${XDG_RUNTIME_DIR}"; then
        mkdir "${XDG_RUNTIME_DIR}"
        chmod 0700 "${XDG_RUNTIME_DIR}"
    fi
fi

EDIT: Sorry for my stupidity, I was running sway with sudo, because running sway without sudo just hangs my system and sway.log shows nothing. I thought I was doing something wrong here.

@julio641742
Copy link

Did you add your user to the video group?
I use the same configuration and the system used to freeze until I added the XDG_RUNTIME_DIR env, sudo chmod a+s /usr/bin/sway the binary and added myself to the video group. Hope this helps.

@shumvgolove
Copy link
Author

Yep, my user in the video and input groups and as I said early sway-1.0-rc2 works fine.

@RedSoxFan
Copy link
Member

In sway 1.0-rc3, sway will abort and show that error before the display is even created so it shouldn't be freezing the system even when XDG_RUNTIME_DIR is not set.

Can you try env XDG_RUNTIME_DIR=/tmp sway -d 2>sway.log from a TTY and see what gets logged?

@shumvgolove
Copy link
Author

shumvgolove commented Feb 20, 2019

Running sway from TTY immediately hangs my system and after a reboot there was nothing recorded in the logs.

I have tried env XDG_RUNTIME_DIR=/tmp sway -d 2>~/sway.log and then manually export XDG_RUNTIME_DIR=/tmp and sway 2>~/sway.log

@asegarra
Copy link

Did you try running with ConsoleKit and DBus ?

@shumvgolove
Copy link
Author

Still hangs my system.

@asegarra
Copy link

asegarra commented Feb 20, 2019

Perhaps you should take a step back, remove suid, don't use sudo and start sway with exec ck-launch-session dbus-launch --sh-syntax --exit-with-session sway -d 2> ~/sway.log

EDIT: My bad, looks like you do need to suid if you don't have logind and I no longer see that there's a requirement for dbus, sorry it's been a while since I tried sway. Disregard.

@shumvgolove
Copy link
Author

No problems.

@gg-rewrite
Copy link
Contributor

gg-rewrite commented Feb 21, 2019

sway.log
Having the same issue.

sway and wlroots freshly built from git. wayland-protocols-git from AUR. Attached is the result of launching sway with set up XDG_RUNTIME_DIR as per comment above

I suspect the main culprit is the last line about an undefined symbol, which is also shown when sway is launched within X session.

@Emantor
Copy link
Contributor

Emantor commented Feb 21, 2019

Update to latest wlroots, this was recently added and needs an up to date version. It is also advisable to remove already installed versions of wlroots (i.e. from repos or even the aur packages) and build it as subproject within sway. A stable sway experience on the master branch requires wlroots from its master branch as well.

@gg-rewrite
Copy link
Contributor

Update to latest wlroots, this was recently added and needs an up to date version. It is also advisable to remove already installed versions of wlroots (i.e. from repos or even the aur packages) and build it as subproject within sway. A stable sway experience on the master branch requires wlroots from its master branch as well.

Just did. Same result.

Just in case, here are my steps:

  1. Clone sway master branch.
  2. In the cloned directory, create a subdriectory subprojects.
  3. Go to subprojects/, clone wlroots master branch.
  4. Back in sway directory, do meson build / ninja -C build / sudo ninja -C build install. (as far as I see the command builds and installs wlroots too)
  5. env XDG_RUNTIME_DIR=/tmp sway -d 2>sway.log
  6. Same output.

@Emantor
Copy link
Contributor

Emantor commented Feb 21, 2019

Do you have an old version of wlroots-git installed? Maybe a dependency of an earlier swayidle-git or swaylock-git package? Or maybe the wlroots package which is in community as an dependency of another package?

@gg-rewrite
Copy link
Contributor

Do you have an old version of wlroots-git installed? Maybe a dependency of an earlier swayidle-git or swaylock-git package? Or maybe the wlroots package which is in community as an dependency of another package?

In fact I did and entirely forgot about it. After removing community package I recompiled everything and it's working now.

Thank you for your support and my apologies for misunderstanding.

@shumvgolove
Copy link
Author

shumvgolove commented Feb 28, 2019

After further testing, sudo setcap cap_sys_admin=eip /usr/local/bin/sway also leaves my system in unresponsive state.

@emersion
Copy link
Member

Can you retrieve logs via SSH?

@shumvgolove
Copy link
Author

shumvgolove commented Feb 28, 2019

Yes, I was able to retrieve logs via SSH, thanks for your help.

sway.log

@RedSoxFan
Copy link
Member

Since the log looks truncated, I'm guessing Sway is crashing and the direct session is not cleaning up properly.

Can you please send a full backtrace? Since you aren't using systemd, you'll have to enable core dumps, reproduce, and without rebooting (so probably via another SSH session) run gdb -q /path/to/sway -c /path/to/coredump followed by bt full.

To enable core dumps, you can try running ulimit -c unlimited. If that doesn't work, you'll have to edit /etc/security/limits.conf, raise the core hard limit, and try again. As for the location, you should be able to find the pattern used with cat /proc/sys/kernel/core_pattern

@shumvgolove
Copy link
Author

shumvgolove commented Mar 2, 2019

Unless I am doing something wrong, I'll write down steps that I have completed.

  1. git clone https://github.com/swaywm/sway
    git clone https://github.com/swaywm/wlroots
  2. Compiled both of them.
  3. sudo chmod a+s /usr/local/bin/sway
  4. echo "kernel.core_pattern = /tmp/core_%e.%p" | sudo tee /etc/sysctl.conf in order to change where core dumps will be saved.
  5. sudo sysctl -p to apply changes.
  6. sudo vim /etc/security/limits.conf and added line *my username* hard core unlimited
  7. Rebooted.
  8. Lauched sway.
  9. Connected via SSH.

And there is nothing under /tmp folder. Only 1000-runtime-dir which is created by my .bash_profile

Can anyone reproduce to confirm that issue is either from my side or not?

@emersion
Copy link
Member

emersion commented Mar 2, 2019

Can you have a look at dmesg to see if sway has crashed at all?

@shumvgolove
Copy link
Author

Finally I've got something.

dmesg.log

@RedSoxFan
Copy link
Member

RedSoxFan commented Mar 2, 2019

It doesn't look like that dmesg snippet has anything to do with sway. Since it looks like I was wrong and sway is not crashing, the next step is to figure out where it is freezing.

My guess is somewhere in spawn_swaybg. Can you try https://github.com/RedSoxFan/sway/tree/spawn-swaybg-debug-log and post what the last line of the debug log is? If it is spawn_swaybg successful, then I'm wrong again and it may be easier to find the freeze location with gdb

(Almost all of the calls in spawn_swaybg are non-blocking, but I added the log lines anyway)

@shumvgolove
Copy link
Author

shumvgolove commented Mar 2, 2019

I've got this while compiling sway:

ninja: Entering directory `build'
[4/268] Generating sway-ipc.7 with a custom command.
FAILED: sway-ipc.7
/usr/bin/sh -c '/usr/bin/scdoc < ../sway/sway-ipc.7.scd > sway-ipc.7'
Error at 268:3: Tables cannot be indented
[13/268] Generating 'protocols/8998617@@client_protos@sta/xdg-shell-protocol.c'.
ninja: build stopped: subcommand failed.

@emersion
Copy link
Member

emersion commented Mar 2, 2019

Try building with meson build -Dman-pages=disabled

@shumvgolove
Copy link
Author

Thanks.

sway2.log

@RedSoxFan
Copy link
Member

RedSoxFan commented Mar 2, 2019

2019-03-02 21:47:09 - [sway/config/output.c:252] spawn_swaybg waitpid

Well that confirms my suspicion of it blocking on the waitpid, but I also don't see how it's possible. The child process forks again and immediately exits.

@shumvgolove
Copy link
Author

shumvgolove commented Mar 2, 2019

After testing it seems that commenting out output * bg ~/.config/sway/background.jpg fill in config file solves the problem of crashing sway. Setting back output * bg ~/.config/sway/background.jpg fill or output HDMI-A-3 bg ~/.config/sway/background.jpg fill output VGA-1 bg ~/.config/sway/background.jpg fill crashes sway again.

Is behaviour of swaybg changed since sway-1.0-rc2?

@RedSoxFan
Copy link
Member

Yes, we spawn swaybg differently now. See #3708. The new way is better and is the same way we have launched swaybar for a while. Just need to figure out the hiccup that is this issue.

As you found, you can use sway without a background until this is resolved

@RedSoxFan
Copy link
Member

Can you please try #3807?

@shumvgolove
Copy link
Author

Yep, this fixes the issue. Thanks!

@pixelherodev
Copy link

No problem, I needed my background too :)

@caiiiycuk
Copy link

caiiiycuk commented Dec 3, 2019

Have same issue. After starting sway my PC hangs, and only reboot helps. What I did:

sudo apt install sway
sway --version
sway version 1.2

Then logout and select sway session. When it's start I see i3bar with actual information and then PC hangs. i3-wm works fine. Unity on wayland/x works fine.

I tried to take some logs with this

exec ck-launch-session dbus-launch --sh-syntax --exit-with-session sway -d 2> ~/sway.log

but ck-launch-session not found.

--
Distro:

LSB Version:	core-11.0.1ubuntu1-noarch:printing-11.0.1ubuntu1-noarch:security-11.0.1ubuntu1-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 19.10
Release:	19.10
Codename:	eoan

Kernel: 5.3.0-24-generic
CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
GPU: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) (0x5916)
PC: Dell XPS 13
Output: 2 HDPI Monitors

@caiiiycuk
Copy link

@ddevault should I open new issue? Looks like my message was not seen for community.

@shumvgolove
Copy link
Author

Yeah, you need to open a new issue.

This issue is only related to musl-specific problem with swaybg. You're have Ubuntu, which uses glibc and on top of that maybe unrelated to spawning background at all.

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

No branches or pull requests

9 participants