Issue #2425 resolved

error during push operation

leRoux Cilliers
created an issue
** Mercurial version (2.4.2+20130203).  TortoiseHg version (2.7)
** Command: 
** CWD: C:\Windows\system32
** Encoding: cp1252
** Extensions loaded: 
** Python version: 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
** Windows version: sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1')
** Processor architecture: x64
** Qt-4.8.4 PyQt-4.9.6 QScintilla-2.7
Traceback (most recent call last):
  File "tortoisehg\hgqt\sync.pyo", line 417, in configChanged
  File "tortoisehg\hgqt\sync.pyo", line 441, in reload
  File "tortoisehg\hgqt\sync.pyo", line 1652, in __init__
RuntimeError: wrapped C/C++ object of type SyncWidget has been deleted

Comments (11)

  1. Steve Borho

    this was unrelated to the push. what happened was that thg's internal repository object noticed that one of its configuration files had changed, so it emitted a signal to all widgets which want to know of such things. The sync widgets are one of them.

    However, this particular sync widget was partially deleted (its workbench tab had been closed) and so it raised this error.

    The root cause of the error is that the raw Qt structures have been freed but their Python (PyQt) wrappers are still alive because Python's garbage collection system has not deleted them; nor removed those signal connections.

    So firstly, this is a harmless error that you can ignore, and secondly it is a known problem we're trying to fix (ensuring all our dialogs can be garbage collected correctly).

  2. Yuya Nishihara

    How to reproduce:

    1. run "incoming" (or something) in Workbench.
    2. while true; do touch .hg/hgrc; sleep 0.1; done
    3. close that tab.

    Without 1, this error does not happen.

  3. Yuya Nishihara

    sync: manage configChanged connection in C++ layer to avoid crash (fixes #2425)

    Because self.finishedfunc = finished makes circular reference, Python part of SyncWidget is not deleted immediately. So, configChanged() tries to create PathsModel with parent=self, but here self is half dead.

    This works around the problem by breaking up signal connection when C++ object is deleted. But still SyncWidget has a GC issue.

    → <<cset e7f9633a3369>>

  4. Log in to comment