-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
pressing key with multiple pressed keys #46
Conversation
server/internal/xorg/xorg.c
Outdated
} | ||
} else { | ||
code = searchItem(key); | ||
deleteItem(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting is doing inside the same operation, that searching. That might be joined in one operation (e.g. pop) when you find it, you delete it and return it.
hmm, it now works. I removed the list because it was only used to keep track of pressed keys, which seemed unnecessary? perhaps the Every key i tested worked as expected, but there is still one bug, which I cannot pinpoint yet. By hitting |
Bug input
Normal input
|
OK. Possible memory leak if he keeps releasing the key outside of neko. |
That memory leak is guarded by go. Every keydown is stored in map. That is periodically checked and keydowns older that 10s are automatically released. |
Just noticed, CTRL+C and CTRL+V (maybe all of them) are not working? |
It looks like after a bunch of crashes some keys are hanging unreleased, what causes CTRL+ not working. I am able to reproduce panic with constant typing while pressing and releasing Shift key. |
I was able to reproduce it once. |
Tried it. Same for me, I can no longer reproduce it. Weird, there must be some data race happening, that never occures when the key is found early. |
My guess would be, since the error is in malloc.c (https://fossies.org/linux/glibc/malloc/malloc.c Line 3964) and hints dirty memory, that there were race conditions which lead to The whole reason behind the |
That is true. Now i realized, |
I faced some weird bug. While loop was stuck and looping forever, taking 100% of CPU and neko was not usable. There might be problem with thread concurrency. Or similar stuff. Was not able to replicate it again, I'm trying. |
I hoped that the A quick and dirty fix would be to break all |
I thought about it, giving it some maximum would be at least some insurance. But as you said, go should guarantee thread safety by adding mutexes. I am doing another tests, and want to see if this bug was only caused somehow by my previous tests or not. |
There are already mutexes in the go part. https://github.com/m1k1o/neko/blob/dev/server/internal/xorg/xorg.go#L96 |
I am not able to reproduce it at all. It must have been some weird edge case after bunch of tests. I am not even sure, if that caused infitine loop or simply xorg crashed in a bad way comsuming 100% of my cpu with some proccess. I realized, that function you took from tigervnc PR has been changed meanwhile since 2017 in master. We should probably take the latest version: https://github.com/TigerVNC/tigervnc/blob/0946e298075f8f7b6d63e552297a787c5f84d27c/unix/x0vncserver/XDesktop.cxx#L343-L379 It might adress some hidden issues we would face later. |
Thanks for your changes, that looks good. But I think that code is perfectly fine, and print that should never be reached. It must have been error on my side, problem with my setup or some different bug when trying that. Otherwise I can't explain that. |
I just changed mostly variable / function names. Since they are not contiained in one C file, but apparetnly are shared throughout all linked C files to neko, wanted to make them explicit. Also I joined xearching & deleting to single function. |
First try, still crashes bit seems to work as expected otherwise.