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]
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/