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 707121 - Merge contacts dialogs indefinitely expands by itself
Merge contacts dialogs indefinitely expands by itself
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
3.10.x (obsolete)
Other Linux
: Normal major
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
evolution[webkit]
: 699709 711579 711759 720354 721578 728453 745775 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-08-30 11:05 UTC by Mehmet Giritli
Modified: 2015-03-09 14:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (11.05 KB, text/plain)
2013-09-27 11:12 UTC, Mehmet Giritli
Details
multiple backtraces (5.29 KB, application/x-compressed-tar)
2013-09-30 10:15 UTC, Mehmet Giritli
Details
minimal reproducer (2.21 KB, text/plain)
2013-10-02 13:43 UTC, Milan Crha
Details

Description Mehmet Giritli 2013-08-30 11:05:56 UTC
I'm kind of surprised to see that this was not reported before.

Anyway, try to copy-paste a contact from an addressbook (in my case google) to another addressbook (in my case ldap server) such that there is an already existing contact in the target addressbook so that evolution will offer to merge contacts.

I get the merge window that is continuously expanding by itself sideways. You have to hit esc key to exit the dialog or if you can hit it before it disappers to the sideways, the cancel key.

I'm on Evolution 3.8.4
Comment 1 Milan Crha 2013-09-03 14:37:08 UTC
Thanks for a bug report. I tried to reproduce this, but I do not get the window expand, the window is showsn as expected. I beleive this depends on actual data in the contact in the destination book, same as contact data being in the source book. Could you provide these two test contacts with some fictional data, please?
Comment 2 Mehmet Giritli 2013-09-25 08:20:48 UTC
Milan,

I saved contact info across two servers (google and ldap) for such a contact in two separate vcf files. Do you have an email address I can send these? I can remove some info but then this might also remove important debug stuff.
Comment 3 Milan Crha 2013-09-25 08:40:51 UTC
You can send it to my bugzilla email, only write a bug number/link into subject, thus I'll not overlook it in my spam folder
Comment 4 Milan Crha 2013-09-26 09:24:08 UTC
Thanks for the files. I would expect things not being related to addressbook source and destination type at all (in your case source Google, destination LDAP), thus I imported one contact to one local book, the other to another local book, and then right-clicked contact in one of them, choosing Copy, and moved to the other book and right-clicked and chose Paste. It showed me that the contact is already there, thus I clicked Merge, which brings another dialog which let's me choose which values I want to merge. In one way it's only email, in the other way it's many more items. Sadly, the dialog doesn't change its size, it stands as it was on open, with scrollbars in the second case. This was both with 3.8.3 and 3.8.5, same is with current development version. I even tried to update gtk3 to 3.8.4-1, but it still works as expected, even under gnome-shell.
Comment 5 Milan Crha 2013-09-26 09:28:39 UTC
oh, I forgot to mention, I also used "Copy to book option", instead of copy&paste through clipboard.
Comment 6 Mehmet Giritli 2013-09-27 08:44:40 UTC
I re tested this and on my computer seem to make a difference what type of ab yoıu use.

I created a 2nd local ab and did not observe the bug! I can see bug in these types:

local -> local - no
local -> google - yes
local -> ldap - no

google -> local - yes
google -> ldap - yes

ldap -> local - no
ldap -> google - yes



so it seems it has something to do with google type ab! Didn't realize this before....
Comment 7 Milan Crha 2013-09-27 10:46:07 UTC
Hmm, that's pretty weird. All the dialog does is done locally, thus it might be that the contact on the google server contains something else/more than the local one. I still try the local->google, google->local, but no luck here, both with copying the "richer" contact on top of the smaller, and vice versa.

Thus it might be something with gtk+ version and the amount of data to be merged, I guess.

By the way, what I do:
a) right click a contact in a Google (or local) book
b) choose "Copy Contact to"
c) select the other of Google/local book than the one from step a)
d) on question of Cancel/Add/Merge I click Merge
e) now I see a dialog with list of changed values, which I simply cancel

I expect that at step e) you get the hang, right?

Could you install debuginfo packages for evolution, evolution-data-server, and gtk+ of the versions you've installed, restart evolution, reproduce the hang and get a backtrace for the time the application is hang, with this command, please?

   $ gdb --batch --ex "t a a bt" -pid=`pidof evolution` &>bt.txt

and attach/paste the content of bt.txt here, please? Please, make sure the backtrace will not expose any private data, like passwords, email addresses and so on. I usually search for "pass" (quotes for clarity only) in it.
Comment 8 Mehmet Giritli 2013-09-27 11:10:52 UTC
instead of step (b) I actually choose just "copy" but I tried your version and I still get the bug.

Moreover, I don't get a hang. I get an indefinitely expanding window after I select the google addressbook in step (c). Merge dialog expands to the right and after it reaches the border of the screeen expands to the left until it reaches to the left end of the screen and when it does it again continues to expand to the right and I don't see the buttons anymore etc.

I tried to get the bt when the bug appeared and I attached the bt.txt file.
Comment 9 Mehmet Giritli 2013-09-27 11:12:45 UTC
Created attachment 255917 [details]
backtrace
Comment 10 Mehmet Giritli 2013-09-27 11:18:16 UTC
BTW I'm using gtk+-3.8.2
Comment 11 Mehmet Giritli 2013-09-28 11:28:03 UTC
I upgraded to gtk+-3.8.4 and recompiled Evolution. I still see this bug.

Any other ideas to figure out whats going on will be really appreciated!
Comment 12 Milan Crha 2013-09-30 10:01:54 UTC
Hmm, I think it's some event-driven resizing, because the backtrace you caught shows all threads idle, where I would expect at least thread 1 busy on the resize. Getting the backtrace slightly sooner, or later (really hard to know when the right time is, if it goes through event loop), should show some activity in the main thread. You can try to catch the backtrace, the command can be run multiple times with different files in output redirection, if you want. As a simple command feel free to use:
   $ for i in {1..10}; do gdb --batch --ex "t a a bt" -pid=`pidof evolution` &>bt$i.txt; sleep 0.1; done

Mathias, by any chance, do you recall anything like this in gtk+, please?
Comment 13 Mehmet Giritli 2013-09-30 10:15:55 UTC
Created attachment 256065 [details]
multiple backtraces
Comment 14 Mehmet Giritli 2013-09-30 10:17:26 UTC
I run that command just before I paste a contact into google ab. It was still running when the problem appeared.

Hope it helps.
Comment 15 Milan Crha 2013-10-02 10:45:34 UTC
Thanks for the update. I see that:
- bt4 is in gtk's gtk_window_compute_configure_request()
- bt5 is in gdk_window_process_updates_with_mode()
- bt6 in XTranslateCoordinates()
- bt8 in WebKit drawing (WebKit::repaintEverythingSoonTimeout())
- bt9 in webkit_web_view_motion_event()

I'd still appreciate a comment from Matthias or any other gtk+ developer.
Comment 16 Milan Crha 2013-10-02 11:08:38 UTC
I tried this under gnome-shell, in Fedora 20, and I see that resize too there. My MATE in Fedora 19 is fine, which makes me wonder what the gnome-shell broke again.
Comment 17 Milan Crha 2013-10-02 12:49:46 UTC
Even with that Fedora 20 I cannot reproduce it consistently, it sometimes does the "expand in size", but mostly not. It's the "Duplicate Contact Detected" dialog which does it. I see it goes through functions like gtk_window_move_resize() and gtk_container_start_idle_sizer(), though these might be too generic.

I also noticed that this window cannot be shrink, it can only expand (when dragging right edge of the window) for some reason. I do not know which widget prevents window shrink, even there are only few of them.

Nice, it just happened here on Fedora 19 too, but only once. I repeated the same steps, but it doesn't do it again. From that I see it's not about gnome-shell as such, it only might be easier to reproduce there than in MATE here.
Comment 18 Milan Crha 2013-10-02 13:43:18 UTC
Created attachment 256268 [details]
minimal reproducer

This is a minimal reproducer, with which I can reproduce the issue. It opens
   /usr/share/evolution/3.8/ui/eab-contact-duplicate-detected.ui
replaces there the evolution widgets with webkit web views (the evolution widgets are descendants of it), then removes one of them and finally shows the dialog. The dialog changes its size consistently this way, at least for me. If I remove both web views, then the dialog stands still.

From that I guess this has something to do with webkit. Its webkit_web_view_get_preferred_width() always sets minimum and natural widths the same, thus if the web view decides that the content is larger for whatever reason, then it also brings the window larger. This way the webview will never allow itself to be shrink, because the minimum size is the same as the natural/content size.
Comment 19 Vadim Rutkovsky 2013-10-17 10:37:59 UTC
Reproduced on evolution-3.10.1-1.fc21.x86_64 on merge dialog for two contact lists on webdav source
Comment 20 Vadim Rutkovsky 2013-11-07 08:36:57 UTC
*** Bug 699709 has been marked as a duplicate of this bug. ***
Comment 21 Vadim Rutkovsky 2013-11-07 08:37:00 UTC
*** Bug 711579 has been marked as a duplicate of this bug. ***
Comment 22 Colin Beckingham 2013-11-23 13:08:23 UTC
I see the same effect on openSUSE 13.1 64 bit, Evolution 3.10.1

Steps:
1. right click on address in email message
2. click add to address book
3. dialog box pops up "duplicate address detected"
4. dialog box begins growing in in the +y direction pushing the buttons off the screen.

I don't know if this was present in openSUSE 12.3.
Comment 23 Matthew Barnes 2014-01-05 15:13:45 UTC
*** Bug 721578 has been marked as a duplicate of this bug. ***
Comment 24 Brian J. Murrell 2014-01-05 15:24:26 UTC
I see this on evolution 3.10.3 on F20 using the MATE desktop.
Comment 25 Chris Billington 2014-01-09 12:16:19 UTC
Also seen on Evolution 3.10.3 on Arch Linux i386 under XFCE 4.10.

No Gnome services are running except goa-daemon, gnome-keyring-daemon, at-spi2-registryd .
Comment 26 Chris Billington 2014-01-09 12:18:18 UTC
There is a Youtube clip of the bug effect (3.10.1) at http://www.youtube.com/watch?v=_eLJ3RhvAAo
Comment 27 msocorcim 2014-01-20 22:46:29 UTC
eab-contact-merging.c (c)  static void                       Row 255

static void
dialog_map (GtkWidget *window,
            GdkEvent *event, 
            GtkWidget *table)
{
        GtkAllocation allocation;
        gint h, w;

        gtk_widget_get_allocation (table, &allocation);

        /* Spacing around the table */
        w = allocation.width + 30;

It looks like this will resize the dialog widget if there's not adequate margin around a table. if the table dimensions are not constrained appropriately this would cause the width to increase in steps.

gtk_table_attach_defaults has been deprecated since version 3.4 and should not be
https://developer.gnome.org/gtk3/stable/GtkTable.html

gtk_table_attach_defaults (table, (GtkWidget *) hbox, 0, 1, row, row + 1);---

default options are FILL|EXPAND

The table expands and then the dialog window resizes over and over until a crash occurs.
Comment 28 Milan Crha 2014-01-21 07:45:12 UTC
Well, it sounds promising, but it doesn't explain why the minimal reproducer from comment #18 suffers of the same issue, but doesn't have your cited code. That's why I believe this is WebKitWebView's issue. By the way, the "map" signal is supposed to be called only once, not multiple times.
Comment 29 Milan Crha 2014-01-24 13:22:47 UTC
I managed to cook a fix for this, with help of msocorcim. I'm still unsure of the exact cause of the auto-expand behaviour, but it seems like an issue with a WebKitWebView not being packed in a GtkScrolledWindow directly, but indirectly, with more other widgets. That's at least one the differences between eab-contact-duplicate-detected.ui (suffers of the issue) and eab-contact-commit-duplicate-detected.ui (does not suffer of the issue), while otherwise these two dialogs are visually almost identical.

I did two different fixes, actually, one for 3.10 version, which only removes the top GtkScrolledWindow and packs WebKitWebView descendants to their own GtkScrolledWindow. It also, as a side effect, fixes dialog resizing. The second fix, for git master, goes further, and drops the both .ui files from the sources and creates the dialog on the fly within the C code. The packing is almost the same, only more modern widgets are used inside (GtkTable has been replaced with GtkGrid).

Created commit 90f956a in evo master (3.11.5+) [1]
Created commit 75938b5 in evo gnome-3-10 (3.10.4+)

[1] https://git.gnome.org/browse/evolution/commit/?id=90f956a
Comment 30 Milan Crha 2014-02-11 13:29:28 UTC
*** Bug 720354 has been marked as a duplicate of this bug. ***
Comment 31 Milan Crha 2014-02-20 15:59:40 UTC
*** Bug 711759 has been marked as a duplicate of this bug. ***
Comment 32 Milan Crha 2015-03-09 12:04:41 UTC
*** Bug 745775 has been marked as a duplicate of this bug. ***
Comment 33 Milan Crha 2015-03-09 14:59:07 UTC
*** Bug 728453 has been marked as a duplicate of this bug. ***