Opened 13 years ago
Closed 13 years ago
#167 closed defect (fixed)
pynotify corrupted double-linked list?
Reported by: | Antoine Martin | Owned by: | Antoine Martin |
---|---|---|---|
Priority: | major | Milestone: | 1.0 |
Component: | Global | Keywords: | |
Cc: |
Description (last modified by )
I have seen this sort of crash before (usually on shutdown with control-C), but this seems to happen during runtime which is more problematic...
The original bug (was on the wrong tracker) says this happens on clicking "Apply" in the options window (I assume the main 'Configuration' dialog - not the server options?).
I first thought that this was due to pybonjour, but the backtrace also seems to point to pynotify (and gio/dbus) - maybe we need an idle_add
call on the notify path?
Attachments (5)
Change History (19)
Changed 13 years ago by
Attachment: | report.txt added |
---|
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Owner: | changed from Antoine Martin to Antoine Martin |
Status: | new → accepted |
Summary: | pybonjour corrupted double-linked list → gio corrupted double-linked list |
comment:2 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 13 years ago by
Summary: | gio corrupted double-linked list → pynotify corrupted double-linked list? |
---|
Please try the attached patch and let me know if that fixes it.
I think pynotify may be broken when used from within the gtk main loop - no idea why.
Using dbus directly (which is the underlying mechanism) seems to fix this problem.
Changed 13 years ago by
Attachment: | winswitch-dbus-notifications.patch added |
---|
use dbus for notification ahead of pynotify
comment:5 Changed 13 years ago by
I can reproduce that with debian testing/unstable.
ii winswitch 0.12.6-1 Tool to start and control remote sessions, ii xpra 0.0.7.30+dfsg-1 tool to detach/reattach running X programs
# uname -a Linux cacao 3.1.0-1-amd64 #1 SMP Thu Nov 3 19:35:59 UTC 2011 x86_64 GNU/Linux
comment:6 Changed 13 years ago by
Does the patch fix the problem? (you will need dbus-glib and dbus-python installed, probably are already)
comment:8 Changed 13 years ago by
Data above is after patching, when going into the configuration and unchecking the "start local server" flag => apply.
comment:9 Changed 13 years ago by
Hah, this latest stacktrace now points to pybonjour and not py-notify..
Until I find a way to fix this, you should be able to workaround this particular crash by completely disabling mdns:
mdns_listener=False
in .winswitch/client/client.conf
and:
mDNS_publish=False
in .winswitch/server/server.conf
I would be very interested to hear if you still get the crash with/without the winswitch-dbus-notifications.patch
patch above as this would give me a clear indication as to whether this is going in the right direction or not.
comment:10 Changed 13 years ago by
Without the patch I get this:
*** glibc detected *** /usr/bin/python: malloc(): smallbin double linked list corrupted: 0x000000000376da70 ***
When disabling mnds, it works, and the patch makes no difference.
comment:11 Changed 13 years ago by
The dbus notification patch was accidentally applied as part of r4479 (oops)... Will test this further on all the platforms that use pynotify/dbus. Not reverting since I think it is worth having already as it reduces the glibc corruptions I have seen on shutdown.
The next part is to replace pybonjour (which is unmaintained...) with a dbus approach, at least for *nix platforms that have avahi/dbus.
Basically going back to the approach that existed in versions up to ~ 0.8.x
: use avahi if present and fallback to pybonjour if not (osx, win32, ..)
Some pointers:
- r1626 removed the old avahi code, may re-instate some of those classes..
- twisted + dbus ticket with sample code
- python + avahi/dbus example code
- more example code
comment:12 Changed 13 years ago by
r4481 re-instates the avahi bindings and seems to get rid of the double linked list corrupted
issue here (although I was only seeing it on control-C shutdown - not during normal use)
Please let me know if that fixes it for you so I can make a new release with this fairly important crash fix.
Still TODO:
- detect mdns_remove in avahi code (resolve_error?)
- tell dbus we are no longer listening when shutting down
- add python-avahi to deb/rpm dependency list
comment:13 Changed 13 years ago by
$ apt-get remove winswitch $ svn info ... Revision: 4481 $ sudo python setup.py build $ sudo python setup.py install ... byte-compiling /usr/local/lib/python2.7/dist-packages/winswitch/ui/notification_util.py to notification_util.pyc /usr/local/lib/python2.7/dist-packages/winswitch/ui/notification_util.py:148: SyntaxWarning: name 'haspynotify' is used prior to global declaration global haspynotify byte-compiling /usr/local/lib/python2.7/dist-packages/winswitch/ui/quick_connect.py to quick_connect.pyc
winswitch_applet does now run without the check mark at "start local server", even if MDNS is activated again. And: it starts much faster!
Thanks a lot.
comment:14 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Thanks for testing!
I will make a new release shortly with this fix.
crash report