gnome-initial-setup SIGSEGV in snapd_snap_get_name()

Bug #1901548 reported by Sebastien Bacher
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-initial-setup (Ubuntu)
Fix Released
High
Iain Lane
Focal
Fix Released
High
Iain Lane
Groovy
Fix Released
High
Iain Lane

Bug Description

[ Description ]

Clicking on a blank spot on the featured snaps page can lead to a crash.

[ QA ]

1. With a new user, or by running `/usr/libexec/gnome-initial-setup --existing-user`, launch g-i-s.
2. Advance through until you get to the last page - the one with the snap tiles advertising the featured snaps (you need to be online).
3. Go to the last page if there's no blank square on the current page by clicking the right arrow.
4. Click one of the blank squares a few times.

Either g-i-s will crash, or it will launch Software with a bogus app and Software will display a notification saying the app is not supported.

Check the journal or the stderr output and look for the invalid cast in the bad case: 'invalid cast from 'GtkFlowBoxChild' to 'GisSnapTile''

[ Fix ]

In the callback which handles clicks, check if we're clicking a blank tile or a real one and simply return in the blank case.

[ Regression potential ]

Perhaps this could break clicking of *any* tile, if we misdetect which is real and always return false there. Double check that clicking 'good' tiles still launches Software to the right page.

[ Original report ]

The error tracker suggests it's unhappy there but the stacktrace generation is failing
https://errors.ubuntu.com/problem/1fd67017b65f8d00055dc85eaf7c43195464c467

Browsing the journal extract on the reports there is a warning which seems likely to be a distro patch issue at least

'invalid cast from 'GtkFlowBoxChild' to 'GisSnapTile''

tags: added: arm64 groovy rls-gg-incoming
Changed in gnome-initial-setup (Ubuntu):
importance: Undecided → High
Revision history for this message
Iain Lane (laney) wrote :

I looked at the code. I think in on_app_clicked() (in the distro patch) we need to check the child is a snap tile, or do nothing if not.

Will check this tomorrow.

Revision history for this message
Iain Lane (laney) wrote :

at least to fix the invalid cast, but it seems likely this could lead to a crash too.

Revision history for this message
Iain Lane (laney) wrote :
Download full text (6.2 KiB)

(gnome-initial-setup:69424): InitialSetup-WARNING **: 11:35:06.795: Failed to send report: metrics from this machine have already been reported and can be found in: /home/laney/.cache/ubuntu-report/ubuntu.20.10
[New Thread 0xffff337fdb60 (LWP 69455)]
[Thread 0xffff337fdb60 (LWP 69455) exited]
[Thread 0xffffa0afab60 (LWP 69440) exited]

(gnome-initial-setup:69424): GLib-GObject-WARNING **: 11:35:29.760: invalid cast from 'GtkFlowBoxChild' to 'GisSnapTile'

Thread 1 "gnome-initial-s" received signal SIGSEGV, Segmentation fault.
0x0000fffff361a8b4 in SNAPD_IS_SNAP (ptr=0xaaaaab742b90) at ../snapd-glib/snapd-snap.h:25
25 ../snapd-glib/snapd-snap.h: No such file or directory.
(gdb) bt
#0 0x0000fffff361a8b4 in SNAPD_IS_SNAP (ptr=0xaaaaab742b90) at ../snapd-glib/snapd-snap.h:25
#1 snapd_snap_get_name (self=0xaaaaab742b90) at ../snapd-glib/snapd-snap.c:555
#2 0x0000aaaaaaaed7c0 in on_app_clicked (flow_box=<optimised out>, child=child@entry=0xaaaaab604e30, user_data=<optimised out>) at ../gnome-initial-setup/pages/apps/gis-apps-page.c:460
#3 0x0000fffff7c06a20 in g_cclosure_marshal_VOID__OBJECTv (closure=0xaaaaab67afe0, return_value=<optimised out>, instance=0xaaaaab34e6c0, args=..., marshal_data=<optimised out>,
    n_params=<optimised out>, param_types=<optimised out>) at ../../../gobject/gmarshal.c:1910
#4 0x0000fffff7c032b4 in _g_closure_invoke_va (closure=<optimised out>, return_value=<optimised out>, instance=<optimised out>, args=..., n_params=<optimised out>, param_types=<optimised out>)
    at ../../../gobject/gclosure.c:873
#5 0x0000fffff7c1df24 in g_signal_emit_valist (instance=0xaaaaab34e6c0, signal_id=<optimised out>, detail=<optimised out>, var_args=...) at ../../../gobject/gsignal.c:3403
#6 0x0000fffff7c1e170 in g_signal_emit (instance=<optimised out>, signal_id=<optimised out>, detail=<optimised out>) at ../../../gobject/gsignal.c:3550
#7 0x0000fffff759bfa8 in ?? () from /lib/aarch64-linux-gnu/libgtk-3.so.0
#8 0x0000fffff7c032b4 in _g_closure_invoke_va (closure=<optimised out>, return_value=<optimised out>, instance=<optimised out>, args=..., n_params=<optimised out>, param_types=<optimised out>)
    at ../../../gobject/gclosure.c:873
#9 0x0000fffff7c1df24 in g_signal_emit_valist (instance=0xaaaaab1fa2c0, signal_id=<optimised out>, detail=<optimised out>, var_args=...) at ../../../gobject/gsignal.c:3403
#10 0x0000fffff7c1e170 in g_signal_emit (instance=<optimised out>, signal_id=<optimised out>, detail=<optimised out>) at ../../../gobject/gsignal.c:3550
#11 0x0000fffff7391dd0 in ?? () from /lib/aarch64-linux-gnu/libgtk-3.so.0
#12 0x0000fffff7c066dc in g_cclosure_marshal_VOID__BOXEDv (closure=0xaaaaab1f5fd0, return_value=<optimised out>, instance=0xaaaaab1fa2c0, args=..., marshal_data=0xfffff7391d14,
    n_params=<optimised out>, param_types=0xaaaaaacdffa0) at ../../../gobject/gmarshal.c:1686
#13 0x0000fffff7c01484 in g_type_class_meta_marshalv (closure=<optimised out>, return_value=<optimised out>, instance=<optimised out>,
    args=<error reading variable: Cannot access memory at address 0x4727206d6f726620>, marshal_data=<optimised out>, n_params=<optimised out>, param_types=<optimised out>)
    at ../../../gobject/gclosu...

Read more...

Revision history for this message
Iain Lane (laney) wrote :

It also crashes on other architectures, this is not arm specific.

summary: - Segfault on arm
+ gnome-initial-setup SIGSEGV in snapd_snap_get_name()
Changed in gnome-initial-setup (Ubuntu):
status: New → In Progress
Changed in gnome-initial-setup (Ubuntu Focal):
status: New → In Progress
Changed in gnome-initial-setup (Ubuntu Groovy):
status: New → In Progress
Changed in gnome-initial-setup (Ubuntu):
assignee: nobody → Iain Lane (laney)
Changed in gnome-initial-setup (Ubuntu Focal):
assignee: nobody → Iain Lane (laney)
Changed in gnome-initial-setup (Ubuntu Groovy):
assignee: nobody → Iain Lane (laney)
Iain Lane (laney)
tags: removed: rls-gg-incoming
Revision history for this message
Iain Lane (laney) wrote :

All uploaded to the queues, cheers.

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Sebastien, or anyone else affected,

Accepted gnome-initial-setup into groovy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gnome-initial-setup/3.38.1-1ubuntu2~20.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-groovy to verification-done-groovy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-groovy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in gnome-initial-setup (Ubuntu Groovy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-groovy
Changed in gnome-initial-setup (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Sebastien, or anyone else affected,

Accepted gnome-initial-setup into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gnome-initial-setup/3.36.2-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in gnome-initial-setup (Ubuntu Focal):
importance: Undecided → High
Changed in gnome-initial-setup (Ubuntu Groovy):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-initial-setup - 3.38.1-1ubuntu2

---------------
gnome-initial-setup (3.38.1-1ubuntu2) hirsute; urgency=medium

  * Don't cast a GtkLabel into a GisSnapTile.
    We populate a GtkFlowBox with tiles representing features snaps. There
    might not be exactly enough to fill up the entire number of rows, so the
    remaining cells are filled up with blank space, which is actually a
    GtkLabel.
    When clicking these tiles, we launch Software to the application that's
    been clicked. That is done by looking inside the tile to find its
    associated snap.
    We try to do this 'looking inside' for the blank tiles too. But they
    aren't snaps at all - as mentioned above, they are GtkLabels. We illegally
    cast to a snap tile, and then operate on it. At best, this leads to a
    warning on stderr and Software getting spawned to display a nonsense
    application. At worst we crash.
    Fix this by altering the callback to check if we have clicked on a snap or
    not. In the not case, simply return and do nothing. (LP: #1901548)

 -- Iain Lane <email address hidden> Tue, 27 Oct 2020 17:57:59 +0000

Changed in gnome-initial-setup (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Iain Lane (laney) wrote :

I verified 3.38.1-1ubuntu2~20.10.1 and 3.36.2-0ubuntu2 and they both worked for me, and I didn't notice any regressions.

tags: added: verification-done verification-done-focal verification-done-groovy
removed: verification-needed verification-needed-focal verification-needed-groovy
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gnome-initial-setup has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-initial-setup - 3.36.2-0ubuntu2

---------------
gnome-initial-setup (3.36.2-0ubuntu2) focal; urgency=medium

  * control, gbp.conf: Update Vcs info for focal
  * Don't cast a GtkLabel into a GisSnapTile.
    We populate a GtkFlowBox with tiles representing features snaps. There
    might not be exactly enough to fill up the entire number of rows, so the
    remaining cells are filled up with blank space, which is actually a
    GtkLabel.
    When clicking these tiles, we launch Software to the application that's
    been clicked. That is done by looking inside the tile to find its
    associated snap.
    We try to do this 'looking inside' for the blank tiles too. But they
    aren't snaps at all - as mentioned above, they are GtkLabels. We illegally
    cast to a snap tile, and then operate on it. At best, this leads to a
    warning on stderr and Software getting spawned to display a nonsense
    application. At worst we crash.
    Fix this by altering the callback to check if we have clicked on a snap or
    not. In the not case, simply return and do nothing. (LP: #1901548)

 -- Iain Lane <email address hidden> Tue, 27 Oct 2020 18:11:09 +0000

Changed in gnome-initial-setup (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-initial-setup - 3.38.1-1ubuntu2~20.10.1

---------------
gnome-initial-setup (3.38.1-1ubuntu2~20.10.1) groovy; urgency=medium

  * Backport from hirsute to groovy for SRU.
  * control, gbp.conf: Update git branch to ubuntu/groovy for SRU

gnome-initial-setup (3.38.1-1ubuntu2) hirsute; urgency=medium

  * Don't cast a GtkLabel into a GisSnapTile.
    We populate a GtkFlowBox with tiles representing features snaps. There
    might not be exactly enough to fill up the entire number of rows, so the
    remaining cells are filled up with blank space, which is actually a
    GtkLabel.
    When clicking these tiles, we launch Software to the application that's
    been clicked. That is done by looking inside the tile to find its
    associated snap.
    We try to do this 'looking inside' for the blank tiles too. But they
    aren't snaps at all - as mentioned above, they are GtkLabels. We illegally
    cast to a snap tile, and then operate on it. At best, this leads to a
    warning on stderr and Software getting spawned to display a nonsense
    application. At worst we crash.
    Fix this by altering the callback to check if we have clicked on a snap or
    not. In the not case, simply return and do nothing. (LP: #1901548)

 -- Iain Lane <email address hidden> Tue, 27 Oct 2020 18:03:16 +0000

Changed in gnome-initial-setup (Ubuntu Groovy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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