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

detect and avoid creating clipboard loops #452

Closed
totaam opened this issue Nov 5, 2013 · 3 comments
Closed

detect and avoid creating clipboard loops #452

totaam opened this issue Nov 5, 2013 · 3 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Nov 5, 2013

Issue migrated from trac ticket # 452

component: core | priority: major | resolution: fixed

2013-11-05 08:23:17: totaam created the issue


If I shadow a display somewhere, then shadow again back to original display, I have created a loop... which creates havoc with the nested loop clipboard code:

Maximum recursion depth exceeded
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 451, in expire_delayed_region
    self.may_send_delayed()
  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 506, in may_send_delayed
    self.do_send_delayed_region()
  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 513, in do_send_delayed_region
    self.send_delayed_regions(*delayed)
  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 552, in send_delayed_regions
    log.error("send_delayed_regions: error processing region %s: %s", damage, e, exc_info=True)
  File "/usr/lib64/python2.7/site-packages/xpra/log.py", line 34, in <lambda>
    self.log(level, msg, *args, **kwargs))
  File "/usr/lib64/python2.7/site-packages/xpra/log.py", line 30, in log
    self.logger.log(level, msg, *args, **kwargs)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1218, in log
    self._log(level, msg, args, **kwargs)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1264, in _log
    fn, lno, func = self.findCaller()
  File "/usr/lib64/python2.7/logging/__init__.py", line 1225, in findCaller
    f = currentframe()
RuntimeError: maximum recursion depth exceeded

We should detect when the nesting level gets high, and disable the clipboard.

Preferably, we would also have a way to avoid getting in that situation in first place.

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 14:34:02: totaam commented


r4845 disables the clipboard temporarily when the level of nesting gets too high (needs backporting to v0.10.x).

r4847 does this more properly (see changelog message for details) and when the server detects the loop, the client should see:

clipboard toggled to False by the server, reason: probable clipboard loop detected

Last remaining issue: we show the clipboard icon in the tray because of pending requests... but when we disable the clipboard, this should be reset.

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 14:57:24: totaam commented


the tray icon issue is solved by r4850 (may get backported as it turned out to be small and simple). Closing.

@totaam totaam closed this as completed Dec 3, 2013
@totaam
Copy link
Collaborator Author

totaam commented May 18, 2015

2015-05-18 17:34:26: antoine commented


Related change in later versions: r7751.

The real long term solution is #812

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

No branches or pull requests

1 participant