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 786395 - zenity --forms crashes with more than one --add-list 's
zenity --forms crashes with more than one --add-list 's
Status: RESOLVED OBSOLETE
Product: zenity
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-17 03:25 UTC by bluescreen_avenger
Modified: 2021-05-25 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bugfix for lists in form (948 bytes, patch)
2017-08-29 08:50 UTC, Stanislav T
none Details | Review
Bugfix for lists in form (1.44 KB, patch)
2017-09-11 15:09 UTC, Stanislav T
none Details | Review
Test cases (1.22 KB, application/x-shellscript)
2017-09-11 15:12 UTC, Stanislav T
  Details

Description bluescreen_avenger 2017-08-17 03:25:08 UTC
Hi

It seems that Zenity (master too) crashes when a form has two lists in gtk_list_store_set_column_types

I don't have all symbols installed, but it happens consistantly in my own built Zenity, and Ubuntu's Zenity

Easiest way to reproduce it is
zenity --forms  --add-list=1 --add-list=2
(it crashes with 0, 1, and 2 --list-values= passed)

Thanks
Comment 1 Stanislav T 2017-08-29 08:50:43 UTC
Created attachment 358657 [details] [review]
Bugfix for lists in form

Hi.
I explored this bug.
When a form has two (and more) lists and not enougth list values, the second (and all following lists) list has not column_types, therefore it crashes.
I suggest to set column_types to G_TYPE_STRING by default if values not provided (see patch).

Test case:
zenity --forms --add-list="foo" --add-list="bar" --add-list="car" --list-values="1|2|3" --add-entry="blank"
Comment 2 bluescreen_avenger 2017-09-03 18:38:22 UTC
This seems to avoid the crash
but if I do
zenity --forms --add-list=test --list-values="1|2" --add-list=test2 --list-values="1|2"
only the first list has the selections in it
Comment 3 Stanislav T 2017-09-11 15:09:39 UTC
Created attachment 359536 [details] [review]
Bugfix for lists in form

I get it.

Column values and list values must count separately.
Column values must correspond to list values therefore column number must
correspond list number.

In line:
g_slist_nth_data (forms_data->column_values, list_number);

Using there list_number is not valid - it possible that count of columns less
than count of lists.  In such case, we may use first column for all remaining columns.
Comment 4 Stanislav T 2017-09-11 15:12:09 UTC
Created attachment 359537 [details]
Test cases

I tested this cases.
Comment 5 bluescreen_avenger 2017-09-15 22:14:40 UTC
This works!
Comment 6 Sebastien Bacher 2018-11-07 15:06:04 UTC
That's still an issue, reported downstream on https://bugs.launchpad.net/zenity/+bug/1802105
Comment 7 André Klapper 2021-05-25 17:45:23 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new enhancement request ticket at
  https://gitlab.gnome.org/GNOME/zenity/-/issues/

Thank you for your understanding and your help.