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

Crash when paired with multiple devices #53

Open
jameswestman opened this issue Jul 16, 2020 · 2 comments
Open

Crash when paired with multiple devices #53

jameswestman opened this issue Jul 16, 2020 · 2 comments

Comments

@jameswestman
Copy link

I'm running mconnect and I have it paired with multiple devices.

Steps to reproduce:

  • Run mconnect
  • Pair with Device A
  • Pair with Device B
  • So far, everything works
  • Restart the mconnect daemon
  • It crashes soon after startup

It looks like the reason for this is the MPRIS plugin. When the daemon starts, it connects to one device, which immediately sends it a kde.mpris.request packet. mconnect responds by sending a kde.mpris packet to all connected devices, including the one that isn't connected yet.

xxxserxxx added a commit to xxxserxxx/mconnect that referenced this issue Jun 7, 2021
This prevents the server from crashing when the mpris plugin tries to talk to devices that aren't (yet) connected.
@xxxserxxx
Copy link

@flyingpimonster @grimpy I'm going to submit a PR to address this.

On the one hand, server processes should be as robust as possible and try to recover; in that spirit, my patch prevents the server from segfaulting when a device isn't present. However, the root cause -- that the mpris plugin may be incorrectly propegating messages -- is not addressed. On the other-other hand, I don't know if it shouldn't be propegating messages; probably, the bestest, correctest fix would be to make mconnect smart enough to not try to send messages to devices that aren't connected, whether or not plugins ask for it, but that's a much bigger change. And, as I initially stated, philisophically, having servers that recover gracefully when they encounter error states is preferable, so this is at least a necessary, if not sufficient, fix.

I'ma copy/paste this is the PR, which will probably be ignored anyway.

xxxserxxx added a commit to xxxserxxx/mconnect that referenced this issue Jun 7, 2021
This prevents the server from crashing when the mpris plugin tries to talk to devices that aren't (yet) connected.
grimpy pushed a commit to grimpy/mconnect that referenced this issue Jun 7, 2021
… mpris plugin tries to talk to devices that aren't (yet) connected.
@grimpy
Copy link

grimpy commented Jun 7, 2021

@xxxserxxx thx for letting me know I applied it to my fork ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants