Bug 326424 - meld assertion while selecting directory
Summary: meld assertion while selecting directory
Status: RESOLVED UPSTREAM
Alias: None
Product: Oxygen
Classification: Plasma
Component: gtk2-engine (show other bugs)
Version: 4.11.2
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
: 341321 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-22 07:38 UTC by Andreas Roth
Modified: 2014-11-27 12:05 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Minimum program to trigger the bug, pygtk version (229 bytes, text/x-python)
2013-11-07 06:07 UTC, Yichao Yu
Details
Minimum program to trigger the bug, c version (422 bytes, text/x-csrc)
2013-11-07 06:08 UTC, Yichao Yu
Details
meld backtrace on Kubuntu 14.10 (9.19 KB, text/plain)
2014-11-10 11:09 UTC, Lastique
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Roth 2013-10-22 07:38:59 UTC
I orininally reported this issue on Ubuntu (https://bugs.launchpad.net/ubuntu/+source/gtk2-engines-oxygen/+bug/1242801), but i was told this is most likely an upstream issue so i report it here.

I installed saucy with version 1.3.4-0ubuntu1 of gtk2-engines-oxygen and meld version 1.8.2 on Kubuntu/KDE.



Reproducible: Always

Steps to Reproduce:
- set GTK2 theme to oxygen-gtk in system settings
- Start meld
- on start screen (new comparsion) select directory comparison
- select in either source or destination directory combo box the entry 'Other...'
- crash

Actual Results:  
in the terminal i could see the callstack of the crash:
/usr/bin/meld:167: GtkWarning: gtk_tree_model_filter_get_value: assertion 'GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp' failed
  gtk.main()
/usr/bin/meld:167: Warning: /build/buildd/glib2.0-2.38.0/./gobject/gtype.c:4215: type id '0' is invalid
  gtk.main()
/usr/bin/meld:167: Warning: can't peek value table for type '<invalid>' which is not currently referenced
  gtk.main()
Segmentation fault


Expected Results:  
file/directory select dialog should appear.

I also tried with version 1.4.0-0ubuntu1 of gtk2-engines-oxygen with the same result.
If I select a QtCurve as gtk2 theme the same crash occurs. If i select a different theme (e.g. Clearlooks) i get the file dialog and everything is ok.

Today i tested this issue on a raring machine and i was unable to reproduce this issue there.
Comment 1 Yichao Yu 2013-11-07 02:35:00 UTC
Confirmed with gtk-2.24.21, meld-1.8.2, pygtk 2.24.0 on ArchLinux.
Backtrace
#0  0x00007ffff41853d5 in gtk_tree_model_get_valist (
    tree_model=tree_model@entry=0x1502640, iter=iter@entry=0x7fffffffcb50, 
    var_args=var_args@entry=0x7fffffffc9f8) at gtktreemodel.c:1470
#1  0x00007ffff41856ec in gtk_tree_model_get (tree_model=0x1502640, 
    iter=0x7fffffffcb50) at gtktreemodel.c:1432
#2  0x00007ffff4054450 in combo_box_row_separator_func (model=<optimized out>, 
    iter=<optimized out>, user_data=<optimized out>) at gtkfilechooserbutton.c:2365
#3  0x00007ffff402c7e4 in tree_column_row_is_sensitive (
    combo_box=combo_box@entry=0x14766b0, iter=iter@entry=0x7fffffffcb50)
    at gtkcombobox.c:1904
#4  0x00007ffff40323b2 in gtk_combo_box_list_button_released (
    widget=<optimized out>, event=0x7fffdc001b30, data=0x14766b0)
    at gtkcombobox.c:4160
#5  0x00007ffff40b1085 in _gtk_marshal_BOOLEAN__BOXED (closure=0x152bb40, 
    return_value=0x7fffffffccc0, n_param_values=<optimized out>, 
    param_values=0x7fffffffcd70, invocation_hint=<optimized out>, marshal_data=0x0)
    at gtkmarshalers.c:86
#6  0x00007ffff5207134 in g_closure_invoke (closure=0x152bb40, 
    return_value=0x7fffffffccc0, n_param_values=2, param_values=0x7fffffffcd70, 
    invocation_hint=0x7fffffffccf0) at gclosure.c:777
#7  0x00007ffff521c609 in signal_emit_unlocked_R (node=<optimized out>, 
    detail=<optimized out>, instance=<optimized out>, 
    emission_return=<optimized out>, instance_and_params=<optimized out>)
    at gsignal.c:3582
#8  0x00007ffff521d23b in g_signal_emit_valist (instance=0x155b2c0, 
    signal_id=<optimized out>, detail=0, var_args=0x7fffffffcfa0) at gsignal.c:3336
#9  0x00007ffff521d98a in g_signal_emit (instance=0x7fffffffc970, 
    instance@entry=0x155b2c0, signal_id=4294967295, detail=4152329808, 
    detail@entry=0) at gsignal.c:3382
#10 0x00007ffff41c0c04 in gtk_widget_event_internal (widget=widget@entry=0x155b2c0, 
    event=event@entry=0x7fffdc001b30) at gtkwidget.c:5010
#11 0x00007ffff41c0ed9 in gtk_widget_event (widget=widget@entry=0x155b2c0, 
    event=event@entry=0x7fffdc001b30) at gtkwidget.c:4807
#12 0x00007ffff40af834 in gtk_propagate_event (widget=0x155b2c0, 
    widget@entry=0x154b320, event=event@entry=0x7fffdc001b30) at gtkmain.c:2490
#13 0x00007ffff40afbeb in gtk_main_do_event (event=0x7fffdc001b30) at gtkmain.c:1685
#14 0x00007ffff3d1108c in gdk_event_dispatch (source=<optimized out>, 
    callback=<optimized out>, user_data=<optimized out>) at gdkevents-x11.c:2403
#15 0x00007ffff513f278 in g_main_dispatch (context=<optimized out>) at gmain.c:3065
#16 g_main_context_dispatch (context=0xb159e0) at gmain.c:3641
#17 0x00007ffff513f61f in g_main_context_iterate (context=<optimized out>, 
    block=<optimized out>, dispatch=<optimized out>, self=<optimized out>)
    at gmain.c:3712
#18 0x00007ffff513f8ff in g_main_loop_run (loop=loop@entry=0x1570990) at gmain.c:3906
#19 0x00007ffff40aecd7 in gtk_main () at gtkmain.c:1257
#20 0x00007ffff4763136 in ?? ()
   from /usr/lib/python2.7/site-packages/gtk-2.0/gtk/_gtk.so
#21 0x00007ffff7af95d6 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7af9552 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7afa290 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7afa392 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7b1308f in run_mod () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7b141ae in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7b15319 in PyRun_SimpleFileExFlags ()
   from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7b25c2f in Py_Main () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff7474bc5 in __libc_start_main () from /usr/lib/libc.so.6
#30 0x0000000000400741 in _start ()
Comment 2 Yichao Yu 2013-11-07 03:53:46 UTC
With further debugging, the direct reason seems to be a "notify::popup-shown" signal being emit and changes the stamp in GtkTreeModelFilter in the path: combo_box_notify_popup_shown_cb -> gtk_tree_model_filter_refilter -> gtk_tree_model_foreach -> gtk_tree_model_filter_refilter_helper -> gtk_tree_model_filter_row_changed -> gtk_tree_model_filter_increment_stamp

Not sure what is the real reason but setting the stamp back after this prevent the segfault.
Comment 3 Yichao Yu 2013-11-07 06:07:05 UTC
Created attachment 83393 [details]
Minimum program to trigger the bug, pygtk version
Comment 4 Yichao Yu 2013-11-07 06:08:15 UTC
Created attachment 83394 [details]
Minimum program to trigger the bug, c version

Reproducable with both Gtk2 (2.24.12) and Gtk3 (3.10.0).
Comment 5 Hugo Pereira Da Costa 2013-11-07 08:49:06 UTC
it is most likely a _gtk_ bug. The reason it si visible in QtCurve and oxygen-gtk is because they both use the "appears-as-list" option to display combobox entries. 
I'll test with clear-looks, setting this option to 1.
If confirmed, this has to be reported to gtk.
Comment 6 Yichao Yu 2013-11-07 12:31:21 UTC
Not sure if this is still helpful now, but it seems that this crash doesn't happen in the print to pdf directory selector. The difference seems to be there is a default selected value in the printer dialog. Adding `btn.set_current_folder('/home')` in the pygtk version works around the problem.
Comment 7 Yichao Yu 2013-11-07 13:56:49 UTC
@Hugo You are right. The crash is gone when setting gtkComboMenu to True in QtCurve.
Comment 8 mcgyver 2013-11-07 23:38:57 UTC
@Yichao I am suffering the same problem. How can I change this setting? Thank you in advance!
Comment 9 Yichao Yu 2013-11-08 00:34:32 UTC
@mcgyver
For a workaround in QtCurve-Gtk, the option (in the config file) is called `gtkComboMenu`(set it to true) and if you are using the kcm setting module, it's the 'Gtk-style' option under 'Non-editable style:' in the 'Combos' tab (select it).

Maybe I will also add a work around in QtCurve. Not sure yet.
Comment 10 Yichao Yu 2013-11-08 00:36:15 UTC
Screenshot for that option: http://susepaste.org/21884365 .
Comment 11 Hugo Pereira Da Costa 2013-11-08 08:33:15 UTC
 mcgyver
For oxygen, edit the normally already existing file "/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc" and change 
    GtkComboBox::appears-as-list = 1
into
    GtkComboBox::appears-as-list = 0

(I think you should be able to also achieve that by editing some $HOME/.gtkrc, but which file exactly is to be edited is distro-specific)

I will not add a GUI option for that, since it is a gtk bug in  the first place.
Comment 12 mcgyver 2013-11-13 02:31:45 UTC
@Yichao, @Hugo

Thank you for your help. The workaround does the job!
Comment 13 kdebugs 2014-04-02 00:41:27 UTC
(In reply to comment #11)
> ... since it is a gtk bug in  the first place.

So, has this in fact been reported to gtk?  Anyone have a link to the bug report?
Comment 14 Lastique 2014-05-06 13:01:47 UTC
Still present in Kubuntu 14.04.
Comment 15 Ruslan Kabatsayev 2014-05-06 13:10:37 UTC
@Lastique it's not our bug, so there's little sense in saying, that it's still present, at KDE bug tracker. See posts above, namely comment 11.
Comment 16 Hugo Pereira Da Costa 2014-05-06 13:14:44 UTC
... also, a workaround is provided in comment #11
Really there is nothing more that we can do about it ...
Comment 17 kdebugs 2014-05-06 13:57:37 UTC
(In reply to comment #13)
> (In reply to comment #11)
> > ... since it is a gtk bug in  the first place.
> 
> So, has this in fact been reported to gtk?  Anyone have a link to the bug
> report?

My question stands unanswered.
Comment 18 Hugo Pereira Da Costa 2014-05-06 14:00:56 UTC
Reporting the bug to gtk is as much your 'dutie' as ours. 
I honestly do not remember whether we (or someone) has reported it to gtk. Maybe you can find it out yourself ?
Comment 19 Lastique 2014-05-06 14:19:40 UTC
I've created the following bug: https://bugzilla.gnome.org/show_bug.cgi?id=729651.
Comment 20 kdebugs 2014-05-06 14:26:04 UTC
Thanks, Lastique.  I wasn't trying to assign responsibility - I was just asking a question.  I didn't want to just make one if it had already been done.
Comment 21 Hugo Pereira Da Costa 2014-05-06 14:34:57 UTC
Ok. Sorry if I misinterpretted the comment, and thanks for the upstream bug report.
Comment 22 Lastique 2014-11-10 10:54:21 UTC
The problem is still present in Kubuntu 14.10.

Is it possible to package oxygen-gtk with the updated config as in comment 11 so that users are not affected until the upstream bug is fixed?
Comment 23 Ruslan Kabatsayev 2014-11-10 11:05:49 UTC
(In reply to Lastique from comment #22)
> Is it possible to package oxygen-gtk with the updated config as in comment
> 11 so that users are not affected until the upstream bug is fixed?

This setting is purposefully set to 1 to achieve the look of combobox dropdown lists as they should be. Otherwise you'll have menus instead of lists, which are uglier, harder to navigate and inconsistent with oxygen-qt. So no, this won't be packaged as is.
An option would be to devise an in-code workaround precisely for meld (which I guess won't go into official oxygen-gtk), but I don't have time to do this.
Comment 24 Lastique 2014-11-10 11:07:24 UTC
Oh, I spoke too soon. It seems, meld now uses gtk3, and the workaround of having "GtkComboBox::appears-as-list = 0" in /usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc no longer works.
Comment 25 Ruslan Kabatsayev 2014-11-10 11:08:42 UTC
In gtk3 the file is another: /usr/share/themes/oxygen-gtk/gtk-3.0/gtk.css
Comment 26 Lastique 2014-11-10 11:09:06 UTC
Created attachment 89521 [details]
meld backtrace on Kubuntu 14.10

This is the backtrace I got on Kubuntu 14.10.

Is there a workaround on gtk3?
Comment 27 Lastique 2014-11-10 11:13:40 UTC
(In reply to Ruslan Kabatsayev from comment #23)
> (In reply to Lastique from comment #22)
> > Is it possible to package oxygen-gtk with the updated config as in comment
> > 11 so that users are not affected until the upstream bug is fixed?
> 
> This setting is purposefully set to 1 to achieve the look of combobox
> dropdown lists as they should be. Otherwise you'll have menus instead of
> lists, which are uglier, harder to navigate and inconsistent with oxygen-qt.
> So no, this won't be packaged as is.
> An option would be to devise an in-code workaround precisely for meld (which
> I guess won't go into official oxygen-gtk), but I don't have time to do this.

Isn't it the case that with this setting the dropdown lists simply crash? I got the impression that this is not a meld-specific bug. If so, it's better to look different but work instead of crashing.
Comment 28 Lastique 2014-11-10 11:16:39 UTC
(In reply to Ruslan Kabatsayev from comment #25)
> In gtk3 the file is another: /usr/share/themes/oxygen-gtk/gtk-3.0/gtk.css

Thanks. I found the "-GtkComboBox-appears-as-list: 1;" line and changed it to 0. It doesn't crash now, although it doesn't open the directory selection dialog (AFAIR, it used to in Kubuntu 14.04, and that's how I selected the directory).
Comment 29 Hugo Pereira Da Costa 2014-11-10 11:18:48 UTC
@Lastique
As repeated several time above: indeed this is not a meld bug.
this is a GTK bug. We will _not_ workaround it in oxygen gtk. 
It has to be fixed in gtk. Period. Arguing further is useless (as is posting new, but identical, crash reports). 
This bug is marked as "resolved, upstream" and that is how it should be.
Comment 30 Lastique 2014-11-10 11:29:50 UTC
(In reply to Hugo Pereira Da Costa from comment #29)
> @Lastique
> It has to be fixed in gtk. Period. Arguing further is useless (as is posting
> new, but identical, crash reports). 
> This bug is marked as "resolved, upstream" and that is how it should be.

The last report I posted is not identical, it's for gtk3 not gtk2. The upstream bug is for gtk2. If you're sure gtk3 has the same bug then could you please open an upstream bug for gtk3 and post a link here? I could open it myself, but you have better upderstanding what is going on in the code.
Comment 31 Ruslan Kabatsayev 2014-11-27 12:05:59 UTC
*** Bug 341321 has been marked as a duplicate of this bug. ***