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

Synergy + Warp causes Xorg to crash #17

Closed
matheusfillipe opened this issue Jun 12, 2020 · 30 comments
Closed

Synergy + Warp causes Xorg to crash #17

matheusfillipe opened this issue Jun 12, 2020 · 30 comments
Labels
Feature Request wontfix This will not be worked on

Comments

@matheusfillipe
Copy link
Contributor

Already happened three times under KDE plasma only. I am not sure if its just warp's fault but when i launch it sometimes Xorg is crasing, right after the hints are displayed (yes when I launch it using hints mode).

It really makes all my applications crash the Xorg to restart.
This is a full crash report but probably only the Xorg part might interest you: 00EM9N6.txt\

I was a few comits behind and I report if this happens on the version I just got now.

Any idea why this might have happened? I am on Xorg 1.20-8-2 and KDE 5.19, and also happened on KDE 5.18.5. The problem is that this happens kinda randomly :/

@rvaiya
Copy link
Owner

rvaiya commented Jun 12, 2020

Please list the commit you have built from (and the output of warp -v in all future issues). I suspect the issue has something to do with teamviewer, can you try reproducing it both with and without teamviewer? Also confirm that it is still an issue in the latest commit, there have been a few bugfixes. The problem likely has something to do with the two programs competing for the xinput devices. If this is the case it is unlikely anything can be done to make warp cooperate with teamviewer but it should be possible to make it fail gracefully.

@rvaiya
Copy link
Owner

rvaiya commented Jun 12, 2020

Try pulling the latest commit and running

WARP_DEBUG_FILE=~/warp.dbg warpd

And include the contents ~/warp.dbg and /var/log/Xorg.0.log if you manage to reproduce the issue.

@matheusfillipe
Copy link
Contributor Author

Alright! Didn't happen again since I last updated. If it happens I will send you the logs.

@matheusfillipe
Copy link
Contributor Author

Happened on ubuntu with i3 and picom as compositor! I wasn't expecting this to happen so i didn't run it correctly to log the crash :P.... Didn't happen with plasma again so far.

The screen just went black after the hints showed up. Next time it happens now I will be ready.

@matheusfillipe
Copy link
Contributor Author

Happened on ubuntu!
Xorg.0.log

warp.log

@rvaiya
Copy link
Owner

rvaiya commented Jun 15, 2020

Thanks, the logs help a lot. Did you kill X manually after this happened or did it crash? In the first case you said it crashed in the second you mention that the screen 'went blank'. Is this the same problem you were experiencing before? Does it correlate with you plugging in or removing any input devices?

@matheusfillipe
Copy link
Contributor Author

Happened on plasma finally!

syslog_coredump.log
Xorg.0.log
warp.log

Thanks, the logs help a lot. Did you kill X manually after this happened or did it crash? In the first case you said it crashed in the second you mention that the screen 'went blank'. Is this the same problem you were experiencing before? Does it correlate with you plugging in or removing any input devices?

I didn't kill Xorg manually, it just restarts when this happens on both my machines, so is not correlated with any external device at all. Notice also that both machines are different (Ubuntu + i3 and arch = plasma) and is the same problem happening. The screen goes black and Xorg restarts.

The only application that I have in both machines is synergy. Maybe that's the issue?

@rvaiya
Copy link
Owner

rvaiya commented Jun 16, 2020 via email

@matheusfillipe
Copy link
Contributor Author

I'm using a session manager on both machines. I don't see any relation with anything I do on synergy that is triggering that at all. Synergy is always on on my both machines but it works with it on or not. In the i3 machine there is nothing plugged besides synergy client. On the plasma one there are many things plugged but I'm not ever changing anything.

I think there isn't much left on my: ~/.local/share/xorg/Xorg.0.log
Xorg.1.log
Xorg.1.log.old.log

@rvaiya
Copy link
Owner

rvaiya commented Jun 17, 2020

Did you copy the Xorg files immediately after the crash? (they get overwritten each time you restart xorg). I don't see any evidence of termination. I can't seem to reproduce the problem or find the root cause in the logs. I suspect something input related on your system is causing the issue (it is unlikely that it is truly random). See if you can figure out what is triggering it and consistently reproduce the issue.

@rvaiya
Copy link
Owner

rvaiya commented Jun 17, 2020

I've added some additional debug statements, please make sure you are running the latest version in the event that it happens again.

@matheusfillipe
Copy link
Contributor Author

Alright, I just updated on both machines. I couldn't find any pattern on this yet.

@rvaiya
Copy link
Owner

rvaiya commented Jun 20, 2020

I've updated some of the input logic for unrelated reasons. You should make sure you are running on the latest version. Have you encountered the issue again? Continuous X logs will help /var/log/Xorg.0.log and /var/log/Xorg.0.log.old are the files you probably want to upload.

@matheusfillipe
Copy link
Contributor Author

Weirdly the issue didn't happen again so far again in neither of my machines! Well I will pull the latest version but I suspect this is gone somehow.

@matheusfillipe
Copy link
Contributor Author

And is not working on ubuntu but working on arch. Really likely to be synergy's fault.

Just to make it clear arch is my main machine and synergy's server is on it, and ubuntu is on a old laptop which I use as a hacky secondary monitor with synergy client, in another words ubuntu is controlled by arch using synergy.

file:///home/matheus/tmp/warp.log

Whenever I hit an activation key synergy complains with:

Jun 20 19:09:41 Vostro Synergy 1.10.2: [2020-06-20T19:09:41] INFO: found key in group 0
Jun 20 19:09:44 Vostro Synergy 1.10.2: [2020-06-20T19:09:44] INFO: found key in group 0
Jun 20 19:09:45 Vostro Synergy 1.10.2: [2020-06-20T19:09:45] INFO: found key in group 0
Jun 20 19:09:45 Vostro Synergy 1.10.2: [2020-06-20T19:09:45] INFO: found key in group 0
Jun 20 19:09:46 Vostro Synergy 1.10.2: [2020-06-20T19:09:46] INFO: found key in group 0

Synergy also displays that for things like ctrl+shift+V, and many alt shortcuts so no idea if that matters.

I tried changing the shortcut, restarting, compiling older commits that were working, and now nothing makes it work again lol...

@matheusfillipe
Copy link
Contributor Author

Okay on the last commit after pluging the physical keyboard and unplugging it works normal again even from synergy but on the latest this doesn't fix it.

@rvaiya
Copy link
Owner

rvaiya commented Jun 21, 2020

And is not working on ubuntu but working on arch. Really likely to be synergy's fault.

From what you have written I assume X isn't crashing anymore.

file:///home/matheus/tmp/warp.log

I think you forgot to upload the log (The X logs would also help if you still have them
(probably /var/log/Xorg.0.log.old)

I tried changing the shortcut, restarting, compiling older commits that were
working, and now nothing makes it work again lol...

Have there been any configuration changes on your end?

Okay on the last commit after pluging the physical keyboard and unplugging it
works normal again even from synergy but on the latest this doesn't fix it.

I'm not sure what you mean by this. Are you saying hotplugging causes X to crash?

@matheusfillipe
Copy link
Contributor Author

warp.log
Ah this doesn't have nothing important I think anyway. X didn't crash again (so far), in both machines. Not sure if it is fixed but seems like.

The only problem is after the latest commit is that is not working over synergy. Which it was. If I hotplug it works. I haven't changed the configs, but I am still not sure if this is your fault or mine yet :P. Anyway that would be another subject but did you do something on this last one that would conflict with synergy's input or so?

I will still test for more days on my main machine and I will just close this issue if it doesn't happen again. But I really suspect synergy is fighting with warp for control somehow :P.

@rvaiya
Copy link
Owner

rvaiya commented Jun 21, 2020

I just exerimented with synergy and poked around the source. It looks like the two programs are fundamentally incompatible by design. Did this ever work? If you run warp on each machine and then try and activate something like hint mode it should only work on the server (and it will only work properly if the server screen is focused). Discrete mode might appear to work but that is only because it concerns itself with relative movements. Did you ever have all modes successfully running on synergy?

@matheusfillipe
Copy link
Contributor Author

Yes this worked on the client machine already! Yes when I run the keybinding for hints mode even if I'm focused on the client it triggers it on the host machine, but with a different shortcut it was working on the client machine as well just fine all the 3 modes.

I reverted to the commit 95f56f139fe5f863e138533a36e3362d9ef9800b when it was surely working all the tree modes with synergy but it didn't just work again either, but i was able to get them working after a system restart and many synergy resets and all the 3 modes just works again now.

On ea94b9020ec69dbcee152a97254156c4e1f96813 and beyond it doesn't work over synergy anymore.

Still not any Xorg crash so far though.

@rvaiya
Copy link
Owner

rvaiya commented Jun 21, 2020

Yes this worked on the client machine already! Yes when I run the keybinding for hints mode even if I'm focused on the client it triggers it on the host machine, but with a different shortcut it was working on the client machine as well just fine all the 3 modes.

What you describe is expected behaviour for 95f56f1. Unfortunately any compatibility was a bug, not a feature (see #3). The reason you had to map a separate hot key for each client is because synergy uses a higher level input mechanism than warpd. If the two mechanisms were compatible the same key would work seamlessly between screens. This approach was deliberately taken in order to facilitate use with a larger number of programs (mainly to support popup menus which grab the keyboard). A side effect of the design is that some keyboard oritented programs (mainly games and some accessibility tools) will be incompatible.

ea94b90 introduced a patch to the input system for stability which had the side effect of nuking any residual support for programs which simulate key events (including synergy). This was never intended to work in the first place.

There are some potential work arounds but they all involve trade offs and altering core functionality. You should still be able to use warpd, but only on the server (when it is focused). Anything else is unsupported.

@matheusfillipe
Copy link
Contributor Author

I understand why I would need to set a separate shortcut for working on the synergy client. Would be nice to have it working on this computer since I only use it through synergy but I understand if that this can be out of the scope of this project and was not even intended to work, but it works nice with ea94b90 which is impressive :P.

If it has a high trade off to make this work then better not. Or maybe we could have a synergy compatible mode or something? If that is doable.

@rvaiya
Copy link
Owner

rvaiya commented Jun 22, 2020

If it has a high trade off to make this work then better not. Or maybe we could
have a synergy compatible mode or something? If that is doable.

I might consider introducing an option to use standard X grabs in place of xinput ones assuming the user understands that it breaks popup menus but it would require some additional modifications to the input logic which I am too lazy to do at the moment.

@matheusfillipe
Copy link
Contributor Author

No worries! At your speed! This project is already amazing and useful :P. That mode would do it.

The Xorg crash didn't ever happen again so this issue could be closed.

@matheusfillipe
Copy link
Contributor Author

Just to point it out, the issue with Xorg crashing never happened anymore and it's been a week, so I guess was some rare race condition or something we might never now anyway. I suppose I should leave this open as being the feature request for the "External Virtual Input Sofwares Friendly Run Mode" ?

@rvaiya
Copy link
Owner

rvaiya commented Jun 27, 2020

Based on the logs you sent me and my own experiments I suspect synergy was causing the crash. The input patch probably indirectly solved the issue. If it happens again feel free to open another issue. I am closing this for now. I have created another issue for the associated feature request.

@rvaiya rvaiya closed this as completed Jun 27, 2020
@rvaiya rvaiya changed the title Crashing Xorg Crashing Xorg [Synergy] Jun 27, 2020
@rvaiya rvaiya changed the title Crashing Xorg [Synergy] Synergy + Warp causes Xorg to crash Jun 27, 2020
@rvaiya rvaiya added the wontfix This will not be worked on label Jun 27, 2020
@matheusfillipe
Copy link
Contributor Author

Not sure if the issue is related to synergy. It is back to me again sadly... warpd wasn't working then i killed and restarted it and when I triggered hints mode Xorg crashed making me lose some work :P

@matheusfillipe
Copy link
Contributor Author

One recent change I did was remaping caps lock to esc..... Didn't happen again so far.

@rvaiya
Copy link
Owner

rvaiya commented Jul 26, 2020 via email

@rvaiya
Copy link
Owner

rvaiya commented Aug 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants