Synergy-core: Server stops sending keyboard presses to client

Created on 3 Feb 2016  Â·  39Comments  Â·  Source: symless/synergy-core

My setup is a Mac Mini running OS X 10.10.5 and a laptop running Windows 10 both running Synergy 1.7.6. Mac Mini is acting as server.

Sometimes keyboard presses stops being sent entirely to the Windows machine. I can't seem to find the exact steps to reproduce. I tried restarting the Synergy client and service on the Windows 10 machine and also restarting it, which does not help. This leads me to believe it is the server side that has the issue.

Not sure how you restart the service on the mac side, but quitting Synergy does not seem to help, only a restart of the Mac does. I've started collecting a log with Debug info, so hopefully that can provide some info soon, as this happens approximately once a day or so.

bug

Most helpful comment

@Cheesebaron I found the following command, which can be run from the command line to check the status of IsSecureEventInputEnabled. No idea if this script actually works though.

osascript -l JavaScript << END_TEXT
while (true) {
  ObjC.bindFunction('IsSecureEventInputEnabled', ['bool', []]);
  console.log( $.IsSecureEventInputEnabled() ?
    "SecureEventInput is enabled" :
    "SecureEventInput is not enabled");
  delay(1);
}
END_TEXT

@mrasmus I think that the chrome with lastpass leaving secure input on is an edge case. From what my Googling has shown it tends to happen why you don't click the login button, but just type in the password and press enter.

All 39 comments

It seems to be related to #626 and #5176. Please have a look at those and let me know if they help

Not sure if it is the same. I just ran into the issue again. Enabled Debug2 logging and I get this when pressing keys:

[2016-02-09T11:12:29] DEBUG2: checking clipboard
[2016-02-09T11:12:29] DEBUG2: flags: 0
[2016-02-09T11:12:29] DEBUG2: writef(CALV)
[2016-02-09T11:12:29] DEBUG2: wrote 4 bytes
[2016-02-09T11:12:29] DEBUG2: writing secure socket:0x791448d0
[2016-02-09T11:12:29] DEBUG2: reading secure socket
[2016-02-09T11:12:29] DEBUG2: reading secure socket
[2016-02-09T11:12:29] DEBUG2: want to read, error=2, attempt=1
[2016-02-09T11:12:29] DEBUG2: msg from "7RSDK32": CALV
[2016-02-09T11:12:29] DEBUG2: msg from "7RSDK32": CNOP
[2016-02-09T11:12:29] DEBUG2: no-op from

On the client I get nothing exciting just:

[2016-02-09T11:15:02] DEBUG2: reading secure socket
[2016-02-09T11:15:02] DEBUG2: want to read, error=2, attempt=1
[2016-02-09T11:15:02] DEBUG2: msg from server: CALV
[2016-02-09T11:15:02] DEBUG2: writef(CALV)
[2016-02-09T11:15:02] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:02] DEBUG2: writef(CNOP)
[2016-02-09T11:15:02] DEBUG2: writing secure socket:0000000000B6EBF0
[2016-02-09T11:15:02] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:02] DEBUG2: writing secure socket:0000000000B6EBF0
[2016-02-09T11:15:05] DEBUG2: reading secure socket
[2016-02-09T11:15:05] DEBUG2: reading secure socket
[2016-02-09T11:15:05] DEBUG2: want to read, error=2, attempt=1
[2016-02-09T11:15:05] DEBUG2: msg from server: CALV
[2016-02-09T11:15:05] DEBUG2: writef(CALV)
[2016-02-09T11:15:05] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:05] DEBUG2: writef(CNOP)
[2016-02-09T11:15:05] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:05] DEBUG2: writing secure socket:0000000000B6EBF0
[2016-02-09T11:15:08] DEBUG2: reading secure socket
[2016-02-09T11:15:08] DEBUG2: reading secure socket
[2016-02-09T11:15:08] DEBUG2: want to read, error=2, attempt=1
[2016-02-09T11:15:08] DEBUG2: msg from server: CALV
[2016-02-09T11:15:08] DEBUG2: writef(CALV)
[2016-02-09T11:15:08] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:08] DEBUG2: writef(CNOP)
[2016-02-09T11:15:08] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:08] DEBUG2: writing secure socket:0000000000B6EBF0
[2016-02-09T11:15:11] DEBUG2: reading secure socket
[2016-02-09T11:15:11] DEBUG2: reading secure socket
[2016-02-09T11:15:11] DEBUG2: want to read, error=2, attempt=1
[2016-02-09T11:15:11] DEBUG2: msg from server: CALV
[2016-02-09T11:15:11] DEBUG2: writef(CALV)
[2016-02-09T11:15:11] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:11] DEBUG2: writef(CNOP)
[2016-02-09T11:15:11] DEBUG2: writing secure socket:0000000000B6EBF0
[2016-02-09T11:15:11] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:11] DEBUG2: writing secure socket:0000000000B6EBF0
[2016-02-09T11:15:14] DEBUG2: reading secure socket
[2016-02-09T11:15:14] DEBUG2: reading secure socket
[2016-02-09T11:15:14] DEBUG2: want to read, error=2, attempt=1
[2016-02-09T11:15:14] DEBUG2: msg from server: CALV
[2016-02-09T11:15:14] DEBUG2: writef(CALV)
[2016-02-09T11:15:14] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:14] DEBUG2: writef(CNOP)
[2016-02-09T11:15:14] DEBUG2: writing secure socket:0000000000B6EBF0
[2016-02-09T11:15:14] DEBUG2: wrote 4 bytes
[2016-02-09T11:15:14] DEBUG2: writing secure socket:0000000000B6EBF0

I can't find a line indicating where it fails. It just stops sending any keystrokes to the client.

I've noticed. A lot of time after keyboard stops working and I restart my server the client on the Windows machine just refuses to start again. The service just wont start.

This is what I get from the event log:

Faulting application name: synergyd.exe, version: 0.0.0.0, time stamp: 0x568ab5de
Faulting module name: synergyd.exe, version: 0.0.0.0, time stamp: 0x568ab5de
Exception code: 0xc0000409
Fault offset: 0x0000000000015c93
Faulting process id: 0x5604
Faulting application start time: 0x01d164d4638656d8
Faulting application path: C:\Program Files\Synergy\synergyd.exe
Faulting module path: C:\Program Files\Synergy\synergyd.exe
Report Id: 5dbe182f-487a-4042-8eb9-c29aa1aeb2cf
Faulting package full name: 
Faulting package-relative application ID: 

@XinyuHou do you need more data to track down this? If so please tell me what you need.

I'm also having this issue and my logs look similar. Mac OSX 10.11 server and win7 client. One thing to add though, the control, option and command keys DO work on the client. The logs on the server look like this:

[2016-02-11T15:43:57] DEBUG1: event: Key event kind: 12, keycode=54
[2016-02-11T15:43:57] DEBUG1: mask=100110 outMask=0010
[2016-02-11T15:43:57] DEBUG1: new mask: 0x0010
[2016-02-11T15:43:57] DEBUG1: onKeyDown id=61419 mask=0x0010 button=0x0038
[2016-02-11T15:43:57] DEBUG1: send key down to "client" id=61419, mask=0x0010, button=0x0038
[2016-02-11T15:43:57] DEBUG2: writef(DKDN%2i%2i%2i)
[2016-02-11T15:43:57] DEBUG2: wrote 10 bytes

I have checked my keyboard mappings and they are both "U.S." I've also tried restarting both machines as this has fixed the issue for a short time before. However, now a restart does not solve the problem.

I also saw this in the logs after one server restart. This block repeated itself 20 or so times:

[2016-02-11T15:43:41] DEBUG1: mask=0e00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0200 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0400 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0600 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0e00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0800 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0e00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0a00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0c00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0e00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0a00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0000 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0e00 outMask=0000
[2016-02-11T15:43:41] DEBUG1: mask=0000 outMask=0000

@Cheesebaron

Could you please send us the whole logging as a file?

"want to read, error=2, attempt=1" this is normal when use SSL.

"Faulting application name: synergyd.exe", this seems a service crash problem, which is extremely difficult to debug. Logging probably won't help much either. If you find any reliable reproduce steps, that would be really helpful. I think when we investigate the keyboard problem, we will encounter the service issue as well. I will add more information later.

I don't see anything that sticks out when this happens in the log file. Problem is also when running with Debug1/Debug2 it acts as a keylogger, and I really don't want you to reproduce all the naughty words I am writing :smile:

I pinpointed my issue to Lastpass plugin in Chrome. Based on this thread https://github.com/symless/synergy/issues/2846
Lastpass most definitely causes this issue. I can sometimes get everything working even with LastPass signed in, but after a clean reboot of both machines, logging into LastPass will cause the issue.

I do use LastPass in Chrome. I am not back to my Synergy setup until Monday again, but I will see if that is actually the issue.

OK. Tested by logging into Lastpass in Chrome and boom, keyboard stops working.

Interesting. I guess Lastpass installs some low level hooks that are conflict with Synergy.

I've experienced similar symptoms with 1Password Helper in Safari. I believe it's related to "Secure Input" in OS X.

I figured this out as TextExpander stops working at the same time Synergy stops working on client machines, and TextExpander gives a status noting that Safari is preventing it from working due to Secure Input being enabled, after using 1Password to fill in a form. Restarting Safari restores functionality to TextExpander and Synergy (client machines).

More info here: https://smilesoftware.com/textexpander/secureinput

Having the same issues here, as soon as I Sign In to lastpass on chrome my keyboard stops working on the client PC. Has anyone found a quick fix for this yet?

I'm on the latest version of synergy 1.7.6 by the way.

@XinyuHou I was looking into this with @mrasmus on IRC, and it looks like this is caused Secure Event Input. There is a technical note from Apple on the usage of this. Text Exapnder encounters the same issue. They discuss a little about what they did on their website.

Synergy could probably solve this by checking IsSecureEventInputEnabled periodically (maybe every 10 or 15 seconds). If secure event input is enabled, then do something to show the user, such as changing the icon and put a tooltip or something similar.

I don't have a Mac, so I can't really fix this, but I hope this info helps.

I want to double-check that it is, in fact, SecureEventInput's fault; the symptoms line up, but each time I've fixed it (this second time, by closing Chrome with LastPass, it seemed to free up the lock) I have been unable to reproduce -- launching Chrome again, and logging into LastPass, was insufficient to break keyboard capture. The next time I find it in the bad state, I'm going to check IsSecureEventInputEnabled myself to confirm the suspicion.

Can this value be read from the command line somehow? Or do I need to create a small app to dump this value?

@Cheesebaron I found the following command, which can be run from the command line to check the status of IsSecureEventInputEnabled. No idea if this script actually works though.

osascript -l JavaScript << END_TEXT
while (true) {
  ObjC.bindFunction('IsSecureEventInputEnabled', ['bool', []]);
  console.log( $.IsSecureEventInputEnabled() ?
    "SecureEventInput is enabled" :
    "SecureEventInput is not enabled");
  delay(1);
}
END_TEXT

@mrasmus I think that the chrome with lastpass leaving secure input on is an edge case. From what my Googling has shown it tends to happen why you don't click the login button, but just type in the password and press enter.

@legonigel: Crazy. I would've never though on checking LP for this.

Issue affects the LP extension in Safari as well. Disabling the extension works here as well.

Re-enabling it keeps SecureEventInput disabled until you click the LP icon again.

Finally I see why this is happening to me on my Mac 10.12.1. I have to quit 1Password for the keyboard to work again. Is a fix needed on the 1P side or the Synergy side?

Just narrowed down this problem to 1Password Mini as well… I have a feeling this issue is on Synergy's side though, as I've seen it occur in other apps that don't have any interference from 1Password (e.g. Adobe Premiere). My guess, as others have pointed out, it's a problem between Synergy and SecureInput…

synergys: W10 AU (1.8.5)
synergyc: macOS 10.12 (1.8.5)

This is not an issue with how synergy handles secure input, but with how applications use secure input. If the application does not release secure input, there is nothing synergy can do. I only recommend that synergy try to detect this and alert the user, but there is no fix on synergy's side to recover from this.

Could someone run the shell script I put above to test this and verify the issue is secure input? I don't have a Mac to test this.

This happens on Mac 10.12.1 simply by opening Safari Preferences, going to the Passwords tab and entering your password. That's all it takes to kill Synergy until you exit out of Safari.

Like this has been a known bug for 9 months. Can you maybe prioritize this a bit higher?

@legonigel's script was really useful to debug it.

For me, I had a window (https://github.com/jiahaog/nativefier app) in the background that had a password field focused. When I focused the window and then unfocused the window, it removed the lock. Maybe this helps someone...

@legonigel this has happened 4 times last week and then just happened again for me.
All the times it's happened I've tried the script and verified it is IsSecureEventInputEnabled every single time. After restarting my macbook everything works again.

I'm guessing this is caused on my end my 1Password in Chrome.

If IsSecureEventInputEnabled is true, that means there is an issue with another app, not with Synergy.

The only thing I recommend to the developers is to show this in the synergy icon to tell the user that synergy is unable to capture keystrokes.

Do you know of anything that can be run as sudo to release the current app from holding IsSecureEventInputEnabled?

Maybe someone from the Synergy team could get in contact with 1Password and LastPass as they seem to be the main culprits and you'll be able to explain the issue a little more than a user.

I can confirm the bug of losing keyboard but mouse still works on two OSX sytems 10.11.6 (client/server) with latest version of synergy 1.8.8. The issue disappears when I close Google Chrome 56.0.2924.87 (64-bit) on the server. Happens also from same OSX server to both a Windows 7 and Windows 10 client - with the same closing Google Chrome on the server to fix it.

Resolved the issue by unchecking the Synergy box in the Accessibility menu within Security & Privacy within System Preferences, quitting Synergy, and then re-checking the box, reopening Synergy.

This has happened to me a couple of time. Turns out I have the Terminal app open on my Mac without an open window. When I finally figure it out again, I close Terminal on my the Mac and the keyboard starts magically working again to the PC. One of these days I will learn.....

I had this happen today. The script above helped me isolate it. I locked the screen and unlocked it and everything worked again. I think I may have caused this by attempting to use my keyboard on my other system while the system running Synergy server was locked.

It happen to me today. I'm with two Macs (one server and one client), and on both I have Chrome opened with LastPass plugin active. Every day I just lock them until the next day (some days I quit Synergy on both computers, some days I just leave them running), and after several days without problems, when I sat to work today only mouse was working on the client. After all, literally just lock and unlock the server's computer solved the issue, immediately.

Macs: 10.15.4
Chrome: 81
Synergy: 1.11.1

Having the same issue. Was a solution found?

What I've done so far:

  1. Rebooted both machines.
  2. Uninstalled Synergy
  3. Reinstalled Synergy

What i'm using
Both server and client using Synergy version 1.11.1

_Server_ = MacBook Pro macOS High Sierra 10.13.6

_Client_ = MacBook Pro macOS Catalina 10.15.5

I resolved my issue after disabled all autofill options in Safari's preference.

I have also recently installed the LastPass browser extension in chrome. Confirming that locking and unlocking server on macOS vs Windows 10 client solved the issue. Thanks, @rmdrabach!

Just a note that the latest version of the Signal Desktop App (5.2.0) on MacOS causes problems as well as soon as you select the text input in a conversation. SecureEventInput is on a Synergy can't send keys until you kill Signal. Thanks @legonigel for the script to help confirm this.

SYNERGY-1017

@grantbob Signal 5.2.1 appears to solve the issue

FOUND IT! This has been driving me nuts for months. Mac server, various hosts (mostly Mac or Linux based). Things will work great for days or weeks then randomly lock up. Mouse works fine, keystrokes stay at the server. I'm not running any of the password management apps or browser extensions mentioned above.

Fastest fix is to log out of the current synergy server's Mac OS session (Apple icon, Log Out). Or 'sudo pkill -f loginwindow' because for some reason there is a login window open in memory that is expecting input. This, obviously, logs you out and kills the synergy server. Logging back in and restarting synergy restores everything to beautiful workng order.

Thanks to @motopete for the TextExpander idea. i installed it and it immediately found an issue with secureinput related to 'loginwindow' (https://textexpander.com/secure-input/#loginwindow)

Thanks to @legonigel for the secureinput script. Paste it into a file called 'secureinputtest' and then 'chmod +x secureinputtest' to allow it to execute. This was a great tool to confirm that -something- was holding the input on the synergy server.

I'll figure out some way to cause the issue again and then hopefully resolve it with a script, without having to log out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jenelcohen picture jenelcohen  Â·  4Comments

spacepluk picture spacepluk  Â·  5Comments

Celant picture Celant  Â·  4Comments

martindale picture martindale  Â·  5Comments

xmstspider picture xmstspider  Â·  4Comments