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

crashing when pasting external or internal text on macOS #877

Closed
kjyv opened this issue Jun 12, 2019 · 4 comments
Closed

crashing when pasting external or internal text on macOS #877

kjyv opened this issue Jun 12, 2019 · 4 comments

Comments

@kjyv
Copy link
Contributor

kjyv commented Jun 12, 2019

Installed 0.71.1 using macports (with a modified Portfile), Gtk 3.22.30_1

The relevant output of zim --debug is the follwing:

DEBUG: Action: cut
DEBUG: Action: paste
DEBUG: Targets available for paste: [Gdk.Atom.intern("UTF8_STRING", False), Gdk.Atom.intern("public.utf8-plain-text", False)], we want parsetree
DEBUG: Requesting data for ('text/x-zim-parsetree', 0, 1) -- using set_with_data() workaround
Python(42098,0x1081065c0) malloc: *** error for object 0x92: pointer being freed was not allocated
Python(42098,0x1081065c0) malloc: *** set a breakpoint in malloc_error_break to debug
/opt/local/bin/zim: line 3: 42098 Abort trap: 6           XDG_DATA_DIRS=/opt/local/share:$XDG_DATA_DIRS /opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/zim $@

If any other debugging should be done please let me know.

@kjyv
Copy link
Contributor Author

kjyv commented Jun 12, 2019

I tried stepping through the code using a debugger and it seems the malloc error happens in clipboard.py:583

atoms = sorted(
		filter(lambda a: a and a.name() in PARSETREE_ACCEPT_TARGET_NAMES, atoms),
			key=lambda a: PARSETREE_ACCEPT_TARGET_NAMES.index(a.name())
		)

and if the text was copied within zim, it breaks at clipboard.py:580
return parsetree_from_selectiondata(selectiondata, notebook, path)

However it sometimes steps through and in some rare cases even successfully pastes the text. I guess this is some python bug that can not be fixed in zim?

@kjyv
Copy link
Contributor Author

kjyv commented Jun 12, 2019

This also happens if I update pygobject to version 3.32 using pip. It seems the error is related to c-interfacing code for freeing memory that is run when objects are garbage collected. I've assigned the filter call result to a different variable so the elements are not changed and added an explicit del(atoms) after it and it crashes there. Probably this is a bug in gobject then?

@kjyv
Copy link
Contributor Author

kjyv commented Jun 12, 2019

Added a bug report to pygobject here: https://gitlab.gnome.org/GNOME/pygobject/issues/337

@kjyv
Copy link
Contributor Author

kjyv commented Jul 31, 2019

Working fine again with gtk 3.24(.10).

@kjyv kjyv closed this as completed Jul 31, 2019
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

1 participant