snap refresh hangs on arm architecture

Bug #1664368 reported by Ling Gao
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Undecided
Unassigned
linux-raspi2 (Ubuntu)
Fix Released
Undecided
Paolo Pisati

Bug Description

I am a snap developer. And we are testing our snap now the found that snap refresh does not work on a Raspberry Pi 2 and 3. It works on an x86 machines though. Here is the detail:
 I ran "snap refresh --devmode --edge mysnapname" on my rpi2 to pick up the latest snap. It downloaded the new snap, and sometime after displaying [|] Mount snap "mysnapname" (53) it threw me into kdb on the console. After rebooting, the new snap seems to be working ok. The same thing happen on rpi3.
Image:
pi2:
    IMAGE="ubuntu-16.04-preinstalled-server-armhf+raspi2.img"
    URL="http://cdimage.ubuntu.com/ubuntu/releases/16.04/release/$IMAGE.xz"
pi3:
    IMAGE="ubuntu-16.04-preinstalled-server-armhf+raspi3.img"
    URL="http://www.finnie.org/software/raspberrypi/ubuntu-rpi3/$IMAGE.xz"

Kernel debugging session output for rpi3:
[336032.404195] Unable to handle kernel NULL pointer dereference at virtual address 00000008
[336032.417227] pgd = b66fc000
[336032.422448] [00000008] *pgd=21359831, *pte=00000000, *ppte=00000000
[336032.432174] Internal error: Oops: 17 [#1] SMP ARM

Entering kdb (current=0xa11aca40, pid 7068) on processor 0 Oops: (null)
due to oops @ 0x802dad7c
CPU: 0 PID: 7068 Comm: mount Not tainted 4.4.0-1009-raspi2 #10-Ubuntu
Hardware name: BCM2709
task: a11aca40 ti: a7d5e000 task.ti: a7d5e000
PC is at propagate_one+0xc4/0x1b0
LR is at 0xb8be6f00
pc : [<802dad7c>] lr : [] psr: 800d0013
sp : a7d5fe40 ip : 000000de fp : a7d5fe5c
r10: 00000000 r9 : a1245cc0 r8 : b8f2f300
r7 : a7d5fe88 r6 : 00000000 r5 : b8f2f300 r4 : 81041f98
r3 : 00000001 r2 : 00000000 r1 : b8f2f540 r0 : 00000000
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5383d Table: 366fc06a DAC: 00000055
CPU: 0 PID: 7068 Comm: mount Not tainted 4.4.0-1009-raspi2 #10-Ubuntu
Hardware name: BCM2709
[<80111f34>] (unwind_backtrace) from [<8010d198>] (show_stack+0x20/0x24)
[<8010d198>] (show_stack) from [<8055412c>] (dump_stack+0xc8/0x10c)
[<8055412c>] (dump_stack) from [<80109b3c>] (show_regs+0x1c/0x20)
[<80109b3c>] (show_regs) from [<801e36b0>] (kdb_main_loop+0x348/0x7b0)
[<801e36b0>] (kdb_main_loop) from [<801e6818>] (kdb_stub+0x2d0/0x528)
[<801e6818>] (kdb_stub) from [<801dbd30>] (kgdb_cpu_enter+0x460/0x7f0)
[<801dbd30>] (kgdb_cpu_enter) from [<801dc33c>] (kgdb_handle_exception+0x124/0x234)
[<801dc33c>] (kgdb_handle_exception) from [<80111234>] (kgdb_notify+0x40/0x90)
[<80111234>] (kgdb_notify) from [<80146528>] (notifier_call_chain+0x54/0x94)
[<80146528>] (notifier_call_chain) from [<801467d0>] (notify_die+0x58/0x78)
[<801467d0>] (notify_die) from [<8010d2c8>] (die+0x12c/0x498)
[<8010d2c8>] (die) from [<8011b520>] (__do_kernel_fault.part.0+0x74/0x1f4)
[<8011b520>] (__do_kernel_fault.part.0) from [<809ce190>] (do_page_fault+0x23c/0x3b8)
[<809ce190>] (do_page_fault) from [<80101230>] (do_DataAbort+0x58/0xe8)
[<80101230>] (do_DataAbort) from [<809cd7dc>] (__dabt_svc+0x3c/0x60)
Exception stack(0xa7d5fdf0 to 0xa7d5fe38)
fde0: 00000000 b8f2f540 00000000 00000001
fe00: 81041f98 b8f2f300 00000000 a7d5fe88 b8f2f300 a1245cc0 00000000 a7d5fe5c
fe20: 000000de a7d5fe40 b8be6f00 802dad7c 800d0013 ffffffff
[<809cd7dc>] (__dabt_svc) from [<802dad7c>] (propagate_one+0xc4/0x1b0)
[<802dad7c>] (propagate_one) from [<802db22c>] (propagate_mnt+0x128/0x154)
[<802db22c>] (propagate_mnt) from [<802cacb8>] (attach_recursive_mnt+0x16c/0x284)
[<802cacb8>] (attach_recursive_mnt) from [<802cae3c>] (graft_tree+0x6c/0x9c)
[<802cae3c>] (graft_tree) from [<802caf08>] (do_add_mount+0x9c/0xf0)
[<802caf08>] (do_add_mount) from [<802cbef4>] (do_mount+0x284/0xd70)
[<802cbef4>] (do_mount) from [<802ccdcc>] (SyS_mount+0xb4/0xf4)
[<802ccdcc>] (SyS_mount) from [<80108d00>] (ret_fast_syscall+0x0/0x1c)

Revision history for this message
Paolo Pisati (p-pisati) wrote :

Kernel version?

Please use the rpi2 16.04 image you linked above, dist-upgrade it to the latest kernel, reboot, retry and report.

Changed in snapd:
assignee: nobody → Paolo Pisati (p-pisati)
Paolo Pisati (p-pisati)
Changed in linux-raspi2 (Ubuntu):
assignee: nobody → Paolo Pisati (p-pisati)
Changed in snapd:
assignee: Paolo Pisati (p-pisati) → nobody
Revision history for this message
Ling Gao (linggao) wrote :

Kernel version is: 4.4.0-1009-raspi2
Linux version 4.4.0-1009-raspi2 (buildd@kishi11) (gcc version 5.3.1 20160413 (Ubuntu/Linaro 5.3.1-14ubuntu2) ) #10-Ubuntu SMP Tue Apr 19 19:51:04 UTC 2016

Revision history for this message
Ling Gao (linggao) wrote :

I ran the following commands to upgrade:
apt-get update
apt-get upgrade
apt-get dist-upgrade
Then rebooted.
snap refresh died when Mounting. Same problem.
Question: is this the right way to upgrade the kernel? What is the version of the latest kernel?

Revision history for this message
Loïc Minier (lool) wrote :

This shows RPi kernel for Ubuntu 16.04 versions:
https://launchpad.net/ubuntu/+source/linux-raspi2

Latest in xenial-updates is 4.4.0-1042.49, so you seem to have an older version.

Could you check that you have xenial-updates in your /etc/apt/sources.list*?

What's the reported .deb version with dpkg -l linux-image\*|grep ^ii

If you have the latest deb but not the latest kernel installed, this might indicate a non-working flash-kernel upgrade

Revision history for this message
Ling Gao (linggao) wrote :

#cat /etc/apt/sources.list*
deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse

# dpkg -l linux-image\*|grep ^ii
ii linux-image-4.4.0-1009-raspi2 4.4.0-1009.10 armhf Linux kernel image for version 4.4.0 on ARM (hard float) SMP

Revision history for this message
Ling Gao (linggao) wrote :

# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-firmware linux-firmware-raspi2 linux-headers-raspi2 linux-image-raspi2 linux-raspi2
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Revision history for this message
Ling Gao (linggao) wrote :

# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-firmware linux-firmware-raspi2 linux-headers-raspi2 linux-image-raspi2 linux-raspi2
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Revision history for this message
Ling Gao (linggao) wrote :

I got the rpi2 upgraded to the latest kernel version 4.4.0-1042-raspi2, rebooted the it and the snap refresh works now.
Here is what I did to upgrade the kernel.
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get upgrade linux-firmware linux-firmware-raspi2 linux-headers-raspi2 linux-image-raspi2 linux-raspi2

I will take a look at our rpi2 and 3 image build process to see how to get the kernel updated in the image.
Thanks for all the help.

Revision history for this message
Ling Gao (linggao) wrote :

We have built new images for pi2 and pi3 with the latest kernel (version 4.4.0-1042-raspi2 or 3) and the snap refresh works now. Thanks for the help. This bug can be closed now. Thanks again.

Paolo Pisati (p-pisati)
Changed in linux-raspi2 (Ubuntu):
status: New → Fix Released
Changed in snapd:
status: New → 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.