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

Crash with asterisk before URL #29

Closed
awehler-gh opened this Issue Jul 14, 2016 · 9 comments

Comments

Projects
None yet
2 participants
@awehler-gh
Copy link

awehler-gh commented Jul 14, 2016

Hi.

pygtkspellcheck-4.0.4; Ubuntu 16.04; (context: zim 0.65)

Some text line with a pattern of the form below will lead to a crash when spell checking is active:
* https://github.com/koehlma/pygtkspellcheck/issues/22
Can you verify this? Thanks a lot.

Andreas

DEBUG: Action: toggle_spellcheck(True)
DEBUG: Spellcheck language: en_US
DEBUG: requesting name for code "de_AT"
DEBUG: requesting name for code "en_US"
DEBUG: requesting name for code "de_AT_frami"
DEBUG: requesting name for code "en"
DEBUG: requesting name for code "en_CA"
DEBUG: requesting name for code "en_GB"
/usr/lib/python2.7/dist-packages/gtkspellcheck/spellcheck.py:548: GtkWarning: /build/gtk+2.0-KsZKkB/gtk+2.0-2.24.30/gtk/gtktextbtree.c:4096: char offset off the end of the line
end = self._buffer.get_iter_at_line_offset(start.get_line(), match.end())

(zim:12457): Gtk-ERROR **: Char offset 56 is off the end of the line
Trace/breakpoint trap (core dumped)

@awehler-gh awehler-gh changed the title Crash with aterisk before URL Crash with asterisk before URL Jul 14, 2016

@awehler-gh

This comment has been minimized.

Copy link
Author

awehler-gh commented Jul 15, 2016

Hi.
More precise additional observations:
Spelling leads to a program crash (!) if (ANDed):

  1. line starts with "*" (asterisk) after optional spaces
  2. AND: continues with some URL
  3. AND: continues with EOL after optional spaces.

Or:

  1. line starts with some UTF-8 character (like caret) after optional spaces
  2. AND: continues with some URL
  3. AND: continues with EOL after optional spaces.

Spelling works if the URL is followed by some normal printable character.

Andreas

@koehlma

This comment has been minimized.

Copy link
Owner

koehlma commented Jul 16, 2016

I am unable to reproduce this with the example applications. Changing the language triggers a complete recheck and executes the code which causes this issue, however it works fine for me. Can you reproduce this using the examples or is it Zim specific?

Greetings,
Maximilian

@awehler-gh

This comment has been minimized.

Copy link
Author

awehler-gh commented Jul 16, 2016

Because there is an exception I thought the origin was pygtkspellcheck. Prior to reporting the issue here I've created also a bug report for zim: https://bugs.launchpad.net/zim/+bug/1598830

If there is some easy test I'm willing to contribute searching for the cause of the issue. I have to admit that I did not test the pygtkspellcheck example yet. Could you give a small recipe on how to do it? I've also not looked into the zim code for debugging this. In the worst case I'm willing to go deeper here also but would need some support.

Thanks for your efforts!

Andreas
a German living in Austria for now

@awehler-gh awehler-gh closed this Jul 16, 2016

@koehlma

This comment has been minimized.

Copy link
Owner

koehlma commented Jul 17, 2016

Clone the repository and execute the example examples/pygtk_large.py with Python 2. Then try to reproduce the issue. It might be caused by some buffer swapping or something else the examples do not cover, so I would not rule out an error in pygtkspellcheck itself.

Just to be sure, because I am a little bit confused by the error message […]/spellcheck.py:548 which suggests the error should be in line 548, which is not the case. Could you please double check the version which is actually used with:

>>> import gtk
>>> import gtkspellcheck
>>> gtkspellcheck.__version__ 
u'4.0.4'

Thanks.

Greetings,
Maximilian

@awehler-gh

This comment has been minimized.

Copy link
Author

awehler-gh commented Jul 17, 2016

Thanks for the help. And sorry for misleading versions.

Summary see: attached protocol.txt

Step 1: clone pygtkspellcheck 4.0.4
Step 2: run example
Step 3: (!) verify reported issue
Step 4: reveal Ubuntu version
Step 5: reveal related spell packages
Step 6: contents of package python-gtkspellcheck
Step 7: versions of related packages
Step 8: update gtkspellcheck by hand (is there some deb package?)

In short:

The example large_pygobject.py in pygtkspellcheck 4.0.4 executed under Ubuntu 16.04 with gtkspellcheck 3.0 reveals the reported error using copy/paste from the file crash.txt, which just holds 1 offending line.

A quick test with just replacing
/usr/share/pyshared/gtkspellcheck/spellcheck.py
by
koehlma-pygtkspellcheck-9232359/src/gtkspellcheck/spellcheck.py
(used a few days before) made no difference, good use cases stayed good, reported issue with UTF-8 character remained a FAIL.

Best regards, Andreas
protocol.txt
crash.txt

@koehlma

This comment has been minimized.

Copy link
Owner

koehlma commented Jul 18, 2016

Thanks for the detailed analyses. However I am still unable to reproduce it, even with the files you provided. Personally I am using Arch Linux, so it might be a Ubuntu specific problem. I will do some testing with Ubuntu and let you know what are the results, but it might take a while.

Regarding the question whether there is a deb package or not: I am not providing a package myself, because I think that is the task of the distributor. However I hope there will be a more up to date package soon: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=830509

Greetings,
Maximilian

@koehlma koehlma reopened this Jul 18, 2016

@koehlma koehlma self-assigned this Jul 18, 2016

@koehlma

This comment has been minimized.

Copy link
Owner

koehlma commented Aug 4, 2016

I am able to reproduce this issue using version 3.x, it seems to me that the manual update you did did not work as expected. Because I am unable to reproduce this using the newest version I close this issue. However I keep trying to get the newest version inside the Debian repositories.

/* Edit:
You might want to raise your voice in the corresponding Debian bug report:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=830509
*/

Greetings,
Maximilian

@koehlma koehlma closed this Aug 4, 2016

@awehler-gh

This comment has been minimized.

Copy link
Author

awehler-gh commented Aug 5, 2016

Thanks a lot for analysis.

Due to missing Ubuntu 16.04 update of python-gtkspellcheck 3.0-1.1 to 4.0
I tried to rename/hide this package and symlink to relevant files manually but failed again.

So I'll probably have to create another bug report for Ubuntu 16.04 maintainers to get this fixed the usual way.

Thanks again,

Andreas

@awehler-gh

This comment has been minimized.

Copy link
Author

awehler-gh commented Aug 5, 2016

SUCCESS!

I've just successfully upgraded to pygtkspellcheck (4.0.4) in Ubuntu 16.04 via pip. Spelling now just works!

pip install pygtkspellcheck   # requirement already satisfied. upgrade?
pip install --upgrade pygtkspellcheck
pip list | grep spell
pygtkspellcheck (4.0.4)

And that obsolete Ubuntu package python-gtkspellcheck may be removed completely without harm.

Now that there is a workaround things seem to be relaxed somehow.

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.