meld assertion while selecting directory

Bug #1242801 reported by Andreas Roth on 2013-10-21
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Gtk2 Engines Oxygen
Won't Fix
High
gtk2-engines-oxygen (Ubuntu)
Undecided
Unassigned

Bug Description

I installed saucy with version 1.3.4-0ubuntu1 of gtk2-engines-oxygen and meld version 1.8.2 on Kubuntu/KDE.
- 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

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

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.

Harald Sitter (apachelogger) wrote :

Hi there!

Thanks for reporting this bug! Your bug seems to be a problem with the KDE program itself, and not with our KDE packages. While we appreciate your issue, it would be better if it was tracked at https://bugs.kde.org, so that the KDE developers can deal with this speedily and have direct communication with you as the reporter for more effective debugging.

Thanks!

Changed in gtk2-engines-oxygen (Ubuntu):
status: New → Invalid

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.

Changed in gtk2-engines-oxygen:
importance: Unknown → High
status: Unknown → New
Download full text (3.7 KiB)

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_Ev...

Read more...

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.

Created attachment 83393
Minimum program to trigger the bug, pygtk version

Created attachment 83394
Minimum program to trigger the bug, c version

Reproducable with both Gtk2 (2.24.12) and Gtk3 (3.10.0).

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.

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.

@Hugo You are right. The crash is gone when setting gtkComboMenu to True in QtCurve.

@Yichao I am suffering the same problem. How can I change this setting? Thank you in advance!

@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.

Screenshot for that option: http://susepaste.org/21884365 .

 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.

@Yichao, @Hugo

Thank you for your help. The workaround does the job!

Changed in gtk2-engines-oxygen:
status: New → Won't Fix

(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?

Still present in Kubuntu 14.04.

@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.

... also, a workaround is provided in comment #11
Really there is nothing more that we can do about it ...

(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.

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 ?

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.

Ok. Sorry if I misinterpretted the comment, and thanks for the upstream bug report.

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?

(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.

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.

In gtk3 the file is another: /usr/share/themes/oxygen-gtk/gtk-3.0/gtk.css

Created attachment 89521
meld backtrace on Kubuntu 14.10

This is the backtrace I got on Kubuntu 14.10.

Is there a workaround on gtk3?

(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.

(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).

@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.

(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.

*** Bug 341321 has been marked as a duplicate of this bug. ***

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.