我有一台 Raspberry Pi 3 model b,操作系统是 Ubuntu Mate 16,之前一切都运行良好。
今天我启动了 rpi,我发现我面临一个问题,该问题在启动期间由于加载内核模块时崩溃而发生,ssh 服务已启用,但即使我输入了正确的凭据,我 100% 确定是正确的,现在 ssh 说它们不正确,而且 vnc 服务也没有启动。
当我将 rpi 插入显示器时,我看到控制台上循环显示一条消息:
“未处理的预取中止:断点调试异常(0x002)位于 0x7447beda”
这是系统日志的一部分,如下所示:
Mar 18 04:20:45 x systemd[1]: Received SIGRTMIN+21 from PID 206 (plymouthd).
Mar 18 04:20:45 x systemd[1]: Started Light Display Manager.
Mar 18 04:20:45 x NetworkManager[642]: <info> [1521346845.8966] device (wlan0): supplicant interface state: ready -> inactive
Mar 18 04:20:45 x kernel: [ 37.431450] Under-voltage detected! (0x00050005)
Mar 18 04:20:46 x snapd[647]: sizeclass=16 NumSizeClasses=2_
Mar 18 04:20:46 x ModemManager[644]: <info> Couldn't check support for device at '/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1': not supported by any plugin
Mar 18 04:20:46 x snapd[647]: fatal error: InitSizes - bad NumSizeClasses
Mar 18 04:20:46 x snapd[647]: runtime: panic before malloc heap initialized
Mar 18 04:20:46 x snapd[647]: runtime stack:
Mar 18 04:20:46 x snapd[647]: runtime.throw(0xfeaea8, 0x1e)
Mar 18 04:20:46 x snapd[647]: #011/usr/lib/go-1.6/src/runtime/panic.go:2? +0x80 fp=0x7ea3faa0 sp=0x7ea3fa94
Mar 18 04:20:46 x snapd[647]: runtime.initSizes()
Mar 18 04:20:46 x snapd[647]: #011/usr/lib/go-1.6/src/runtime/msize.go:2<8A> +0x2fc fp=0x7ea3fac8 sp=0x7ea3faa0
Mar 18 04:20:46 x snapd[647]: runtime.mallocinit()
Mar 18 04:20:46 x snapd[647]: #011/usr/lib/go-1.6/src/runtime/malloc.go:2<F5> +0x1c fp=0x7ea3fb54 sp=0x7ea3fac8
Mar 18 04:20:46 x snapd[647]: runtime.schedinit()
Mar 18 04:20:46 x snapd[647]: #011/usr/lib/go-1.6/src/runtime/proc.go:2<CD> +0x5c fp=0x7ea3fb78 sp=0x7ea3fb54
Mar 18 04:20:46 x snapd[647]: runtime.rt0_go(0x7ea3fd14, 0x76f33000, 0x7ea3fd14, 0x1, 0x6fe718, 0x76fb8000, 0xaaaaaaab, 0xc4b6dc5b, 0xccf33fe6, 0x12c, ...)
Mar 18 04:20:46 x snapd[647]: #011/usr/lib/go-1.6/src/runtime/asm_arm.s:2Y +0x8c fp=0x7ea3fbb8 sp=0x7ea3fb78
Mar 18 04:20:46 x systemd[1]: snapd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Mar 18 04:20:46 x systemd[1]: Failed to start Snappy daemon.
Mar 18 04:20:46 x systemd[1]: snapd.service: Unit entered failed state.
Mar 18 04:20:46 x systemd[1]: snapd.service: Failed with result 'exit-code'.
Mar 18 04:20:47 x kernel: [ 38.566328] Unhandled prefetch abort: breakpoint debug exception (0x002) at 0x7441ceda
Mar 18 04:20:47 x systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Mar 18 04:20:47 x systemd[1]: Stopped Snappy daemon.
Mar 18 04:20:47 x systemd[1]: Starting Snappy daemon...
Mar 18 04:20:50 x snapd[835]: sizeclass=16 NumSizeClasses=2_
Mar 18 04:20:50 x snapd[835]: fatal error: InitSizes - bad NumSizeClasses
Mar 18 04:20:50 x snapd[835]: runtime: panic before malloc heap initialized
Mar 18 04:20:50 x snapd[835]: runtime stack:
Mar 18 04:20:50 x snapd[835]: runtime.throw(0x1026ea8, 0x1e)
Mar 18 04:20:50 x snapd[835]: #011/usr/lib/go-1.6/src/runtime/panic.go:2? +0x80 fp=0x7e803aa0 sp=0x7e803a94
Mar 18 04:20:50 x snapd[835]: runtime.initSizes()
Mar 18 04:20:50 x snapd[835]: #011/usr/lib/go-1.6/src/runtime/msize.go:2<8A> +0x2fc fp=0x7e803ac8 sp=0x7e803aa0
Mar 18 04:20:50 x snapd[835]: runtime.mallocinit()
Mar 18 04:20:50 x snapd[835]: #011/usr/lib/go-1.6/src/runtime/malloc.go:2<F5> +0x1c fp=0x7e803b54 sp=0x7e803ac8
Mar 18 04:20:50 x snapd[835]: runtime.schedinit()
Mar 18 04:20:50 x snapd[835]: #011/usr/lib/go-1.6/src/runtime/proc.go:2<CD> +0x5c fp=0x7e803b78 sp=0x7e803b54
Mar 18 04:20:50 x snapd[835]: runtime.rt0_go(0x7e803d14, 0x76f1f000, 0x7e803d14, 0x1, 0x73a718, 0x76fa4000, 0xaaaaaaab, 0x3b4e3c89, 0x332adf34, 0x12c, ...)
Mar 18 04:20:50 x snapd[835]: #011/usr/lib/go-1.6/src/runtime/asm_arm.s:2Y +0x8c fp=0x7e803bb8 sp=0x7e803b78
Mar 18 04:20:50 x systemd[1]: snapd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Mar 18 04:20:50 x systemd[1]: Failed to start Snappy daemon.
Mar 18 04:20:50 x systemd[1]: snapd.service: Unit entered failed state.
Mar 18 04:20:50 x systemd[1]: snapd.service: Failed with result 'exit-code'.
Mar 18 04:20:50 x systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Mar 18 04:20:50 x systemd[1]: Stopped Snappy daemon.
Mar 18 04:20:50 x systemd[1]: Starting Snappy daemon...
Mar 18 04:20:52 x hciattach[625]: Initialization timed out.
Mar 18 04:20:52 x hciattach[625]: bcm43xx_init
Mar 18 04:20:52 x hciattach[625]: Set Controller UART speed to 921600 bit/s
Mar 18 04:20:52 x hciattach[625]: Flash firmware /lib/firmware/BCM43430A1.hcd
Mar 18 04:20:52 x systemd[1]: hciuart.service: Control process exited, code=exited status=1
Mar 18 04:20:52 x systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Mar 18 04:20:52 x systemd[1]: hciuart.service: Unit entered failed state.
Mar 18 04:20:52 x systemd[1]: hciuart.service: Failed with result 'exit-code'.
Mar 18 04:20:53 x snapd[837]: sizeclass=16 NumSizeClasses=2_
Mar 18 04:20:53 x snapd[837]: fatal error: InitSizes - bad NumSizeClasses
Mar 18 04:20:53 x snapd[837]: runtime: panic before malloc heap initialized
Mar 18 04:20:53 x snapd[837]: runtime stack:
Mar 18 04:20:53 x snapd[837]: runtime.throw(0x1024ea8, 0x1e)
Mar 18 04:20:53 x snapd[837]: #011/usr/lib/go-1.6/src/runtime/panic.go:2? +0x80 fp=0x7eb44aa0 sp=0x7eb44a94
Mar 18 04:20:53 x snapd[837]: runtime.initSizes()
在 auth.log 中
Mar 18 04:20:24 x systemd-logind[645]: New seat seat0.
Mar 18 04:20:48 x sshd[1271]: Server listening on 0.0.0.0 port 22.
Mar 18 04:20:48 x sshd[1271]: Server listening on :: port 22.
Mar 18 04:35:41 x sshd[1271]: Received SIGHUP; restarting.
Mar 18 04:35:41 x sshd[1271]: Server listening on 0.0.0.0 port 22.
Mar 18 04:35:41 x sshd[1271]: Server listening on :: port 22.
Mar 18 04:35:53 x sshd[1271]: Received SIGHUP; restarting.
Mar 18 04:35:53 x sshd[1271]: Server listening on 0.0.0.0 port 22.
Mar 18 04:35:53 x sshd[1271]: Server listening on :: port 22.
Mar 18 05:01:01 x CRON[3341]: PAM unable to dlopen(pam_unix.so): /lib/security/pam_unix.so: cannot open shared object file: No such file or directory
Mar 18 05:01:01 x CRON[3341]: PAM adding faulty module: pam_unix.so
Mar 18 05:01:01 x CRON[3341]: PAM unable to dlopen(pam_permit.so): /lib/security/pam_permit.so: cannot open shared object file: No such file or directory
Mar 18 05:01:01 x CRON[3341]: PAM adding faulty module: pam_permit.so
Mar 18 05:01:01 x CRON[3341]: PAM unable to dlopen(pam_loginuid.so): /lib/security/pam_loginuid.so: cannot open shared object file: No such file or directory
Mar 18 05:01:01 x CRON[3341]: PAM adding faulty module: pam_loginuid.so
Mar 18 05:01:01 x CRON[3341]: PAM unable to dlopen(pam_env.so): /lib/security/pam_env.so: cannot open shared object file: No such file or directory
Mar 18 05:01:01 x CRON[3341]: PAM adding faulty module: pam_env.so
Mar 18 05:01:01 x CRON[3341]: PAM unable to dlopen(pam_umask.so): /lib/security/pam_umask.so: cannot open shared object file: No such file or directory
Mar 18 05:01:01 x CRON[3341]: PAM adding faulty module: pam_umask.so
Mar 18 05:01:01 x CRON[3341]: PAM unable to dlopen(pam_limits.so): /lib/security/pam_limits.so: cannot open shared object file: No such file or directory
Mar 18 05:01:01 x CRON[3341]: PAM adding faulty module: pam_limits.so
Mar 18 05:17:01 x CRON[3905]: PAM unable to dlopen(pam_unix.so): /lib/security/pam_unix.so: cannot open shared object file: No such file or directory
Mar 18 05:17:01 x CRON[3905]: PAM adding faulty module: pam_unix.so
Mar 18 05:17:01 x CRON[3905]: PAM unable to dlopen(pam_permit.so): /lib/security/pam_permit.so: cannot open shared object file: No such file or directory
Mar 18 05:17:01 x CRON[3905]: PAM adding faulty module: pam_permit.so
Mar 18 05:17:01 x CRON[3905]: PAM unable to dlopen(pam_loginuid.so): /lib/security/pam_loginuid.so: cannot open shared object file: No such file or directory
Mar 18 05:17:01 x CRON[3905]: PAM adding faulty module: pam_loginuid.so
Mar 18 05:17:01 x CRON[3905]: PAM unable to dlopen(pam_env.so): /lib/security/pam_env.so: cannot open shared object file: No such file or directory
Mar 18 05:17:01 x CRON[3905]: PAM adding faulty module: pam_env.so
Mar 18 05:17:01 x CRON[3905]: PAM unable to dlopen(pam_umask.so): /lib/security/pam_umask.so: cannot open shared object file: No such file or directory
Mar 18 05:17:01 x CRON[3905]: PAM adding faulty module: pam_umask.so
Mar 18 05:17:01 x CRON[3905]: PAM unable to dlopen(pam_limits.so): /lib/security/pam_limits.so: cannot open shared object file: No such file or directory
Mar 18 05:17:01 x CRON[3905]: PAM adding faulty module: pam_limits.so
Mar 18 06:01:01 x CRON[5443]: PAM unable to dlopen(pam_unix.so): /lib/security/pam_unix.so: cannot open shared object file: No such file or directory
Mar 18 06:01:01 x CRON[5443]: PAM adding faulty module: pam_unix.so
Mar 18 06:01:01 x CRON[5443]: PAM unable to dlopen(pam_permit.so): /lib/security/pam_permit.so: cannot open shared object file: No such file or directory
Mar 18 06:01:01 x CRON[5443]: PAM adding faulty module: pam_permit.so
正如您所看到的,snapd 崩溃并自行重启,导致系统不稳定。
答案1
正如其他人在评论中提到的Mar 18 04:20:45 x kernel: [ 37.431450] Under-voltage detected! (0x00050005)
那样。从 USB 端口拔下耗电设备可能会解决您的问题。 Pi 电源无法很好地为 Pi 和 USB 设备供电。当尝试通过 USB 端口为外部驱动器供电时,这尤其成问题,但其他耗电设备也会导致此问题。我见过的大多数 Pi PSU 提供的电流都低于 3 安培。虽然 USB 端口通常消耗1/2 至 1 安培之间这可能会迅速累积并导致 Pi 出现问题。根据规格Raspberry Pi 3 Model B 有一个推荐的 PSU,可提供 2.5A 电流,从 USB 端口的最大功耗为 1.2A,超过设备的电气规格甚至达到最大值都会导致问题。电压骤降即使只有 10% 也会引起问题。虽然这个问题可能被视为题外话,但我还是决定保留它,因为它可能对网站的未来用户有用。