{"action":"created","issue":{"url":"https://api.github.com/repos/libratbag/libratbag/issues/558","repository_url":"https://api.github.com/repos/libratbag/libratbag","labels_url":"https://api.github.com/repos/libratbag/libratbag/issues/558/labels{/name}","comments_url":"https://api.github.com/repos/libratbag/libratbag/issues/558/comments","events_url":"https://api.github.com/repos/libratbag/libratbag/issues/558/events","html_url":"https://github.com/libratbag/libratbag/issues/558","id":381140304,"node_id":"MDU6SXNzdWUzODExNDAzMDQ=","number":558,"title":"Request: MX Anywhere 2 support","user":{"login":"hexchain","id":529520,"node_id":"MDQ6VXNlcjUyOTUyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/529520?v=4","gravatar_id":"","url":"https://api.github.com/users/hexchain","html_url":"https://github.com/hexchain","followers_url":"https://api.github.com/users/hexchain/followers","following_url":"https://api.github.com/users/hexchain/following{/other_user}","gists_url":"https://api.github.com/users/hexchain/gists{/gist_id}","starred_url":"https://api.github.com/users/hexchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexchain/subscriptions","organizations_url":"https://api.github.com/users/hexchain/orgs","repos_url":"https://api.github.com/users/hexchain/repos","events_url":"https://api.github.com/users/hexchain/events{/privacy}","received_events_url":"https://api.github.com/users/hexchain/received_events","type":"User","site_admin":false},"labels":[{"id":252662079,"node_id":"MDU6TGFiZWwyNTI2NjIwNzk=","url":"https://api.github.com/repos/libratbag/libratbag/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-15T12:30:14Z","updated_at":"2018-11-26T02:20:01Z","closed_at":null,"author_association":"NONE","body":"I have tried to copy over the MX Master device file and changed device IDs:\r\n\r\n```\r\n[Device]\r\nName=Logitech MX Anywhere 2\r\nDeviceMatch=bluetooth:046d:b013\r\nDriver=hidpp20\r\nSvg=logitech-mx_master.svg\r\n```\r\n\r\nBut `ratbagd` keeps crashing after an error:\r\n```\r\nratbag error:     HID++ error from the device (255): ERR_INVALID_ARGUMENT (02)\r\n```\r\n\r\n```\r\n       Message: Process 27792 (ratbagd) of user 0 dumped core.\r\n                \r\n                Stack trace of thread 27792:\r\n                #0  0x000055cd4d00fd75 hidpp20drv_read_button_1b04 (ratbagd)\r\n                #1  0x000055cd4d00d574 ratbag_test_driver (ratbagd)\r\n                #2  0x000055cd4cff64e8 ratbagd_run_enumerate (ratbagd)\r\n                #3  0x00007f731ef8e223 __libc_start_main (libc.so.6)\r\n                #4  0x000055cd4cff66de _start (ratbagd)\r\n```\r\n```\r\n(gdb) bt\r\n#0  hidpp20drv_read_button_1b04 (button=0x55cd4ea27150) at ../src/driver-hidpp20.c:92\r\n#1  hidpp20drv_read_button (button=0x55cd4ea27150) at ../src/driver-hidpp20.c:249\r\n#2  hidpp20drv_read_profile (profile=<optimized out>) at ../src/driver-hidpp20.c:1006\r\n#3  hidpp20drv_init_device (drv_data=<optimized out>, device=0x55cd4ea20e20) at ../src/driver-hidpp20.c:1295\r\n#4  hidpp20drv_probe (device=<optimized out>, device=<optimized out>) at ../src/driver-hidpp20.c:1348\r\n#5  0x000055cd4d00d574 in ratbag_test_driver (test_device=0x0, dev_id=<optimized out>, driver_name=0x55cd4ea31e90 \"hidpp20\", device=<optimized out>) at ../src/libratbag.c:335\r\n#6  ratbag_assign_driver (test_device=0x0, dev_id=<optimized out>, device=<optimized out>) at ../src/libratbag.c:412\r\n#7  ratbag_device_new_from_udev_device (device_out=<synthetic pointer>, udev_device=<optimized out>, ratbag=<optimized out>) at ../src/libratbag.c:484\r\n#8  ratbagd_process_device (ctx=0x55cd4ea0c0b0, udevice=<optimized out>) at ../ratbagd/ratbagd.c:248\r\n#9  0x000055cd4cff64e8 in ratbagd_run_enumerate (ctx=0x55cd4ea0c0b0) at ../ratbagd/ratbagd.c:481\r\n#10 ratbagd_run (ctx=0x55cd4ea0c0b0) at ../ratbagd/ratbagd.c:517\r\n#11 main (argc=<optimized out>, argv=<optimized out>) at ../ratbagd/ratbagd.c:565\r\n```\r\n\r\nThe version of libratbag is 0.9.903."},"comment":{"url":"https://api.github.com/repos/libratbag/libratbag/issues/comments/441499680","html_url":"https://github.com/libratbag/libratbag/issues/558#issuecomment-441499680","issue_url":"https://api.github.com/repos/libratbag/libratbag/issues/558","id":441499680,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTQ5OTY4MA==","user":{"login":"whot","id":1487352,"node_id":"MDQ6VXNlcjE0ODczNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1487352?v=4","gravatar_id":"","url":"https://api.github.com/users/whot","html_url":"https://github.com/whot","followers_url":"https://api.github.com/users/whot/followers","following_url":"https://api.github.com/users/whot/following{/other_user}","gists_url":"https://api.github.com/users/whot/gists{/gist_id}","starred_url":"https://api.github.com/users/whot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whot/subscriptions","organizations_url":"https://api.github.com/users/whot/orgs","repos_url":"https://api.github.com/users/whot/repos","events_url":"https://api.github.com/users/whot/events{/privacy}","received_events_url":"https://api.github.com/users/whot/received_events","type":"User","site_admin":false},"created_at":"2018-11-26T02:20:01Z","updated_at":"2018-11-26T02:20:01Z","author_association":"MEMBER","body":"huh, yeah, you're right, this is garbage. The root of the issue is that `hidpp20_request_command` returns either a negative errno or a positive hidpp code but that bit gets lost before the code here which assumes a positive number is the number of controls.\r\n\r\nI think the best solution here is to check all callers of `hidpp20_request_command` and see if anyone actually cares about the positive error code. If not, then the easiest would be to switch that function to return `-EINVAL` for any hidpp errors and rely on the logs for the details of the error."}}
{"actor":{"display_login":"whot"}}