Comment 2 for bug 2003542

Revision history for this message
Thomas Bechtold (toabctl) wrote :

A simple reproducer on that machine is:

root@ip-172-31-25-80:~# /usr/lib/snapd/snapd -h
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.4.0-1093-aws.
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]:
github.com/snapcore/snapd/overlord/snapstate.(*SnapManager).undoLinkSnap(0xc000086100, 0xc000335440, 0xc0000bda90, 0x0, 0x0)
 /build/snapd-RQZPrz/snapd-2.58/overlord/snapstate/handlers.go:2186 +0x2167
github.com/snapcore/snapd/overlord/state.(*TaskRunner).run.func1(0x0, 0x0)
 /build/snapd-RQZPrz/snapd-2.58/overlord/state/taskrunner.go:215 +0xca
gopkg.in/tomb%2ev2.(*Tomb).run(0xc0000bda90, 0xc00072ffb0)
 /build/snapd-RQZPrz/snapd-2.58/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x2d
created by gopkg.in/tomb%2ev2.(*Tomb).Go
 /build/snapd-RQZPrz/snapd-2.58/vendor/gopkg.in/tomb.v2/tomb.go:159 +0xc9