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 652996 - dev-util/meld-1.5.1 - wrong display of differences
dev-util/meld-1.5.1 - wrong display of differences
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: general
1.5.x
Other Linux
: Normal normal
: ---
Assigned To: meld-maint
meld-maint
: 656491 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-06-20 11:15 UTC by Juergen Rose
Modified: 2011-10-04 22:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wrong display of differences (20.73 KB, image/png)
2011-06-20 11:15 UTC, Juergen Rose
  Details
1st testfile (147.82 KB, text/plain)
2011-06-21 09:05 UTC, Juergen Rose
  Details
2nd test file (147.78 KB, text/plain)
2011-06-21 09:05 UTC, Juergen Rose
  Details
wrong display of differences between 1st and 2nd test file (58.28 KB, image/png)
2011-06-21 09:10 UTC, Juergen Rose
  Details
Debug patch (477 bytes, patch)
2011-06-25 01:59 UTC, Kai Willadsen
none Details | Review
Patch (1.55 KB, application/octet-stream)
2011-07-12 22:44 UTC, Kai Willadsen
  Details
File with inserted FF (3.57 KB, text/plain)
2011-10-04 08:26 UTC, Tomas Mraz
  Details
File with no FF (1.67 KB, text/plain)
2011-10-04 08:28 UTC, Tomas Mraz
  Details

Description Juergen Rose 2011-06-20 11:15:07 UTC
Created attachment 190260 [details]
wrong display of differences

I compare two files, modify one of these files, so that both files are
identical and try to save the modified files.
The file changed file is saved, as I see by an additional diff, but the icon in
meld still shows the unsaved state. 
In the  window where I started meld, I see:
...
IndexError: list index out of range
Traceback (most recent call last):
  • File "/usr/lib/meld/meld/meldwindow.py", line 377 in on_menu_save_activate
    self.current_doc().save()
  • File "/usr/lib/meld/meld/filediff.py", line 1233 in save
    self.save_file(pane)
  • File "/usr/lib/meld/meld/filediff.py", line 1211 in save_file
    self.undosequence.checkpoint(buf)
  • File "/usr/lib/meld/meld/undo.py", line 182 in checkpoint
    while end < len(self.actions) and self.actions[end + 1].buffer != buf:
IndexError: list index out of range
Traceback (most recent call last):
  • File "/usr/lib/meld/meld/meldwindow.py", line 377 in on_menu_save_activate
    self.current_doc().save()
  • File "/usr/lib/meld/meld/filediff.py", line 1233 in save
    self.save_file(pane)
  • File "/usr/lib/meld/meld/filediff.py", line 1211 in save_file
    self.undosequence.checkpoint(buf)
  • File "/usr/lib/meld/meld/undo.py", line 182 in checkpoint
    while end < len(self.actions) and self.actions[end + 1].buffer != buf:
IndexError: list index out of range



I can also try to save the file as an other file, I then see the new file name
in the file line of meld, but the icon is not changed. An if try to quit meld,
I get the message, that there are some modified files.



After reboot the issue disappeared. The files, where it happens, were a saved linux-2.6.38 configuration and the
current /usr/src/.config with ca. 3873 lines, differing in several lines.
If try to repeat it with both files, the saved files modified in two positions,
I could save the file after changing these two positions back to old state
inside of meld without any problem.

But I have the feeling that meld has difficulties with large files. If I
compare my .bashrc ( 4815 lines) with a saved version, the position of
differences are often not shown correctly, look at the attachment.

It was also reported as a gentoo bug.
Comment 1 Juergen Rose 2011-06-20 11:16:28 UTC
The gentoo bug is at http://bugs.gentoo.org/show_bug.cgi?id=370427
Comment 2 Kai Willadsen 2011-06-20 22:40:06 UTC
These are two different bugs. Please file different issues separately in the future.

The problem with saving is a duplicate of bug 651651. If you can find a way to reproduce it, then please add details to that bug. I've seen this happen before, but so far haven't been able to track down the problem, or reliably recreate it.

The second problem with the incorrect comparison could be anything. Please attach the relevant files and include a listing of your filter settings.
Comment 3 Juergen Rose 2011-06-21 09:05:06 UTC
Created attachment 190348 [details]
1st testfile
Comment 4 Juergen Rose 2011-06-21 09:05:54 UTC
Created attachment 190349 [details]
2nd test file
Comment 5 Juergen Rose 2011-06-21 09:10:15 UTC
Created attachment 190350 [details]
wrong display of differences between 1st and 2nd test file
Comment 6 Kai Willadsen 2011-06-21 20:19:35 UTC
Your examples work as expected here, and the comparison is fine.

I suspect that this is either a newline issue - I was hoping I'd fixed all of those - or a filter issue. What filters do you have active, and do you have the ignore-blank-lines preference set?

Also, can you reproduce the bug with current git of Meld?
Comment 7 Juergen Rose 2011-06-23 22:20:51 UTC
In my meld the file filter Backups, Versions Control and Binaries are activated. There is not any text filter which is activated. Coding is utf8 latin1.
I do not find any ignore-blank-lines option. I have for the Editor settings:

Font
       Use the systems fixed width font
   Editor font:   Monospace 8

Display
   Tab width:  2
       Insert spaces instead of tabs
       Enable text wrapping
       v  Do not split words over two lines
       Show line numbers
       Show whitespace
       Use syntax highlighting

External editor
    v  Use default system editor
 

Can you give me some hint, how can I install the current git of Meld? I not yet use git.
Comment 8 Juergen Rose 2011-06-24 09:23:31 UTC
Hi Kai,

I did the following:
rose@moose:/home/rose/Txt/Problems/Meld(40)$ git clone git://git.gnome.org/meld Meld
Cloning into Meld...
remote: Counting objects: 8438, done.
remote: Compressing objects: 100% (4237/4237), done.
remote: Total 8438 (delta 6087), reused 5792 (delta 4162)
Receiving objects: 100% (8438/8438), 3.07 MiB | 505 KiB/s, done.
Resolving deltas: 100% (6087/6087), done.
rose@moose:/home/rose/Txt/Problems/Meld(41)$ ll
insgesamt 88
drwxr-x--- 9 rose rose  4096 24. Jun 11:13 Meld/
-rw-r----- 1 rose rose 59679 21. Jun 11:02 meld_display_error.png
-rw-r----- 1 rose rose 21230 15. Jun 21:30 meld_error.png
rose@moose:/home/rose/Txt/Problems/Meld(42)$ du -s .??* *
148	.bashrc_1
148	.bashrc_2
96	.git
6280	Meld
60	meld_display_error.png
24	meld_error.png

rose@moose:/home/rose/Txt/Problems/Meld(44)$ cd Meld/
rose@moose:/home/rose/Txt/Problems/Meld/Meld(45)$ ll
insgesamt 88
-rw-r----- 1 rose rose   649 24. Jun 11:13 AUTHORS
-rw-r----- 1 rose rose 17992 24. Jun 11:13 COPYING
-rw-r----- 1 rose rose  1244 24. Jun 11:13 INSTALL
-rw-r----- 1 rose rose  4332 24. Jun 11:13 Makefile
-rw-r----- 1 rose rose 20364 24. Jun 11:13 NEWS
drwxr-x--- 2 rose rose  4096 24. Jun 11:13 bin/
drwxr-x--- 4 rose rose  4096 24. Jun 11:13 data/
drwxr-x--- 8 rose rose  4096 24. Jun 11:13 help/
drwxr-x--- 5 rose rose  4096 24. Jun 11:13 meld/
-rw-r----- 1 rose rose  2411 24. Jun 11:13 meld.1
-rw-r----- 1 rose rose  1720 24. Jun 11:13 meld.doap
drwxr-x--- 2 rose rose  4096 24. Jun 11:13 po/
drwxr-x--- 2 rose rose  4096 24. Jun 11:13 tools/
rose@moose:/home/rose/Txt/Problems/Meld/Meld(46)$ make
python tools/install_paths \
	libdir=/usr/local/lib/meld \
	localedir=/usr/local/share/locale \
	helpdir=/usr/local/share/gnome/help/meld \
	sharedir=/usr/local/share/meld \
	< bin/meld > bin/meld.install
python tools/install_paths \
	libdir=/usr/local/lib/meld \
	localedir=/usr/local/share/locale \
	helpdir=/usr/local/share/gnome/help/meld \
	sharedir=/usr/local/share/meld \
	< meld/paths.py > meld/paths.py.install
intltool-merge -d po data/meld.desktop.in data/meld.desktop
Merging translations into data/meld.desktop.
make -C po
make[1]: Entering directory `/home_moose/rose/Txt/Problems/Meld/Meld/po'
mkdir -m 755 -p pa/LC_MESSAGES/ && msgfmt -c -o pa/LC_MESSAGES/meld.mo pa.po
mkdir -m 755 -p ko/LC_MESSAGES/ && msgfmt -c -o ko/LC_MESSAGES/meld.mo ko.po
mkdir -m 755 -p sv/LC_MESSAGES/ && msgfmt -c -o sv/LC_MESSAGES/meld.mo sv.po
mkdir -m 755 -p ca@valencia/LC_MESSAGES/ && msgfmt -c -o ca@valencia/LC_MESSAGES/meld.mo ca@valencia.po
mkdir -m 755 -p ja/LC_MESSAGES/ && msgfmt -c -o ja/LC_MESSAGES/meld.mo ja.po
mkdir -m 755 -p sl/LC_MESSAGES/ && msgfmt -c -o sl/LC_MESSAGES/meld.mo sl.po
mkdir -m 755 -p sr/LC_MESSAGES/ && msgfmt -c -o sr/LC_MESSAGES/meld.mo sr.po
mkdir -m 755 -p vi/LC_MESSAGES/ && msgfmt -c -o vi/LC_MESSAGES/meld.mo vi.po
mkdir -m 755 -p da/LC_MESSAGES/ && msgfmt -c -o da/LC_MESSAGES/meld.mo da.po
mkdir -m 755 -p zh_CN/LC_MESSAGES/ && msgfmt -c -o zh_CN/LC_MESSAGES/meld.mo zh_CN.po
mkdir -m 755 -p ca/LC_MESSAGES/ && msgfmt -c -o ca/LC_MESSAGES/meld.mo ca.po
mkdir -m 755 -p ne/LC_MESSAGES/ && msgfmt -c -o ne/LC_MESSAGES/meld.mo ne.po
mkdir -m 755 -p rw/LC_MESSAGES/ && msgfmt -c -o rw/LC_MESSAGES/meld.mo rw.po
mkdir -m 755 -p nb/LC_MESSAGES/ && msgfmt -c -o nb/LC_MESSAGES/meld.mo nb.po
mkdir -m 755 -p ru/LC_MESSAGES/ && msgfmt -c -o ru/LC_MESSAGES/meld.mo ru.po
mkdir -m 755 -p dz/LC_MESSAGES/ && msgfmt -c -o dz/LC_MESSAGES/meld.mo dz.po
mkdir -m 755 -p fi/LC_MESSAGES/ && msgfmt -c -o fi/LC_MESSAGES/meld.mo fi.po
mkdir -m 755 -p es/LC_MESSAGES/ && msgfmt -c -o es/LC_MESSAGES/meld.mo es.po
mkdir -m 755 -p sr@latin/LC_MESSAGES/ && msgfmt -c -o sr@latin/LC_MESSAGES/meld.mo sr@latin.po
mkdir -m 755 -p ar/LC_MESSAGES/ && msgfmt -c -o ar/LC_MESSAGES/meld.mo ar.po
mkdir -m 755 -p pt/LC_MESSAGES/ && msgfmt -c -o pt/LC_MESSAGES/meld.mo pt.po
mkdir -m 755 -p en_GB/LC_MESSAGES/ && msgfmt -c -o en_GB/LC_MESSAGES/meld.mo en_GB.po
mkdir -m 755 -p cs/LC_MESSAGES/ && msgfmt -c -o cs/LC_MESSAGES/meld.mo cs.po
mkdir -m 755 -p bg/LC_MESSAGES/ && msgfmt -c -o bg/LC_MESSAGES/meld.mo bg.po
mkdir -m 755 -p it/LC_MESSAGES/ && msgfmt -c -o it/LC_MESSAGES/meld.mo it.po
mkdir -m 755 -p gl/LC_MESSAGES/ && msgfmt -c -o gl/LC_MESSAGES/meld.mo gl.po
mkdir -m 755 -p pt_BR/LC_MESSAGES/ && msgfmt -c -o pt_BR/LC_MESSAGES/meld.mo pt_BR.po
mkdir -m 755 -p fr/LC_MESSAGES/ && msgfmt -c -o fr/LC_MESSAGES/meld.mo fr.po
mkdir -m 755 -p hu/LC_MESSAGES/ && msgfmt -c -o hu/LC_MESSAGES/meld.mo hu.po
mkdir -m 755 -p en_CA/LC_MESSAGES/ && msgfmt -c -o en_CA/LC_MESSAGES/meld.mo en_CA.po
mkdir -m 755 -p nl/LC_MESSAGES/ && msgfmt -c -o nl/LC_MESSAGES/meld.mo nl.po
mkdir -m 755 -p oc/LC_MESSAGES/ && msgfmt -c -o oc/LC_MESSAGES/meld.mo oc.po
mkdir -m 755 -p de/LC_MESSAGES/ && msgfmt -c -o de/LC_MESSAGES/meld.mo de.po
mkdir -m 755 -p zh_TW/LC_MESSAGES/ && msgfmt -c -o zh_TW/LC_MESSAGES/meld.mo zh_TW.po
mkdir -m 755 -p el/LC_MESSAGES/ && msgfmt -c -o el/LC_MESSAGES/meld.mo el.po
mkdir -m 755 -p sq/LC_MESSAGES/ && msgfmt -c -o sq/LC_MESSAGES/meld.mo sq.po
make[1]: Leaving directory `/home_moose/rose/Txt/Problems/Meld/Meld/po'
make -C help
make[1]: Entering directory `/home_moose/rose/Txt/Problems/Meld/Meld/help'
for lang in C es fr; do \
	make -C $lang all ; \
done
make[2]: Entering directory `/home_moose/rose/Txt/Problems/Meld/Meld/help/C'
scrollkeeper-preinstall /usr/local/share/gnome/help/meld/C/meld.xml meld-C.omf meld-C.omf.install
make[2]: Leaving directory `/home_moose/rose/Txt/Problems/Meld/Meld/help/C'
make[2]: Entering directory `/home_moose/rose/Txt/Problems/Meld/Meld/help/es'
scrollkeeper-preinstall /usr/local/share/gnome/help/meld/es/meld.xml meld-es.omf meld-es.omf.install
make[2]: Leaving directory `/home_moose/rose/Txt/Problems/Meld/Meld/help/es'
make[2]: Entering directory `/home_moose/rose/Txt/Problems/Meld/Meld/help/fr'
scrollkeeper-preinstall /usr/local/share/gnome/help/meld/fr/meld.xml meld-fr.omf meld-fr.omf.install
make[2]: Leaving directory `/home_moose/rose/Txt/Problems/Meld/Meld/help/fr'
make[1]: Leaving directory `/home_moose/rose/Txt/Problems/Meld/Meld/help'
rose@moose:/home/rose/Txt/Problems/Meld/Meld(49)$ ll bin/
insgesamt 8
-rwxr-x--- 1 rose rose 4069 24. Jun 11:13 meld*
-rw-r----- 1 rose rose 4083 24. Jun 11:14 meld.install
rose@moose:/home/rose/Txt/Problems/Meld/Meld(50)$ bin/meld 
rose@moose:/home/rose/Txt/Problems/Meld/Meld(51)$ bin/meld  ../.bashrc_1 ../bashrc_2
/home_moose/rose/Txt/Problems/Meld/Meld/meld/meldwindow.py:576: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  self.notebook.append_page( page.widget, nbl)
/home_moose/rose/Txt/Problems/Meld/Meld/meld/filediff.py:985: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  msgarea.show_all()


And I got the same display error as before.
Comment 9 Kai Willadsen 2011-06-25 01:59:53 UTC
Created attachment 190632 [details] [review]
Debug patch

Thanks for re-testing. Unfortunately, I'm rapidly running out of ideas. I can't replicate this problem on either of my test machines, and I can't see anything obvious in the files that would lead to this sort of issue. They're both \n-terminated text files that look... pretty plain to me.

I'm attaching a patch (should apply to git, might apply to 1.5.1) that just dumps the calculated change lines... just in case that gives me an idea. On my system, this dumps:
(('replace', 5, 6, 5, 6), None)
(('insert', 169, 169, 169, 170), None)
Comment 10 Juergen Rose 2011-06-28 16:53:43 UTC
Hi Kai,

if I apply your patch, I see the following:

root@moose:/home_moose/rose/Txt/Problems/Meld/Meld(61)# diff meld/filediff.py meld/filediff.py_orig
1057,1059d1056
<         for chunk in self.linediffer.all_changes():
<             print chunk
< 
root@moose:/home_moose/rose/Txt/Problems/Meld/Meld(62)# bin/meld  ../.bashrc_1 ../.bashrc_2
/home_moose/rose/Txt/Problems/Meld/Meld/meld/meldwindow.py:576: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
  self.notebook.append_page( page.widget, nbl)
(('replace', 5, 6, 5, 6), None)
(('insert', 167, 167, 167, 168), None)

And meld still shows the wrong position of second difference.

The positions you get for the second diff differ positions I get!

Regards Juergen
Comment 11 Kai Willadsen 2011-07-12 22:44:58 UTC
Created attachment 191852 [details]
Patch

This patch should fix the problem. Testing welcome, and more detailed description to follow.
Comment 12 Kai Willadsen 2011-07-15 23:51:30 UTC
I've pushed the patch to HEAD. Thanks for the bug report and your help.
Comment 13 Kai Willadsen 2011-08-14 02:04:47 UTC
*** Bug 656491 has been marked as a duplicate of this bug. ***
Comment 14 Tomas Mraz 2011-10-04 08:22:46 UTC
This is still not completely fixed. I will attach the files which make it still fail.
Comment 15 Tomas Mraz 2011-10-04 08:26:45 UTC
Created attachment 198195 [details]
File with inserted FF
Comment 16 Tomas Mraz 2011-10-04 08:28:02 UTC
Created attachment 198196 [details]
File with no FF

The differences after the inserted FF are displayed incorrectly.
This is on meld-1.5.2.
Comment 17 Tomas Mraz 2011-10-04 08:29:08 UTC
oops - changing the component back to meld
Comment 18 Kai Willadsen 2011-10-04 21:03:08 UTC
Please retest with current git. I'm almost certain that this is the same as bug 655455, which was fixed in:
http://git.gnome.org/browse/meld/commit/?id=d03a77c8050df0d011ac2e34455a2452ed4a98bd
Comment 19 Tomas Mraz 2011-10-04 22:13:55 UTC
Yes, this commit fixes the problem.