Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.

"Quick Set" button and other mapping buttons causing MIT-MAGIC-COOKIE-1 segmentation fault on Ubuntu 18.10. #39

Closed
a-l-e-x-d-s-9 opened this issue Oct 27, 2018 · 10 comments
Labels
bug Something isn't working

Comments

@a-l-e-x-d-s-9
Copy link

The profiles from antimicro (2016 version) are working fine with all the mapped buttons.
But when I try to chance the mapping to most of the buttons, by clicking on "Quick Set" or "A:" or "B:" and other buttons, antimicro crashes with this output in the terminal: "Invalid MIT-MAGIC-COOKIE-1 keySegmentation fault (core dumped)".
Buttons that are working as expected: L Trigger, R Trigger, L stick, R stick, Dpad.
Other buttons, for example: Controller Mapping, Properties and Key Checker, are working too.
Tested with the gamepad "Steelseries Stratus Xl" on Ubuntu 18.10 amd64.
I searched for some workarounds but found nothing that helped.

@juliagoda
Copy link
Owner

The profiles from antimicro (2016 version) are working fine with all the mapped buttons.

So you are trying to import a profile that is 2-years old? If I understand correctly? If that's the case, then could you send me the profile file by email?

@a-l-e-x-d-s-9
Copy link
Author

It's not a problem related to old profiles, even with a brand new profile it behaves the same way, mainly crashes with MIT-MAGIC-COOKIE-1 error when clicking on any regular button.
The version from 2016 works fine.
I recorded what's happening, so you can see yourself, the first part to show buttons that are working fine, then a few examples of buttons that crash the software (basically all buttons with "NO KEY" ): video.

@juliagoda
Copy link
Owner

How is it working now? By the way I hope that you are not using sudo privileges during execution

@a-l-e-x-d-s-9
Copy link
Author

It's working without crashing now (and I do not use "sudo" to execute), although it still prints the message "Invalid MIT-MAGIC-COOKIE-1 key" in the terminal.
Thank you!

@juliagoda
Copy link
Owner

I've found some sites with explanations:

iwf1.com
Slopjong.de
Ubuntu forum
Linux Questions

Probably:

Most of the resources you may encounter will advise you to simply delete the ~/.Xauthority file in home folder in order for the problem to disappear.

@a-l-e-x-d-s-9
Copy link
Author

I've seen a few of these links before. But I don't execute the antimicro with "sudo", and there is no ".Xauthority" file in my home folder.
I followed the suggestions from here but it did nothing for me.
I think it's related to my DISPLAY being ":1" and not ":0". I have no idea why only the key mapping window is bothered by it.

@juliagoda
Copy link
Owner

the window is bothered by it because of the lines of code in src/keyboard/virtualkeyboardmousewidget.cpp:

Display *dpy = XOpenDisplay(":0"); // default display
if (dpy == nullptr) dpy = XOpenDisplay(X11Extras::getInstance()->getEnvVariable("DISPLAY")); // if default display is not :0, then find current display reading env variable from system - (echo $DISPLAY)
XKeyboardState x;
XGetKeyboardControl(dpy, &x);
XCloseDisplay(dpy);
return x.led_mask & 2;

I needed it to know, if numlock is activated or not for keyboard. I haven't found better solution for Linux so far. If you really want to know the reason, you can change ":0" to ":1" and compile it again.

@a-l-e-x-d-s-9
Copy link
Author

I see. Unfortunately, I can't suggest a better solution. Thanks for solving the crashing!

@juliagoda
Copy link
Owner

but maybe the problem is related to first attempt with ":0" in the code, so I will remove the first line and you can see again, it it's still appearing

@juliagoda juliagoda added the bug Something isn't working label Oct 29, 2018
@a-l-e-x-d-s-9
Copy link
Author

Yes, the latest commit works fine, without any warnings.
Keep up the good work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants