After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757963 - 3.18.3 get_iter functions break programs
3.18.3 get_iter functions break programs
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.18.x
Other All
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
: 757881 758098 758150 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-11-11 20:53 UTC by Christoph Anton Mitterer
Modified: 2015-11-16 10:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christoph Anton Mitterer 2015-11-11 20:53:07 UTC
Hey.

As reported here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804798

GTK 3.18.3 break applications, e.g. meld which doesn't show its "diff" colours anymore, thereby becoming unusable.

Michael Biebl, found and confirmed the reason to be the changes from commit:
cf51c4f6dbd91dae1878a0cb0d08b24c67e15232: "textbuffer: nicer get_iter functions"


Cheers,
Chris.
Comment 1 Matthias Clasen 2015-11-11 21:00:36 UTC
don't really see the 'found and confirmed' part in the debian bug... sounds more like a blind guess :-
Comment 2 Michael Biebl 2015-11-11 21:02:25 UTC
Hi Matthias,

what I did was a git bisect run which identified cf51c4f6dbd91dae1878a0cb0d08b24c67e15232 as the faulty commit.

Do you need more information?
Comment 3 André Klapper 2015-11-11 21:50:10 UTC
$:andre\> rpm -q meld
meld-3.14.1-1.fc23.noarch
$:andre\> rpm -q gtk3
gtk3-3.18.3-1.fc23.x86_64
$:andre\> meld ~/git/triagescripts/task.user.js ~/.mozilla/firefox/12345678.default/gm_scripts/foo/task.user.js 
Traceback (most recent call last):
  • File "/usr/lib/python2.7/site-packages/meld/task.py", line 110 in iteration
    ret = next(task)
  • File "/usr/lib/python2.7/site-packages/meld/filediff.py", line 1270 in _set_files_internal
    for i in self._diff_files():
  • File "/usr/lib/python2.7/site-packages/meld/filediff.py", line 1227 in _diff_files
    while next(step) is None:
  • File "/usr/lib/python2.7/site-packages/meld/diffutil.py", line 466 in set_sequences_iter
    while next(work) is None:
  • File "/usr/lib/python2.7/site-packages/meld/matchers.py", line 246 in initialise
    a, b = self.preprocess()
  • File "/usr/lib/python2.7/site-packages/meld/matchers.py", line 155 in preprocess
    a, b = self.preprocess_remove_prefix_suffix(self.a, self.b)
  • File "/usr/lib/python2.7/site-packages/meld/matchers.py", line 109 in preprocess_remove_prefix_suffix
    self.common_prefix = find_common_prefix(a, b)
  • File "/usr/lib/python2.7/site-packages/meld/matchers.py", line 43 in find_common_prefix
    if a[0] == b[0]:
  • File "/usr/lib/python2.7/site-packages/meld/meldbuffer.py", line 268 in __getitem__
    line_end = line_start.copy()
AttributeError: 'tuple' object has no attribute 'copy'

Comment 4 Michael Biebl 2015-11-11 22:01:31 UTC
(In reply to Michael Biebl from comment #2)
> Hi Matthias,
> 
> what I did was a git bisect run which identified
> cf51c4f6dbd91dae1878a0cb0d08b24c67e15232 as the faulty commit.
> 
> Do you need more information?

But yeah, my first reply was just an educated* guess based on looking at git log.

* or blind :-)
Comment 5 Sébastien Wilmet 2015-11-12 09:11:37 UTC
The commit "nicer get_iter functions" adds boolean return values, which is perfectly fine in C but it breaks Python code, for example this line needs to be adapted:

https://git.gnome.org/browse/meld/tree/meld/sourceview.py?id=7dcfef038ed9dbac7d17f2f36d1039995db32873#n136

> it = buf.get_iter_at_line(line)

Since the commit changes the API (in a backward-compatible way), I think it should not have been backported on the 3.18 version.
Comment 6 Sébastien Wilmet 2015-11-12 09:23:34 UTC
I don't know what's the policy for GTK+ about API compatibility for GIR bindings.

But the boolean return value is not very useful. It tells whether the exact position was found, which can also be checked by calling gtk_text_iter_get_line(), gtk_text_iter_get_line_index() etc on the returned iter.
Comment 7 Matthias Clasen 2015-11-12 15:36:33 UTC
I've reverted the commit now on both branches. We can maybe try again without the boolean return added ?
Comment 8 Sébastien Wilmet 2015-11-12 17:06:16 UTC
See bug #735341 for the new attempt. We can close this one.
Comment 9 Kai Willadsen 2015-11-13 23:35:36 UTC
*** Bug 757881 has been marked as a duplicate of this bug. ***
Comment 10 Kai Willadsen 2015-11-14 22:46:30 UTC
*** Bug 758098 has been marked as a duplicate of this bug. ***
Comment 11 Sébastien Wilmet 2015-11-16 10:00:46 UTC
*** Bug 758150 has been marked as a duplicate of this bug. ***