Skip to content

detect and avoid creating clipboard loops #452

Description

@totaam

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.

Activity

  1. totaam commented on Dec 3, 2013

    @totaam
    CollaboratorAuthor

    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.

  2. totaam commented on Dec 3, 2013

    @totaam
    CollaboratorAuthor

    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.

  3. totaam commented on May 18, 2015

    @totaam
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions