升级异常分析
升级错误一, 升级百分之百,自动重启后报错.(偶发 10次里面有1次)
- 日志信息
摘要
ubi1: attached mtd3 (name "usrfs", size 64 MiB) ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096 ubi1: good PEBs: 511, bad PEBs: 1, corrupted PEBs: 0 ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128 ubi1: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 0 ubi1: available PEBs: 0, total reserved PEBs: 511, PEBs reserved for bad PEB handling: 39 ubi1: background thread "ubi_bgt1d" started, PID 929 ubi2: attaching mtd4 ubi2: scanning is finished ubi2: attached mtd4 (name "dss", size 8 MiB) ubi2: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes ubi2: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 ubi2: VID header offset: 2048 (aligned 2048), data offset: 4096 ubi2: good PEBs: 63, bad PEBs: 1, corrupted PEBs: 0 ubi2: user volume: 1, internal volumes: 1, max. volumes count: 128 ubi2: max/mean erase counter: 46/23, WL threshold: 4096, image sequence number: 0 ubi2: available PEBs: 0, total reserved PEBs: 63, PEBs reserved for bad PEB handling: 39 ubi2: background thread "ubi_bgt2d" started, PID 934 ubi3: attaching mtd5 ubi3 error: ubi_attach: PEB 473 contains corrupted VID header, and the data does not contain all 0xFF ubi3 error: ubi_attach: this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection Volume identifier header dump: magic 55424921 version 1 vol_type 1 copy_flag 0 compat 0 vol_id 0 lnum 5 data_size 0 used_ebs 0 data_pad 0 sqnum 0 hdr_crc 099286a4 Volume identifier header hexdump: hexdump of PEB 473 offset 4096, length 126976 ubi3 error: ubi_attach: PEB 474 contains corrupted VID header, and the data does not contain all 0xFF ubi3 error: ubi_attach: this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection Volume identifier header dump: magic 55424921 version 1 vol_type 1 copy_flag 0 compat 0 vol_id 0 lnum 464 data_size 0 used_ebs 0 data_pad 0 sqnum 0 hdr_crc c3301024 Volume identifier header hexdump: hexdump of PEB 474 offset 4096, length 126976 ubi3: scanning is finished ubi3 error: ubi_attach: 2 PEBs are corrupted and preserved Corrupted PEBs are: 474 473 'UBI assert failed in ubi_wl_init at 1705 (pid 936) 1=> 这里已经 assert failed 了' CPU: 0 PID: 936 Comm: ubiattach Not tainted 4.19.90 #21 Hardware name: Vendor SS928V100 DEMO Board (DT) Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x14/0x20 dump_stack+0xa8/0xcc ubi_wl_init+0x560/0x598 ubi_attach+0x41c/0x1278 ubi_attach_mtd_dev+0x4e0/0xb70 ctrl_cdev_ioctl+0x1d4/0x278 do_vfs_ioctl+0xb8/0x930 ksys_ioctl+0x44/0x90 __arm64_sys_ioctl+0x18/0x28 el0_svc_common+0x6c/0x180 el0_svc_handler+0x6c/0x88 el0_svc+0x8/0xc 'ubi3: attached mtd5 (name "oem", size 128 MiB) 1=> 但这里还在attached' ubi3: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes ubi3: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 ubi3: VID header offset: 2048 (aligned 2048), data offset: 4096 ubi3: good PEBs: 1024, bad PEBs: 0, corrupted PEBs: 2 ubi3: user volume: 1, internal volumes: 1, max. volumes count: 128 ubi3: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1540595758 ubi3: available PEBs: 0, total reserved PEBs: 1022, PEBs reserved for bad PEB handling: 40 'ubi3: background thread "ubi_bgt3d" started, PID 939 1=> 还继续启动了, 也就是内核发现了错误但是继续attach了' ----------mount /dev/mtdblock3 ---------- UBIFS (ubi1:0): background thread "ubifs_bgt1_0" started, PID 944 ... cat0 read/write error. 1 wb stable temperature 5464 wb speed 48 sucess af module initialize. nRepeat 2 HG_IST_RESET_MSG 1 sample ist ver : 2026.01.30 UBIFS error (ubi3:0 pid 1494): ubifs_read_node: bad node type (255 but expected 1) UBIFS error (ubi3:0 pid 1494): ubifs_read_node: bad node at LEB 469:0, LEB mapping status 1 Not a node, first 24 bytes: 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........................ CPU: 1 PID: 1494 Comm: gsfIpc Tainted: P O 4.19.90 #21 Hardware name: Vendor SS928V100 DEMO Board (DT) Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x14/0x20 dump_stack+0xa8/0xcc ubifs_read_node+0x1d0/0x250 ubifs_tnc_read_node+0x80/0xb0 ubifs_tnc_locate+0x1bc/0x1e8 do_readpage+0x160/0x3d0 ubifs_readpage+0x58/0x4d0 generic_file_read_iter+0x41c/0x8d8 __vfs_read+0xf8/0x158 vfs_read+0x8c/0x130 ksys_read+0x64/0xe8 __arm64_sys_read+0x14/0x20 el0_svc_common+0x6c/0x180 el0_svc_handler+0x6c/0x88 el0_svc+0x8/0xc UBIFS error (ubi3:0 pid 1494): do_readpage: cannot read page 1798 of inode 125, error -22 UBIFS error (ubi3:0 pid 1494): ubifs_read_node: bad node type (255 but expected 1) UBIFS error (ubi3:0 pid 1494): ubifs_read_node: bad node at LEB 469:0, LEB mapping status 1 Not a node, first 24 bytes: 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........................ CPU: 1 PID: 1494 Comm: gsfIpc Tainted: P O 4.19.90 #21 Hardware name: Vendor SS928V100 DEMO Board (DT) Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x14/0x20 dump_stack+0xa8/0xcc ubifs_read_node+0x1d0/0x250 ubifs_tnc_read_node+0x80/0xb0 ubifs_tnc_locate+0x1bc/0x1e8 do_readpage+0x160/0x3d0 ubifs_readpage+0x58/0x4d0 generic_file_read_iter+0x41c/0x8d8 __vfs_read+0xf8/0x158 vfs_read+0x8c/0x130 ksys_read+0x64/0xe8 __arm64_sys_read+0x14/0x20 el0_svc_common+0x6c/0x180 el0_svc_handler+0x6c/0x88 el0_svc+0x8/0xc UBIFS error (ubi3:0 pid 1494): do_readpage: cannot read page 1798 of inode 125, error -22 ... UBIFS (ubi3:0): background thread "ubifs_bgt3_0" stops umount: /dev/ubi3_0 busy - remounted read-only SOAP 1.2 fault: SOAP-ENV:Sender [no subcode] "Server fault" Detail: [no detail] UBIFS (ubi2:0): un-mount UBI device 2 UBIFS (ubi2:0): background thread "ubifs_bgt2_0" stops UBIFS (ubi1:0): un-mount UBI device 1 UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops umount: none busy - remounted read-only umount: devtmpfs busy - remounted read-only umount: can't remount ubi0:rootfs read-only The system is going down NOW! Terminating gsf_monitor Exit... webserver exit .... Terminating onvif_monitor Exit... [fxWebs signal_handler 11] gSigno=1 Sent SIGTERM to all processes ERROR: Get signal 15, exiting... [fxWebs http_server] cb_work_thread exit mmz_userdev:mmz_userdev_release: MMB LEAK(pid=988): 0x94C55000, 32768 bytes, 'aenc(0)_strm' mmz_userdev:mmz_userdev_release: mmb<0x94c55000> mapped to userspace 0x000000004846f923 will be unmaped! mmz_userdev:mmz_userdev_release: MMB LEAK(pid=988): 0x94C5D000, 16384 bytes, 'aenc(0)_cir' mmz_userdev:mmz_userdev_release: mmb<0x94c5d000> mapped to userspace 0x00000000f52f88bf will be unmaped! mmz_userdev:mmz_userdev_release: MMB LEAK(pid=988): 0x94C92000, 32768 bytes, 'ao(1,0)_cir' mmz_userdev:mmz_userdev_release: mmb<0x94c92000> mapped to userspace 0x0000000004f88d54 will be unmaped! mmz_userdev:mmz_userdev_release: MMB LEAK(pid=988): 0x94C9A000, 32768 bytes, 'ao(1,1)_cir'
- 日志分析
- 升级过程中
mtd5(oem)的 UBI 镜像 擦写 流程异常,导致 UBI 元数据和实际数据不一致 ,反正 就是ubi attach 扫描 Flash 时,发现 PEB 473 上现在存储的 VID Header 有问题。- 现在的升级 fd = open... -> ioctl -> write(fd, ubi_image, image_size); ubi_image 里面已经有每个PEB 的 EC Header ││ VID Header
-
正常情况下: ubi3: attaching mtd5 但是实际: ubi3 error: ubi_attach: PEB 473 contains corrupted VID header, and the data does not contain all 0xFF ubi3 error: ubi_attach: PEB 474 contains corrupted VID header, and the data does not contain all 0xFF 说明 PEB 473 和PEB 474 的 VID Header 有内容,但 CRC/格式不正确 ubi提示:this may be a non-UBI PEB or a severe VID header corruption / UBI 元数据没有完整、正确地写进去 如果flash 问题可能会有: ECC failed uncorrectable ECC error read error write error erase failure bad block 同一个 PEB 反复出现读写错误 但我们这里 bad PEBs: 0 , 说明这两个块没有被 NAND 驱动判定为坏块 - oem 分区里数据可以读写
- 升级过程中
- 解决思路
-
升级完成后不要马上重启,应该: sync(); sleep(1); sync(); -
升级程序每次都要检查 write() 返回值 static int write_full(int fd, const void *buf, size_t len){ const char *p = buf; size_t left = len; while (left > 0) { ssize_t n = write(fd, p, left); if (n < 0) { if (errno == EINTR) continue; perror("======= write err"); return -1; } if (n == 0) return -1; p += n; left -= n; } return 0; }
-
升级错误二, 升级百分之百,自动重启后报错.
- 日志信息
- 完整日志
摘要
ubi1: attaching mtd3 ubi1: scanning is finished ubi1: attached mtd3 (name "usrfs", size 64 MiB) ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096 ubi1: good PEBs: 511, bad PEBs: 1, corrupted PEBs: 0 ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128 ubi1: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 0 ubi1: available PEBs: 0, total reserved PEBs: 511, PEBs reserved for bad PEB handling: 39 ubi1: background thread "ubi_bgt1d" started, PID 930 ubi2: attaching mtd4 ubi2: scanning is finished ubi2: attached mtd4 (name "dss", size 8 MiB) ubi2: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes ubi2: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 ubi2: VID header offset: 2048 (aligned 2048), data offset: 4096 ubi2: good PEBs: 63, bad PEBs: 1, corrupted PEBs: 0 ubi2: user volume: 1, internal volumes: 1, max. volumes count: 128 ubi2: max/mean erase counter: 49/25, WL threshold: 4096, image sequence number: 0 ubi2: available PEBs: 0, total reserved PEBs: 63, PEBs reserved for bad PEB handling: 39 ubi2: background thread "ubi_bgt2d" started, PID 933 ubi3: attaching mtd5 ubi3 error: ubi_attach: PEB 534 contains corrupted VID header, and the data does not contain all 0xFF ubi3 error: ubi_attach: this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection Volume identifier header dump: magic 55424921 version 1 vol_type 1 copy_flag 0 compat 0 vol_id 0 lnum 4 data_size 0 used_ebs 0 data_pad 0 sqnum 0 hdr_crc 04241488 Volume identifier header hexdump: hexdump of PEB 534 offset 4096, length 126976 ubi3: scanning is finished ubi3 error: ubi_attach: 1 PEBs are corrupted and preserved Corrupted PEBs are: 534 UBI assert failed in ubi_wl_init at 1705 (pid 936) CPU: 3 PID: 936 Comm: ubiattach Not tainted 4.19.90 #21 Hardware name: Vendor SS928V100 DEMO Board (DT) Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x14/0x20 dump_stack+0xa8/0xcc ubi_wl_init+0x560/0x598 ubi_attach+0x41c/0x1278 ubi_attach_mtd_dev+0x4e0/0xb70 ctrl_cdev_ioctl+0x1d4/0x278 do_vfs_ioctl+0xb8/0x930 ksys_ioctl+0x44/0x90 __arm64_sys_ioctl+0x18/0x28 el0_svc_common+0x6c/0x180 el0_svc_handler+0x6c/0x88 el0_svc+0x8/0xc ubi3: attached mtd5 (name "oem", size 128 MiB) ubi3: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes ubi3: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 ubi3: VID header offset: 2048 (aligned 2048), data offset: 4096 ubi3: good PEBs: 1024, bad PEBs: 0, corrupted PEBs: 1 ubi3: user volume: 1, internal volumes: 1, max. volumes count: 128 ubi3: max/mean erase counter: 3/0, WL threshold: 4096, image sequence number: 1540595758 ubi3: available PEBs: 0, total reserved PEBs: 1023, PEBs reserved for bad PEB handling: 40 ubi3: background thread "ubi_bgt3d" started, PID 938 ... UBIFS error (ubi3:0 pid 1494): ubifs_decompress: cannot decompress 3852 bytes, compressor zlib, error -22 UBIFS error (ubi3:0 pid 1494): do_readpage: bad data node (block 612, inode 126) magic 0x6101831 crc 0x87a5a72a node_type 1 (data node) group_type 0 (no node group) sqnum 28620 len 3900 key (126, data, 612) size 4096 compr_typ 2 data size 3852 data: 00000000: 0d d3 87 5f 13 67 03 00 60 70 22 8a 28 53 46 f6 e5 ee bd 95 04 a8 f3 53 70 5b 47 ab b5 b8 8a 75 00000020: d5 4f 1c 50 9c a8 ad b3 22 d6 3a 10 15 45 4c 42 72 b9 f1 be 77 ef 25 a1 ce 6a 2d 75 2f 5c 75 62 00000040: d1 6a bf aa 75 54 ad 56 ad b3 5f ff 86 e7 f7 90 a7 f5 6d c4 e2 ac 3d 4c 36 a3 ab 50 7b 2b 3e a2 ... UBIFS error (ubi3:0 pid 1494): do_readpage: cannot read page 612 of inode 126, error -22 UBIFS error (ubi3:0 pid 1494): ubifs_decompress: cannot decompress 3852 bytes, compressor zlib, error -22 nSpiErr=4, spi_error=0 UBIFS error (ubi3:0 pid 1494): do_readpage: bad data node (block 612, inode 126) uart-pl011 11041000.uart: no DMA platform data magic 0x6101831 crc 0x87a5a72a setting uart : uart_num =1 38400 node_type 1 (data node) group_type 0 (no node group) sqnum 28620 lens reset ok len 3900 key (126, data, 612) size 4096 compr_typ 2 data size 3852 data: 00000000: 0d d3 87 5f 13 67 03 00 60 70 22 8a 28 53 46 f6 e5 ee bd 95 04 a8 f3 53 70 5b 47 ab b5 b8 8a 75 00000020: d5 4f 1c 50 9c a8 ad b3 22 d6 3a 10 15 45 4c 42 72 b9 f1 be 77 ef 25 a1 ce 6a 2d 75 2f 5c 75 62 ... UBIFS error (ubi3:0 pid 1494): do_readpage: cannot read page 612 of inode 126, error -22 ... UBIFS (ubi3:0): background thread "ubifs_bgt3_0" stops umount: /dev/ubi3_0 busy - remounted read-only UBIFS (ubi2:0): un-mount UBI device 2 UBIFS (ubi2:0): background thread "ubifs_bgt2_0" stops UBIFS (ubi1:0): un-mount UBI device 1 UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops umount: none busy - remounted read-only umount: devtmpfs busy - remounted read-only umount: can't remount ubi0:rootfs read-only The system is going down NOW! Sent SIGTERM to all processes Terminating gsf_monitor Exit... webserver exit .... Terminating onvif_monitor Exit... [fxWebs signal_handler 11] gSigno=1 [fxWebs http_server] cb_work_thread exit ERROR: Get signal 15, exiting... mmz_userdev:mmz_userdev_release: MMB LEAK(pid=987): 0x94C55000, 32768 bytes, 'aenc(0)_strm'
升级错误3, 升级百分之百,自动重启后OEM 分区为空(升级时没有运行oem程序).
- 日志信息
升级错误4, 升级百分之百,自动重启后,oem 里有数据,但无法时候 oem里的库.
- 日志信息
摘要
gsf ai traking init In dlopen /oem/opencv/libaitrack.so open /oem/opencv/libaitrack.so error 4 Interrupted system call. not found gsf_aifr_init function (null) error. not found gsf_set_ai_function function (null) error. not found gsf_aifr_uninit function (null) error. not found gsf_aifr_reset_param function (null) error. not found gsf_aifr_get_param function (null) error. not found gsf_aifr_set_param function (null) error. not found gsf_aifr_get_uvcKey function (null) error. not found gsf_aifr_set_lens function (null) error. not found gsf_aifr_set_ZFM function (null) error. not found gsf_aifr_set_frameRate function (null) error. get_ai_enable_status() 7 pFn_aifr_init is NULL ...
本文来自博客园,作者:封兴旺,转载请注明原文链接:https://www.cnblogs.com/fxw1/p/22774076

浙公网安备 33010602011771号