snapd panic: runtime error: slice bounds out of range [2:1]
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I installed a local snap (cloud-
$ sudo systemctl restart snapd
Jan 20 13:20:14 ip-172-31-25-80 systemd[1]: Starting Snap Daemon...
Jan 20 13:20:14 ip-172-31-25-80 snapd[9941]: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:14 ip-172-31-25-80 snapd[9941]: overlord.go:268: Acquiring state lock file
Jan 20 13:20:14 ip-172-31-25-80 snapd[9941]: overlord.go:273: Acquired state lock file
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: daemon.go:247: started snapd/2.58 (series 16; classic) ubuntu/18.04 (amd64) linux/5.
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: daemon.go:340: adjusting startup timeout by 1m0s (pessimistic estimate of 30s plus 5s per snap)
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: Started Snap Daemon.
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: panic: runtime error: slice bounds out of range [2:1]
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: goroutine 53 [running]:
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: github.
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: /build/
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: github.
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: /build/
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: gopkg.in/
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: /build/
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: created by gopkg.in/
Jan 20 13:20:15 ip-172-31-25-80 snapd[9941]: /build/
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Main process exited, code=exited, status=
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Failed with result 'exit-code'.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Scheduled restart job, restart counter is at 1.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: Stopped Snap Daemon.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: Starting Snap Daemon...
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: overlord.go:268: Acquiring state lock file
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: overlord.go:273: Acquired state lock file
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: daemon.go:247: started snapd/2.58 (series 16; classic) ubuntu/18.04 (amd64) linux/5.
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: daemon.go:340: adjusting startup timeout by 1m0s (pessimistic estimate of 30s plus 5s per snap)
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: Started Snap Daemon.
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: panic: runtime error: slice bounds out of range [2:1]
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: goroutine 48 [running]:
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: github.
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: /build/
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: github.
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: /build/
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: gopkg.in/
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: /build/
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: created by gopkg.in/
Jan 20 13:20:15 ip-172-31-25-80 snapd[10051]: /build/
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Main process exited, code=exited, status=
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Failed with result 'exit-code'.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: snapd.service: Scheduled restart job, restart counter is at 2.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: Stopped Snap Daemon.
Jan 20 13:20:15 ip-172-31-25-80 systemd[1]: Starting Snap Daemon...
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: overlord.go:268: Acquiring state lock file
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: overlord.go:273: Acquired state lock file
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: daemon.go:247: started snapd/2.58 (series 16; classic) ubuntu/18.04 (amd64) linux/5.
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: daemon.go:340: adjusting startup timeout by 1m0s (pessimistic estimate of 30s plus 5s per snap)
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: Started Snap Daemon.
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: panic: runtime error: slice bounds out of range [2:1]
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: goroutine 55 [running]:
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: github.
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: /build/
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: github.
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: /build/
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: gopkg.in/
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: /build/
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: created by gopkg.in/
Jan 20 13:20:16 ip-172-31-25-80 snapd[10154]: /build/
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: snapd.service: Main process exited, code=exited, status=
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: snapd.service: Failed with result 'exit-code'.
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: snapd.service: Scheduled restart job, restart counter is at 3.
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: Stopped Snap Daemon.
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: Starting Snap Daemon...
Jan 20 13:20:16 ip-172-31-25-80 snapd[10253]: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:16 ip-172-31-25-80 snapd[10253]: overlord.go:268: Acquiring state lock file
Jan 20 13:20:16 ip-172-31-25-80 snapd[10253]: overlord.go:273: Acquired state lock file
Jan 20 13:20:16 ip-172-31-25-80 snapd[10253]: daemon.go:247: started snapd/2.58 (series 16; classic) ubuntu/18.04 (amd64) linux/5.
Jan 20 13:20:16 ip-172-31-25-80 snapd[10253]: daemon.go:340: adjusting startup timeout by 1m0s (pessimistic estimate of 30s plus 5s per snap)
Jan 20 13:20:16 ip-172-31-25-80 snapd[10253]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:16 ip-172-31-25-80 systemd[1]: Started Snap Daemon.
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: panic: runtime error: slice bounds out of range [2:1]
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: goroutine 31 [running]:
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: github.
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: /build/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: github.
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: /build/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: gopkg.in/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: /build/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: created by gopkg.in/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10253]: /build/
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Main process exited, code=exited, status=
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Failed with result 'exit-code'.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Scheduled restart job, restart counter is at 4.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: Stopped Snap Daemon.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: Starting Snap Daemon...
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: overlord.go:268: Acquiring state lock file
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: overlord.go:273: Acquired state lock file
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: daemon.go:247: started snapd/2.58 (series 16; classic) ubuntu/18.04 (amd64) linux/5.
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: daemon.go:340: adjusting startup timeout by 1m0s (pessimistic estimate of 30s plus 5s per snap)
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: Started Snap Daemon.
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: panic: runtime error: slice bounds out of range [2:1]
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: goroutine 54 [running]:
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: github.
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: /build/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: github.
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: /build/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: gopkg.in/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: /build/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: created by gopkg.in/
Jan 20 13:20:17 ip-172-31-25-80 snapd[10348]: /build/
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Main process exited, code=exited, status=
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Failed with result 'exit-code'.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Scheduled restart job, restart counter is at 5.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: Stopped Snap Daemon.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Start request repeated too quickly.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Failed with result 'exit-code'.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: Failed to start Snap Daemon.
Jan 20 13:20:17 ip-172-31-25-80 systemd[1]: snapd.service: Triggering OnFailure= dependencies.
This is with:
$ apt-cache policy snapd
snapd:
Installed: 2.57.5+
Candidate: 2.57.5+
Version table:
*** 2.57.5+
500 http://
500 http://
100 /var/lib/
2.32.5+18.04 500
500 http://
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: snapd 2.57.5+
ProcVersionSign
Uname: Linux 5.4.0-1093-aws x86_64
ApportVersion: 2.20.9-0ubuntu7.28
Architecture: amd64
Date: Fri Jan 20 13:14:34 2023
Ec2AMI: ami-05596fb52c3
Ec2AMIManifest: (unknown)
Ec2Availability
Ec2InstanceType: m5a.large
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
SourcePackage: snapd
UpgradeStatus: No upgrade log present (probably fresh install)
A simple reproducer on that machine is:
root@ip- 172-31- 25-80:~ # /usr/lib/ snapd/snapd -h 4.0-1093- aws.
AppArmor status: apparmor is enabled and all features are available
2023/01/20 13:23:22.763615 overlord.go:268: Acquiring state lock file
2023/01/20 13:23:22.763675 overlord.go:273: Acquired state lock file
2023/01/20 13:23:22.820441 daemon.go:247: started snapd/2.58 (series 16; classic) ubuntu/18.04 (amd64) linux/5.
2023/01/20 13:23:22.880812 daemon.go:340: adjusting startup timeout by 1m0s (pessimistic estimate of 30s plus 5s per snap)
2023/01/20 13:23:22.907182 backends.go:58: AppArmor status: apparmor is enabled and all features are available
panic: runtime error: slice bounds out of range [2:1]
goroutine 51 [running]: com/snapcore/ snapd/overlord/ snapstate. (*SnapManager) .undoLinkSnap( 0xc000086100, 0xc000335440, 0xc0000bda90, 0x0, 0x0) snapd-RQZPrz/ snapd-2. 58/overlord/ snapstate/ handlers. go:2186 +0x2167 com/snapcore/ snapd/overlord/ state.( *TaskRunner) .run.func1( 0x0, 0x0) snapd-RQZPrz/ snapd-2. 58/overlord/ state/taskrunne r.go:215 +0xca tomb%2ev2. (*Tomb) .run(0xc0000bda 90, 0xc00072ffb0) snapd-RQZPrz/ snapd-2. 58/vendor/ gopkg.in/ tomb.v2/ tomb.go: 163 +0x2d tomb%2ev2. (*Tomb) .Go snapd-RQZPrz/ snapd-2. 58/vendor/ gopkg.in/ tomb.v2/ tomb.go: 159 +0xc9
github.
/build/
github.
/build/
gopkg.in/
/build/
created by gopkg.in/
/build/