RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1962215 - Resizing column of tree/table to zero width crashes application
Summary: Resizing column of tree/table to zero width crashes application
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gtk3
Version: 7.9
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: David King
QA Contact: Radek Duda
URL:
Whiteboard:
Depends On:
Blocks: 2032437
TreeView+ depends on / blocked
 
Reported: 2021-05-19 14:12 UTC by Simeon Andreev
Modified: 2022-04-05 17:19 UTC (History)
8 users (show)

Fixed In Version: gtk3-3.22.30-7.el7_9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2032437 (view as bug list)
Environment:
Last Closed: 2022-04-05 17:14:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Video showing the crash with the snippet provided in the description. (530.76 KB, video/mp4)
2021-05-19 14:12 UTC, Simeon Andreev
no flags Details
clearlooks-phenix-theme-7.0.1.zip (309.74 KB, application/zip)
2021-06-15 13:16 UTC, Matthias Clasen
no flags Details
treecrash_coredump.zip (1019.29 KB, application/zip)
2021-06-15 13:19 UTC, Matthias Clasen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME gtk merge_requests 3671 0 None None None 2021-06-16 07:11:59 UTC
Red Hat Product Errata RHBA-2022:1192 0 None None None 2022-04-05 17:14:22 UTC

Description Simeon Andreev 2021-05-19 14:12:46 UTC
Created attachment 1784834 [details]
Video showing the crash with the snippet provided in the description.

Description of problem:

GTK3 crashes on resizing a tree/table column to width 0.

Version-Release number of selected component (if applicable):

3.22.30 (RPM version: gtk3-3.22.30-3.el7.x86_64)

How reproducible:

Compile and run the provided snippet.

Steps to Reproduce:
1. Compile and run the following snippet:
#include <gtk/gtk.h>

// gcc -g table_scrollbar_errors.cpp  `pkg-config --cflags --libs gtk+-3.0` -o TableScrollbarErrors && ./TableScrollbarErrors

enum
{
  STRING_COLUMN1,
  STRING_COLUMN2,
  STRING_COLUMN3,
  NUM_COLS
};


int
main (int argc, char **argv)
{
  GtkWidget *window, *scrolled_window, *view;
  GtkTreeIter iter;

  gtk_init(&argc, &argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  g_signal_connect(window, "delete_event", gtk_main_quit, NULL);
  gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);

  scrolled_window = gtk_scrolled_window_new (NULL, NULL);

  GtkCellRenderer     *renderer;
  GtkListStore        *liststore;

  liststore = gtk_list_store_new(NUM_COLS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);

  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(liststore));


  renderer = gtk_cell_renderer_text_new();
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), -1, "column1", renderer, "text", STRING_COLUMN1, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), -1, "column2", renderer, "text", STRING_COLUMN2, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), -1, "column3", renderer, "text", STRING_COLUMN3, NULL);
  for (int i = 0; i < 3; ++i) {
    GtkTreeViewColumn   *col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), i);
    gtk_tree_view_column_set_resizable(col, TRUE);
  }

  for (int i = 0; i < 10; ++i) {
    gtk_list_store_append(liststore, &iter);
    gtk_list_store_set(liststore, &iter, 
                           STRING_COLUMN1, "item1",
                           STRING_COLUMN2, "item2",
                           STRING_COLUMN3, "item3",  -1);
  }

  gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (liststore));

  gtk_container_add(GTK_CONTAINER(window), scrolled_window);
  gtk_container_add(GTK_CONTAINER(scrolled_window), view);

  gtk_widget_show_all(window);
 
  gtk_main();

  return 0;
}
(can be compiled e.g. with "gcc -g table.cpp  `pkg-config --cflags --libs gtk+-3.0`  -o TableExample")
2. Resize the first column to 0 width.
3. Observe crash with assertion error:

(TableScrollbarErrors:15278): Gtk-WARNING **: 15:29:34.645: Negative content width -8 (allocation 2, extents 5x5) while allocating gadget (node button, owner GtkButton)
**
Gtk:ERROR:gtkcellrenderer.c:1787:gtk_cell_renderer_get_aligned_area: assertion failed: (aligned_area->x >= cell_area->x && aligned_area->x <= cell_area->x + cell_area->width)
Aborted (core dumped)

Actual results:

Application crashes.

Expected results:

Application does not crash.

Additional info:

See attached video: "gtk_tree_column_resize_to_0_width_crash.mp4"

See also Eclipse bugs (Eclipse is where the problem was initially observed):

https://bugs.eclipse.org/bugs/show_bug.cgi?id=531685
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573637

Comment 4 Benjamin Otte 2021-06-10 17:33:24 UTC
I ran the test locally and it does not crash for me.

But I notice in the video that you are not using the stock Adwaita GTK theme, probably because you're using KDE.  
Could you see if it still crashes when you run it with GTK_THEME=Adwaita ?

Also, if you could attach a stack trace for your crash, that might give an indication.

Comment 5 Simeon Andreev 2021-06-11 06:37:02 UTC
(In reply to Benjamin Otte from comment #4)
> I ran the test locally and it does not crash for me.
> 
> But I notice in the video that you are not using the stock Adwaita GTK
> theme, probably because you're using KDE.  
> Could you see if it still crashes when you run it with GTK_THEME=Adwaita ?
> 
> Also, if you could attach a stack trace for your crash, that might give an
> indication.

We do not see the crash on Adwaita. We also don't plan on using Adwaita.

See my comments on the resp. RHEL support case:

https://access.redhat.com/support/cases/#/case/02944585/discussion?commentId=a0a2K00000at5FcQAI
https://access.redhat.com/support/cases/#/case/02944585/discussion?commentId=a0a2K00000atXyXQAU

Theme is attached on the RHEL support case: https://access.redhat.com/support/cases/#/case/02944585/discussion?attachmentId=a092K00002aE0nxQAC
Core dump is also attached there: https://access.redhat.com/support/cases/#/case/02944585/discussion?attachmentId=a092K00002aDqjHQAS

Comment 6 Matthias Clasen 2021-06-15 13:16:55 UTC
Created attachment 1791263 [details]
clearlooks-phenix-theme-7.0.1.zip

Comment 7 Matthias Clasen 2021-06-15 13:19:36 UTC
Created attachment 1791264 [details]
treecrash_coredump.zip

Comment 8 Matthias Clasen 2021-06-15 18:00:59 UTC
Upstream fix: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3671

Comment 9 Tomas Popela 2021-06-16 07:12:00 UTC
Moving to POST as there is an upstream fix available.

Comment 20 errata-xmlrpc 2022-04-05 17:14:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (gtk3 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1192


Note You need to log in before you can comment on or make changes to this bug.