sysdump

本文介绍了如何在Oracle数据库中生成systemstatedump和hanganalyze以帮助诊断性能问题及死锁情况。提供了生成不同级别转储的具体命令,并讨论了在RAC环境中执行转储的注意事项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://blogs.oracle.com/Database4CN/entry/systemstate_dump_%E4%BB%8B%E7%BB%8D

 当数据库出现严重的性能问题或者hang了的时候,我们非常需要通过systemstate dump来知道进程在做什么,在等待什么,谁是资源的持有者,谁阻塞了别人。在出现上述问题时,及时收集systemstate dump非常有助于问题原因的分析。

       在一些情况下,数据库会自动生成systemstate dump, 比如出现了“WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK”。
        systemstate dump大部分时候需要手工生成,具体的命令为:

如果连接很多,比如几千个连接,那么生成dump可能需要几十分钟,而且会占用几百M磁盘空间)
1. 用sysdba登录到数据库上:
$sqlplus / as sysdba
或者
$sqlplus -prelim / as sysdba <==当数据库已经很慢或者hang到无法连接

SQL>oradebug setmypid
SQL>oradebug unlimit;
SQL>oradebug dump systemstate 266;
等1~2分钟
SQL>oradebug dump systemstate 266;
等1~2分钟
SQL>oradebug dump systemstate 266;
SQL>oradebug tracefile_name;==>这是生成的文件名


2. 通常除了systemstate dump,最好同时生成hang analyze来直观地了解数据库进程间的等待关系。

$sqlplus / as sysdba
或者
$sqlplus -prelim / as sysdba <==当数据库已经很慢或者hang到无法连接

SQL>oradebug setmypid
SQL>oradebug unlimit;
SQL>oradebug dump hanganalyze 3
等1~2分钟
SQL>oradebug dump hanganalyze 3
等1~2分钟
SQL>oradebug dump hanganalyze 3
SQL>oradebug tracefile_name;==>这是生成的文件名

对于RAC数据库,需要各个实例在同一时间的systemstate dump,那么登录到任意一个实例(无需在所有实例执行):

$sqlplus / as sysdba
或者
$sqlplus -prelim / as sysdba <==当数据库已经很慢或者hang到无法连接

SQL>oradebug setmypid
SQL>oradebug unlimit
SQL>oradebug -g all dump systemstate 266  <==-g all 表示针对所有实例生成dump
等1~2分钟
SQL>oradebug -g all dump systemstate 266
等1~2分钟
SQL>oradebug -g all dump systemstate 266

在RAC上生成hang analyze:
SQL>oradebug setmypid
SQL>oradebug unlimit
SQL>oradebug -g all hanganalyze 3
等1~2分钟
SQL>oradebug -g all hanganalyze 3
等1~2分钟
SQL>oradebug -g all hanganalyze 3

上面的命令执行后会在每个实例都生成systemstate dump,生成的信息放到了每个实例的backgroud_dump_dest下的diag trace文件中。

上面的这些命令执行三次是为了比较进程的变化情况,查看是真的hang了,还是很慢。

systemstate dump有多个级别:

2:     dump (不包括lock element)
10:   dump
11:   dump + global cache of RAC
256: short stack (函数堆栈)
258: 256+2   -->short stack +dump(不包括lock element)
266: 256+10 -->short stack+ dump
267: 256+11 -->short stack+ dump + global cache of RAC

level 11和 267会 dump global cache, 会生成较大的trace 文件,一般情况下不推荐。

一般情况下,如果进程不是太多,推荐用266,因为这样可以dump出来进程的函数堆栈,可以用来分析进程在执行什么操作。
但是生成short stack比较耗时,如果进程非常多,比如2000个进程,那么可能耗时30分钟以上。这种情况下,可以生成level 10 或者 level 258, level 258 比 level 10会多收集short short stack, 但比level 10少收集一些lock element data.

另外对于RAC系统,请关注Bug 11800959 - A SYSTEMSTATE dump with level >= 10 in RAC dumps huge BUSY GLOBAL CACHE ELEMENTS - can hang/crash instances (Doc ID 11800959.8)。这个Bug在11.2.0.3上被修复,对于<=11.2.0.2的RAC,当系统中的lock element 很多的时候,如果执行level 10、266或者 267的systemstate dump时,可能会导致数据库hang或者crash,这种情况下可以采用level 258。

下面是生成systemstate dump的测试,用来查看每个level占用的空间:

这个例子中有37个进程:

-rw-r----- 1 oracle oinstall    72721 Aug 31 21:50 rac10g2_ora_31092.trc==>256 (short stack, 每个进程2K)

-rw-r----- 1 oracle oinstall  2724863 Aug 31 21:52 rac10g2_ora_31654.trc==>10    (dump,每个进程72K )
-rw-r----- 1 oracle oinstall  2731935 Aug 31 21:53 rac10g2_ora_32214.trc==>266 (dump + short stack ,每个进程72K)

RAC:
-rw-r----- 1 oracle oinstall 55873057 Aug 31 21:49 rac10g2_ora_30658.trc ==>11   (dump+global cache,每个进程1.4M)
-rw-r----- 1 oracle oinstall 55879249 Aug 31 21:48 rac10g2_ora_28615.trc ==>267 (dump+global cache+short stack,每个进程1.4M)


所以,可以看出如果dump global cache(level 11和267,那么占用的空间比其他级别大很多)。

我重新整理了一下报错内容 #include <malloc.h> #include <time.h> #include <sched.h> #include <errno.h> #include <string.h> #include <pthread.h> #include “test.h” #define THREAD_MAX_N 8 #define SIZE_ALIGN (4 * sizeof(size_t)) #define MMAP_THRESHOLD 131052 #define FREE_CYCLE 16 #define THRESHOLD (MMAP_THRESHOLD / 16) #define ITER_TIME 80 #define NANOSEC_PER_SEC 1e9 #define MALLOC_TIME (ITER_TIME * (THRESHOLD / (SIZE_ALIGN + 1))) void free_all(void **ptr) { for (int j = 0; j < FREE_CYCLE; j++) { if(ptr[j]){ free(ptr[j]); ptr[j]=NULL; } } } void *func(void *arg) { int *val = (int *)arg; cpu_set_t mask; struct timespec ts[2]; int num = 0; void *ptr[FREE_CYCLE]; CPU_ZERO(&mask); CPU_SET(0, &mask); if (sched_setaffinity(0, sizeof(mask), &mask) < 0) { t_error("Set CPU affinity of thread %d failure, ERROR:%s\n", *val, strerror(errno)); return NULL; } for (int i = 0; i < ITER_TIME; ++i) { for (size_t size = 0; size < THRESHOLD; size += SIZE_ALIGN + 1) { if (num == FREE_CYCLE) { free_all(ptr); num = 0; } ptr[num] = malloc(size); if (!ptr[num]) { t_error("Thread %d malloc failed for size %u\n", *val, size); *val = errno; return NULL; } num++; } } *val = 0; return NULL; } int main(int argc, char *argv[]) { printf(“start\n”); struct timespec ts[2]; pthread_attr_t attr; pthread_t tids[THREAD_MAX_N]; int t_result[THREAD_MAX_N] = {0}; int flag = 0; int ret; int i; ret = pthread_attr_init(&attr); if (ret < 0) { t_error("Init pthread attribute failed: %s\n", strerror(errno)); return -1; } clock_gettime(CLOCK_REALTIME, ts); for (i = 0; i < THREAD_MAX_N; ++i) { t_result[i] = i; ret = pthread_create(&tids[i], &attr, func, &t_result[i]); if (ret < 0) { t_error("Create pthread %u failed: %s\n", i, strerror(errno)); flag = -1; break; } } for (i = 0; i < THREAD_MAX_N; ++i) { ret = pthread_join(tids[i], NULL); if (ret < 0) { t_error("Join thread %u failed: %s\n", i, strerror(errno)); } } clock_gettime(CLOCK_REALTIME, ts + 1); (void)pthread_attr_destroy(&attr); double cost = (ts[1].tv_sec - ts[0].tv_sec) * NANOSEC_PER_SEC + (ts[1].tv_nsec - ts[0].tv_nsec); if (!flag) { t_printf("Malloc and free %d threads %d times cost %lf s\n", THREAD_MAX_N, MALLOC_TIME, cost / NANOSEC_PER_SEC); t_status = 0; } return t_status; } 这是openharmony中的一个测试程序,产生了以下内核崩溃,openharmony4.1,linux内核版本5.15.74 第一个内核崩溃日志 [ 309.609779][T14@C0] BUG: KFENCE: use-after-free read in rcu_cblist_dequeue+0x28/0x48 [ 309.609779][T14@C0] [ 309.619642][T14@C0] Use-after-free read at 0x00000000da8dbea8 (in kfence-#60): [ 309.626824][T14@C0] rcu_cblist_dequeue+0x28/0x48 [ 309.631497][T14@C0] rcu_core+0x210/0x58c [ 309.635476][T14@C0] rcu_core_si+0x20/0x30 [ 309.639544][T14@C0] __do_softirq+0x170/0x5c8 [ 309.643867][T14@C0] run_ksoftirqd+0x50/0xac [ 309.648111][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 309.652868][T14@C0] kthread+0x170/0x1d4 [ 309.656761][T14@C0] ret_from_fork+0x10/0x20 [ 309.661001][T14@C0] [ 309.663166][T14@C0] kfence-#60: 0x00000000da8dbea8-0x0000000007d404e2, size=232, cache=vm_area_struct [ 309.663166][T14@C0] [ 309.674502][T14@C0] allocated by task 2266 on cpu 0 at 309.577745s: [ 309.680741][T14@C0] vm_area_dup+0x34/0x104 [ 309.684887][T14@C0] __split_vma+0x78/0x260 [ 309.689041][T14@C0] __do_munmap+0xf8/0x724 [ 309.693195][T14@C0] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [ 309.699600][T14@C0] __arm64_sys_munmap+0x50/0x68 [ 309.704276][T14@C0] invoke_syscall+0x6c/0x15c [ 309.708688][T14@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 309.715262][T14@C0] do_el0_svc+0x34/0xac [ 309.719242][T14@C0] el0_svc+0x2c/0x94 [ 309.722963][T14@C0] el0t_64_sync_handler+0x8c/0xf0 [ 309.727809][T14@C0] el0t_64_sync+0x1b4/0x1b8 [ 309.732137][T14@C0] [ 309.734300][T14@C0] freed by task 14 on cpu 0 at 309.594072s: [ 309.740017][T14@C0] __vm_area_free+0xa0/0xe0 [ 309.744343][T14@C0] rcu_do_batch+0x2ac/0x8f4 [ 309.748669][T14@C0] rcu_core+0x210/0x58c [ 309.752649][T14@C0] rcu_core_si+0x20/0x30 [ 309.756717][T14@C0] __do_softirq+0x170/0x5c8 [ 309.761043][T14@C0] run_ksoftirqd+0x50/0xac [ 309.765284][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 309.770041][T14@C0] kthread+0x170/0x1d4 [ 309.773938][T14@C0] ret_from_fork+0x10/0x20 [ 309.778176][T14@C0] [ 309.780345][T14@C0] CPU: 0 PID: 14 Comm: ksoftirqd/0 Tainted: G W O 5.15.74 #1 [ 309.788651][T14@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 309.794276][T14@C0] ================================================================== [ 309.802149][T14@C0] irqsoff_warn: C0 T:<14>ksoftirqd/0 D:200.198ms F:309.601950s E:199.878ms [ 309.810555][T14@C0] irqsoff_warn: C0 disabled IRQ at: [ 309.810555][T14@C0] trace_hardirqs_off+0x190/0x1bc [ 309.810555][T14@C0] _raw_spin_lock_irqsave+0x98/0xc8 [ 309.810555][T14@C0] kfence_handle_page_fault+0xc4/0x320 [ 309.810555][T14@C0] __do_kernel_fault+0x1a0/0x2f4 [ 309.810555][T14@C0] do_bad_area+0x40/0x100 [ 309.839200][T14@C0] irqsoff_warn: C0 enabled IRQ at: [ 309.839200][T14@C0] trace_hardirqs_on+0x19c/0x1c8 [ 309.839200][T14@C0] _raw_spin_unlock_irqrestore+0x38/0x70 [ 309.839200][T14@C0] kfence_handle_page_fault+0x2a8/0x320 [ 309.839200][T14@C0] __do_kernel_fault+0x1a0/0x2f4 [ 309.839200][T14@C0] do_bad_area+0x40/0x100 [ 314.997853][T2080@C0] p->addr = 0x0000000013c9adbe, pc = 0xffffffc0081de8f8, pstate = 0x20400005 [ 315.007246][T2080@C0] sprd_serror_debug: panic hook handler [ 315.007298][T2080@C0] Kernel panic - not syncing: CFI failure (target: 0x7fb3780000) [ 315.020480][T2080@C0] CPU: 0 PID: 2080 Comm: irq/128-dwc3 Tainted: G B W O 5.15.74 #1 [ 315.029220][T2080@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 315.035018][T2080@C0] Call trace: [ 315.038305][T2080@C0] dump_backtrace.cfi_jt+0x0/0x8 [ 315.043236][T2080@C0] show_stack+0x28/0x38 [ 315.047392][T2080@C0] dump_stack_lvl+0x84/0xcc [ 315.051892][T2080@C0] panic+0x180/0x444 [ 315.055787][T2080@C0] __cfi_slowpath_diag+0x1e4/0x230 [ 315.060894][T2080@C0] rcu_do_batch+0x36c/0x8f4 [ 315.065392][T2080@C0] rcu_core+0x210/0x58c [ 315.069547][T2080@C0] rcu_core_si+0x20/0x30 [ 315.073786][T2080@C0] __do_softirq+0x170/0x5c8 [ 315.078287][T2080@C0] do_softirq+0x78/0xf0 [ 315.082441][T2080@C0] __local_bh_enable_ip+0xec/0x138 [ 315.087544][T2080@C0] local_bh_enable+0x28/0x38 [ 315.092134][T2080@C0] dwc3_thread_interrupt+0x12bc/0x15d0 [ 315.097580][T2080@C0] irq_thread_fn+0x54/0xe4 [ 315.101999][T2080@C0] irq_thread+0x1c8/0x3b8 [ 315.106326][T2080@C0] kthread+0x170/0x1d4 [ 315.110392][T2080@C0] ret_from_fork+0x10/0x20 [ 315.114804][T2080@C0] SMP: stopping secondary CPUs [ 315.119802][ T0@C3] unisoc-dump-info: CPU3: stopping… [ 315.125327][ T0@C2] unisoc-dump-info: CPU2: stopping… [ 315.130842][ T0@C1] unisoc-dump-info: CPU1: stopping… [ 315.136368][ T0@C6] unisoc-dump-info: CPU6: stopping… [ 315.142057][ T0@C5] unisoc-dump-info: CPU5: stopping… [ 315.147740][ T0@C4] unisoc-dump-info: CPU4: stopping… [ 315.153429][ T0@C7] unisoc-dump-info: CPU7: stopping… [ 315.159266][T2080@C0] ddr_cur_freq: 3 [ 315.172415][T2080@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 315.178677][T2080@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 315.185210][T2080@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 316.191817][T2080@C0] sysdump: [ 316.194858][T2080@C0] sysdump: ***************************************************** [ 316.202560][T2080@C0] sysdump: * * [ 316.210263][T2080@C0] sysdump: * Sysdump enter, preparing debug info to dump … * [ 316.217965][T2080@C0] sysdump: * * [ 316.225666][T2080@C0] sysdump: ***************************************************** [ 316.233367][T2080@C0] sysdump: [ 316.236505][T2080@C0] sysdump: reason: CFI failure (target: 0x7fb3780000), sprd_sysdump_info->crash_key: 0 [ 316.246187][T2080@C0] sysdump: [ 316.249230][T2080@C0] sysdump: ***************************************************** [ 316.256931][T2080@C0] sysdump: * * [ 316.264632][T2080@C0] sysdump: * Preparing debug info done … * [ 316.272335][T2080@C0] sysdump: * * [ 316.280036][T2080@C0] sysdump: ***************************************************** [ 316.287738][T2080@C0] sysdump: [ 317.291051][T2080@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 317.297312][T2080@C0] PHYS_OFFSET: 0x80000000 [ 317.301635][T2080@C0] CPU features: 0x2,00000b83,23300e42 [ 317.307000][T2080@C0] Memory Limit: none 第二个内核崩溃日志 [ 2060.258228][T3311@C0] ------------[ cut here ]------------ [ 2060.263654][T3311@C0] kernel BUG at mm/mmap.c:721! [ 2060.268431][T3311@C0] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 2060.274774][T3311@C0] —Die flow print cache!— [ 2060.279467][T3311@C0] [ 2060.281812][T3311@C0] C0 X0: 0xffffff809453cd18: [ 2060.286423][T3311@C0] C0 cd18 95fbf448 ffffff80 00000003 00000000 9453cd28 f fffff80 9453cd28 ffffff80 [ 2060.295724][T3311@C0] C0 cd38 00000000 00000000 0a526818 ffffffc0 00000001 0 0000000 94363a40 ffffff80 [ 2060.305022][T3311@C0] C0 cd58 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.314323][T3311@C0] C0 cd78 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.323624][T3311@C0] C0 cd98 8a6e0000 0000007f 8a6e8000 0000007f 95410740 f fffff80 93184f68 ffffff80 [ 2060.332925][T3311@C0] C0 cdb8 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.342225][T3311@C0] C0 cdd8 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.351530][T3311@C0] C0 cdf8 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4810 ffffff80 [ 2060.360828][T3311@C0] [ 2060.363172][T3311@C0] C0 X1: 0xffffff8092fcd278: [ 2060.367784][T3311@C0] C0 d278 00000001 00000002 92fcd230 ffffff80 989d47e0 f fffff80 989d47e0 ffffff80 [ 2060.377084][T3311@C0] C0 d298 747131fc 192c0676 92fcd2a0 ffffff80 00000001 0 0000000 93f90000 ffffff80 [ 2060.386385][T3311@C0] C0 d2b8 00000000 00000000 92fcd2c0 ffffff80 92fcd2c0 f fffff80 00000000 00000000 [ 2060.395684][T3311@C0] C0 d2d8 00000000 00000000 00000000 00000000 00000001 0 0000003 92fcd2a0 ffffff80 [ 2060.404987][T3311@C0] C0 d2f8 947d4860 ffffff80 947d4860 ffffff80 747131fc 8 92d0676 92fcd310 ffffff80 [ 2060.414286][T3311@C0] C0 d318 00000000 00000000 00000000 00000000 00000000 0 0000000 92fcd330 ffffff80 [ 2060.423588][T3311@C0] C0 d338 92fcd330 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.432887][T3311@C0] C0 d358 00000000 00000000 92fcd310 ffffff80 00000000 0 0000000 00000000 00000000 [ 2060.442188][T3311@C0] [ 2060.444532][T3311@C0] C0 X4: 0xffffff8091b9c320: [ 2060.449144][T3311@C0] C0 c320 00000000 00000000 0000000a 00000000 91b9c330 f fffff80 91b9c330 ffffff80 [ 2060.458443][T3311@C0] C0 c340 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 965d1540 ffffff80 [ 2060.467744][T3311@C0] C0 c360 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.477045][T3311@C0] C0 c380 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.486344][T3311@C0] C0 c3a0 00000000 00000000 8a6e0000 0000007f 00000000 0 0000000 00000000 00000000 [ 2060.495645][T3311@C0] C0 c3c0 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.504947][T3311@C0] C0 c3e0 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.514247][T3311@C0] C0 c400 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4850 ffffff80 [ 2060.523548][T3311@C0] [ 2060.525893][T3311@C0] C0 X21: 0xffffff808102ce20: [ 2060.530588][T3311@C0] C0 ce20 93a55150 ffffff80 0a526818 ffffffc0 00000023 0 0000000 89da97c0 ffffff80 [ 2060.539890][T3311@C0] C0 ce40 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.549190][T3311@C0] C0 ce60 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.558491][T3311@C0] C0 ce80 8a4c0000 0000007f 8a4ca000 0000007f 8102ded0 f fffff80 91b9dc18 ffffff80 [ 2060.567791][T3311@C0] C0 cea0 97c62cd0 ffffff80 91ebe678 ffffff80 95402020 f fffff80 008c56a8 ffffff01 [ 2060.577094][T3311@C0] C0 cec0 9885e400 ffffff80 00000fc3 00600000 00000071 0 0000000 966d6d08 ffffff80 [ 2060.586394][T3311@C0] C0 cee0 00000000 00000000 00000000 00000000 00000009 0 0000000 8102cef8 ffffff80 [ 2060.595694][T3311@C0] C0 cf00 8102cef8 ffffff80 00000000 00000000 0a526818 f fffffc0 00000000 00000000 [ 2060.604994][T3311@C0] [ 2060.607339][T3311@C0] C0 X23: 0xffffff8092fcd220: [ 2060.612036][T3311@C0] C0 d220 947d4ba0 ffffff80 7471301c a92c0676 92fcd230 f fffff80 00000000 00000000 [ 2060.621335][T3311@C0] C0 d240 00000000 00000000 00000000 00000000 92fcd250 f fffff80 92fcd250 ffffff80 [ 2060.630640][T3311@C0] C0 d260 00000000 00000000 00000000 00000000 00000000 0 0000000 00000001 00000002 [ 2060.639938][T3311@C0] C0 d280 92fcd230 ffffff80 989d47e0 ffffff80 989d47e0 f fffff80 747131fc 192c0676 [ 2060.649241][T3311@C0] C0 d2a0 92fcd2a0 ffffff80 00000001 00000000 93f90000 f fffff80 00000000 00000000 [ 2060.658542][T3311@C0] C0 d2c0 92fcd2c0 ffffff80 92fcd2c0 ffffff80 00000000 0 0000000 00000000 00000000 [ 2060.667839][T3311@C0] C0 d2e0 00000000 00000000 00000001 00000003 92fcd2a0 f fffff80 947d4860 ffffff80 [ 2060.677141][T3311@C0] C0 d300 947d4860 ffffff80 747131fc 892d0676 92fcd310 f fffff80 00000000 00000000 [ 2060.686439][T3311@C0] [ 2060.688786][T3311@C0] C0 X25: 0xffffff809453cd18: [ 2060.693483][T3311@C0] C0 cd18 95fbf448 ffffff80 00000003 00000000 9453cd28 f fffff80 9453cd28 ffffff80 [ 2060.702782][T3311@C0] C0 cd38 00000000 00000000 0a526818 ffffffc0 00000001 0 0000000 94363a40 ffffff80 [ 2060.712085][T3311@C0] C0 cd58 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.721387][T3311@C0] C0 cd78 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.730685][T3311@C0] C0 cd98 8a6e0000 0000007f 8a6e8000 0000007f 95410740 f fffff80 93184f68 ffffff80 [ 2060.739988][T3311@C0] C0 cdb8 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.749288][T3311@C0] C0 cdd8 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.758590][T3311@C0] C0 cdf8 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4810 ffffff80 [ 2060.767889][T3311@C0] [ 2060.770233][T3311@C0] C0 X26: 0xffffff80954106c0: [ 2060.774932][T3311@C0] C0 06c0 00000000 00000000 00000000 00000000 954106d0 f fffff80 954106d0 ffffff80 [ 2060.784230][T3311@C0] C0 06e0 00000000 00000000 00000000 00000000 07f835a5 0 0000000 00000000 00000000 [ 2060.793533][T3311@C0] C0 0700 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.802831][T3311@C0] C0 0720 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.812133][T3311@C0] C0 0740 8a6f0000 0000007f 8a6f2000 0000007f 954100e8 f fffff80 9453cd98 ffffff80 [ 2060.821433][T3311@C0] C0 0760 91ebe678 ffffff80 95402f88 ffffff80 931842d8 f fffff80 00008000 00000000 [ 2060.830735][T3311@C0] C0 0780 9885e400 ffffff80 00000f82 04600000 00100070 0 0000000 00000000 00000000 [ 2060.840035][T3311@C0] C0 07a0 00000000 00000000 00000000 00000000 00000000 0 0000000 954107b8 ffffff80 [ 2060.849335][T3311@C0] [ 2060.851680][T3311@C0] C0 X27: 0xffffff8091b9c320: [ 2060.856379][T3311@C0] C0 c320 00000000 00000000 0000000a 00000000 91b9c330 f fffff80 91b9c330 ffffff80 [ 2060.865677][T3311@C0] C0 c340 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 965d1540 ffffff80 [ 2060.874979][T3311@C0] C0 c360 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.884277][T3311@C0] C0 c380 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.893578][T3311@C0] C0 c3a0 00000000 00000000 8a6e0000 0000007f 00000000 0 0000000 00000000 00000000 [ 2060.902880][T3311@C0] C0 c3c0 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.912179][T3311@C0] C0 c3e0 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.921482][T3311@C0] C0 c400 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4850 ffffff80 [ 2060.930780][T3311@C0] [ 2060.933127][T3311@C0] C0 X28: 0xffffff809453cd90: [ 2060.937822][T3311@C0] C0 cd90 00000000 00000000 8a6e0000 0000007f 8a6e8000 0 000007f 95410740 ffffff80 [ 2060.947123][T3311@C0] C0 cdb0 93184f68 ffffff80 93184db9 ffffff80 00000000 0 0000000 93184f88 ffffff80 [ 2060.956427][T3311@C0] C0 cdd0 00000000 00000000 9885e400 ffffff80 00000fc3 0 0600000 00100073 00000000 [ 2060.965726][T3311@C0] C0 cdf0 950c2900 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.975027][T3311@C0] C0 ce10 947d4810 ffffff80 947d4810 ffffff80 92fcd2a0 f fffff80 00000000 00000000 [ 2060.984326][T3311@C0] C0 ce30 0ff14dc6 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.993628][T3311@C0] C0 ce50 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2061.002929][T3311@C0] C0 ce70 00000000 00000000 00000000 00000000 10680000 0 000007f 106a4000 0000007f [ 2061.012233][T3311@C0] sysdump: dump_die_cb save pregs_die_g ok . [ 2061.018225][T3311@C0] Modules linked in: npu_img_vha(O) sprd_vdsp(O) vpu(O) s prdbt_tty(O) mali_kbase(O) sprd_wlan_combo(O) flash_ic_aw3641(O) chsc5xxx(O) spr d_compr_2stage_dma sprd_dmaengine_pcm snd_soc_sprd_dai snd_soc_sprd_vbc_fe snd_s oc_sprd_vbc_v4 sprd_platform_pcm_routing snd_soc_sprd_tdm snd_soc_sprd_pdm_r2p0 snd_soc_sprd_dummy_codec snd_soc_unisoc_dp_codec snd_soc_sprd_codec_ump9620 snd_ soc_sprd_codec_ump9620_power_dev snd_soc_sprd_codec_ump9620_power snd_soc_sprd_c ard snd_soc_sprd_ocp96011 snd_soc_sprd_pa_aw87390 voice_trigger_irq sprd_cp_dvfs sprd_pmic_wdt sprd_audcp_boot sprd_audcp_dvfs mcdt_hw_r2p0 audio_pipe sprd_apip e sprd_audio_usb_offload audio_dsp_dump audio_sipc audio_mem agdsp_pd [ 2061.080043][T3311@C0] CPU: 0 PID: 3311 Comm: malloc-multi-th Tainted: G W O 5.15.74 #1 [ 2061.089077][T3311@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 2061.094901][T3311@C0] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS B TYPE=–) [ 2061.102723][T3311@C0] pc : __vma_adjust+0xc44/0xc78 [ 2061.107589][T3311@C0] lr : __vma_adjust+0x260/0xc78 [ 2061.112460][T3311@C0] sp : ffffffc0144d3c10 [ 2061.116630][T3311@C0] x29: ffffffc0144d3c70 x28: ffffff809453ce10 x27: ffffff 8091b9c3a0 [ 2061.124628][T3311@C0] x26: ffffff8095410740 x25: ffffff809453cd98 x24: 000000 0000000000 [ 2061.132625][T3311@C0] x23: ffffff8092fcd2a0 x22: 0000000000000000 x21: ffffff 808102cea0 [ 2061.140620][T3311@C0] x20: 0000000000000000 x19: ffffffc00ac5e000 x18: ffffff c0132f5050 [ 2061.148618][T3311@C0] x17: 0000000000000000 x16: 0000000000000000 x15: 000000 0000000008 [ 2061.156613][T3311@C0] x14: 0000000000000000 x13: 0000000000000004 x12: 000000 0c78d2bef3 [ 2061.164612][T3311@C0] x11: 0000007f8a4c0000 x10: 0000007f8a6e0000 x9 : 000000 0000000000 [ 2061.172611][T3311@C0] x8 : 0000000000000000 x7 : 0000000000000000 x6 : 000000 0000000000 [ 2061.180607][T3311@C0] x5 : 0000000000000000 x4 : ffffff8091b9c3a0 x3 : ffffff c0144d3aa0 [ 2061.188604][T3311@C0] x2 : 000000010006b6fe x1 : ffffff8092fcd2f8 x0 : ffffff 809453cd98 [ 2061.196599][T3311@C0] Call trace: [ 2061.199906][T3311@C0] __vma_adjust+0xc44/0xc78 [ 2061.204424][T3311@C0] __split_vma+0x14c/0x260 [ 2061.208855][T3311@C0] __do_munmap+0x168/0x724 [ 2061.213291][T3311@C0] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [ 2061.219896][T3311@C0] __arm64_sys_munmap+0x50/0x68 [ 2061.224761][T3311@C0] invoke_syscall+0x6c/0x15c [ 2061.229369][T3311@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 2061.236150][T3311@C0] do_el0_svc+0x34/0xac [ 2061.240324][T3311@C0] el0_svc+0x2c/0x94 [ 2061.244235][T3311@C0] el0t_64_sync_handler+0x8c/0xf0 [ 2061.249276][T3311@C0] el0t_64_sync+0x1b4/0x1b8 [ 2061.253801][T3311@C0] Code: 9400281d aa1303ea 35fffe40 17fffd49 (d4210000) [ 2061.260749][T3311@C0] —[ end trace 1949c3d540cc5187 ]— [ 2061.287887][T238@C7] [SPRD_PDBG] #---------PDBG LIGHT SLEEP START---------# [ 2061.288611][T3311@C0] p->addr = 0x00000000d7c1766e, pc = 0xffffffc008 1de8f8, pstate = 0x604003c5 [ 2061.294790][T238@C7] [SPRD_PDBG] [SLP_STATE] deep: 0xfffffffffffffecc, light: 0xffffffffffffff20 [ 2061.304250][T3311@C0] sprd_serror_debug: panic hook handler [ 2061.304258][T3311@C0] Kernel panic - not syncing: Oops - BUG: Fatal exception [ 2061.304261][T3311@C0] SMP: stopping secondary CPUs [ 2061.304461][T238@C7] unisoc-dump-info: CPU7: stopping… [ 2061.304900][ T0@C1] unisoc-dump-info: CPU1: stopping… [ 2061.305319][ T0@C6] unisoc-dump-info: CPU6: stopping… [ 2061.305892][ T0@C2] unisoc-dump-info: CPU2: stopping… [ 2061.306313][ T0@C3] unisoc-dump-info: CPU3: stopping… [ 2061.306732][ T0@C5] unisoc-dump-info: CPU5: stopping… [ 2061.307305][ T0@C4] unisoc-dump-info: CPU4: stopping… [ 2061.307871][T3311@C0] ddr_cur_freq: 1 [ 2061.318118][T3311@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 2061.318303][T3311@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 2061.318315][T3311@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 2062.318360][T3311@C0] sysdump: [ 2062.318362][T3311@C0] sysdump: ********************************************** ******* [ 2062.318365][T3311@C0] sysdump: * * [ 2062.318367][T3311@C0] sysdump: * Sysdump enter, preparing debug info to dump … * [ 2062.318369][T3311@C0] sysdump: * * [ 2062.318372][T3311@C0] sysdump: ********************************************** ******* [ 2062.318373][T3311@C0] sysdump: [ 2062.318392][T3311@C0] sysdump: reason: Oops - BUG: Fatal exception, sprd_sysd ump_info->crash_key: 0 [ 2062.318523][T3311@C0] sysdump: [ 2062.318527][T3311@C0] sysdump: ********************************************** ******* [ 2062.318528][T3311@C0] sysdump: * * [ 2062.318530][T3311@C0] sysdump: * Preparing debug info done … * [ 2062.318532][T3311@C0] sysdump: * * [ 2062.318535][T3311@C0] sysdump: ********************************************** ******* [ 2062.318536][T3311@C0] sysdump: [ 2063.318737][T3311@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 2063.318747][T3311@C0] PHYS_OFFSET: 0x80000000 [ 2063.318749][T3311@C0] CPU features: 0x2,00000b83,23300e42 [ 2063.318756][T3311@C0] Memory Limit: none static void __insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma) { struct vm_area_struct *prev; struct rb_node **rb_link, *rb_parent; if (find_vma_links(mm, vma->vm_start, vma->vm_end, &prev, &rb_link, &rb_parent)) BUG(); __vma_link(mm, vma, prev, rb_link, rb_parent); mm->map_count++; } mmap.c 721代码如上 BUG();,如何修复这个问题 第3个内核崩溃 [ 102.427572][T14@C0] refcount_t: underflow; use-after-free. [ 102.433062][T14@C0] WARNING: CPU: 0 PID: 14 at lib/refcount.c:28 refcount_war n_saturate+0x110/0x154 [ 102.442008][T14@C0] Modules linked in: npu_img_vha(O) sprd_vdsp(O) vpu(O) spr dbt_tty(O) mali_kbase(O) sprd_wlan_combo(O) flash_ic_aw3641(O) chsc5xxx(O) sprd_ compr_2stage_dma sprd_dmaengine_pcm snd_soc_sprd_dai snd_soc_sprd_vbc_fe snd_soc _sprd_vbc_v4 sprd_platform_pcm_routing snd_soc_sprd_tdm snd_soc_sprd_pdm_r2p0 sn d_soc_sprd_dummy_codec snd_soc_unisoc_dp_codec snd_soc_sprd_codec_ump9620 snd_so c_sprd_codec_ump9620_power_dev snd_soc_sprd_codec_ump9620_power snd_soc_sprd_car d snd_soc_sprd_ocp96011 snd_soc_sprd_pa_aw87390 voice_trigger_irq sprd_cp_dvfs s prd_pmic_wdt sprd_audcp_boot sprd_audcp_dvfs mcdt_hw_r2p0 audio_pipe sprd_apipe sprd_audio_usb_offload audio_dsp_dump audio_sipc audio_mem agdsp_pd [ 102.503378][T14@C0] CPU: 0 PID: 14 Comm: ksoftirqd/0 Tainted: G W O 5.15.74 #1 [ 102.511681][T14@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 102.517307][T14@C0] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTY PE=--) [ 102.524921][T14@C0] pc : refcount_warn_saturate+0x110/0x154 [ 102.530460][T14@C0] lr : refcount_warn_saturate+0x110/0x154 [ 102.535998][T14@C0] sp : ffffffc00b0bbc00 [ 102.539982][T14@C0] x29: ffffffc00b0bbc00 x28: ffffff8080352abc x27: 00000000 00000000 [ 102.547768][T14@C0] x26: ffffff8080352610 x25: ffffffc00ac37000 x24: ffffffc0 098541b0 [ 102.555557][T14@C0] x23: ffffff8080352600 x22: 0000000000000006 x21: 00000000 0000000a [ 102.563344][T14@C0] x20: ffffff817cf03dc0 x19: ffffff808bc0a658 x18: ffffffc0 0b08d048 [ 102.571132][T14@C0] x17: ffffffffffffffff x16: 0000000000000004 x15: 00000000 00000004 [ 102.578924][T14@C0] x14: 000000000000074a x13: ffffffc00abda7b0 x12: 00000000 00000003 [ 102.586709][T14@C0] x11: 000000010000574a x10: 0000000000000101 x9 : 0b06cdfe fb609000 [ 102.594498][T14@C0] x8 : 0b06cdfefb609000 x7 : 545b5d3237353732 x6 : 342e3230 3120205b [ 102.602290][T14@C0] x5 : ffffffc00aef35b4 x4 : ffffffc00b0bb9b7 x3 : 00000000 00000000 [ 102.610076][T14@C0] x2 : 0000000000000000 x1 : ffffffc00b0bb9a0 x0 : 00000000 00000026 [ 102.617865][T14@C0] Call trace: [ 102.620981][T14@C0] refcount_warn_saturate+0x110/0x154 [ 102.626174][T14@C0] __vm_area_free+0xbc/0xe0 [ 102.630498][T14@C0] rcu_do_batch+0x2ac/0x8f4 [ 102.634826][T14@C0] rcu_core+0x210/0x58c [ 102.638806][T14@C0] rcu_core_si+0x20/0x30 [ 102.642875][T14@C0] __do_softirq+0x170/0x5c8 [ 102.647203][T14@C0] run_ksoftirqd+0x50/0xac [ 102.651442][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 102.656202][T14@C0] kthread+0x170/0x1d4 [ 102.660096][T14@C0] ret_from_fork+0x10/0x20 [ 102.664338][T14@C0] ---[ end trace 4990effe52f21971 ]--- [ 102.669634][T14@C0] irqsoff_warn: C0 T:<14>ksoftirqd/0 D:236.601ms F:102.4330 31s E:236.193ms [ 102.678027][T14@C0] irqsoff_warn: C0 disabled IRQ at: [ 102.678027][T14@C0] trace_hardirqs_off_finish+0x22c/0x270 [ 102.678027][T14@C0] arm64_enter_el1_dbg+0x54/0x70 [ 102.678027][T14@C0] el1_dbg+0x2c/0x68 [ 102.678027][T14@C0] el1h_64_sync_handler+0x48/0xa4 [ 102.678027][T14@C0] el1h_64_sync+0x7c/0x80 [ 102.705538][T14@C0] irqsoff_warn: C0 enabled IRQ at: [ 102.705538][T14@C0] trace_hardirqs_on+0x19c/0x1c8 [ 102.705538][T14@C0] exit_to_kernel_mode+0x48/0x5c [ 102.705538][T14@C0] exit_el1_irq_or_nmi+0x18/0x28 [ 102.705538][T14@C0] el1_interrupt+0x54/0x68 [ 102.705538][T14@C0] el1h_64_irq_handler+0x20/0x30 [ 103.157689][T2335@C0] Unable to handle kernel paging request at virtual addre ss ff95d29bb82a9843 [ 103.166489][T2335@C0] Mem abort info: [ 103.170056][T2335@C0] ESR = 0x96000004 [ 103.174117][T2335@C0] EC = 0x25: DABT (current EL), IL = 32 bits [ 103.180298][T2335@C0] SET = 0, FnV = 0 [ 103.184276][T2335@C0] EA = 0, S1PTW = 0 [ 103.188287][T2335@C0] FSC = 0x04: level 0 translation fault [ 103.194013][T2335@C0] Data abort info: [ 103.197724][T2335@C0] ISV = 0, ISS = 0x00000004 [ 103.202388][T2335@C0] CM = 0, WnR = 0 [ 103.206187][T2335@C0] [ff95d29bb82a9843] address between user and kernel addr ess ranges [ 103.214172][T2335@C0] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 103.220514][T2335@C0] ---Die flow print cache!--- [ 103.225185][T2335@C0] [ 103.227520][T2335@C0] C0 X0: 0xffffff8080005c00: [ 103.232113][T2335@C0] C0 5c00 801e0d80 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.241368][T2335@C0] C0 5c20 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.250628][T2335@C0] C0 5c40 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.259888][T2335@C0] C0 5c60 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.269148][T2335@C0] C0 5c80 0ab6bac0 ffffffc0 44040000 00000000 00000005 0 0000000 000000e8 000000e8 [ 103.278407][T2335@C0] C0 5ca0 1a7b9612 00000701 00000070 0000001e 00010023 0 0010023 00000011 00040000 [ 103.287668][T2335@C0] C0 5cc0 00000001 00000000 00000000 00000000 000000e8 0 0000008 00000000 00000000 [ 103.296927][T2335@C0] C0 5ce0 0a41d0d1 ffffffc0 80005b68 ffffff80 80005e68 f fffff80 0a41d0d1 ffffffc0 [ 103.306184][T2335@C0] [ 103.308519][T2335@C0] C0 X10: 0xffffff808bfb9290: [ 103.313197][T2335@C0] C0 9290 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.322454][T2335@C0] C0 92b0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.331716][T2335@C0] C0 92d0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.340975][T2335@C0] C0 92f0 00000000 00000000 00000000 00000000 00000008 0 0000000 82917000 00000000 [ 103.350235][T2335@C0] C0 9310 00000001 00000001 1388d000 ffffffc0 1388d0d8 f fffffc0 00000000 00000000 [ 103.359494][T2335@C0] C0 9330 13be8000 ffffffc0 00000001 00400040 00000000 0 0000001 00000000 00000000 [ 103.368753][T2335@C0] C0 9350 00000030 00000000 00000000 00000009 ffff3fc7 0 0000000 94d62600 ffffff80 [ 103.378012][T2335@C0] C0 9370 00000001 00000000 00000001 00000078 00000078 0 0000078 00000000 00000000 [ 103.387272][T2335@C0] [ 103.389606][T2335@C0] C0 X20: 0xffffff8080005c00: [ 103.394283][T2335@C0] C0 5c00 801e0d80 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.403541][T2335@C0] C0 5c20 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.412800][T2335@C0] C0 5c40 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.422060][T2335@C0] C0 5c60 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.431323][T2335@C0] C0 5c80 0ab6bac0 ffffffc0 44040000 00000000 00000005 0 0000000 000000e8 000000e8 [ 103.440581][T2335@C0] C0 5ca0 1a7b9612 00000701 00000070 0000001e 00010023 0 0010023 00000011 00040000 [ 103.449839][T2335@C0] C0 5cc0 00000001 00000000 00000000 00000000 000000e8 0 0000008 00000000 00000000 [ 103.459099][T2335@C0] C0 5ce0 0a41d0d1 ffffffc0 80005b68 ffffff80 80005e68 f fffff80 0a41d0d1 ffffffc0 [ 103.468357][T2335@C0] [ 103.470692][T2335@C0] C0 X25: 0xffffff808829f0e8: [ 103.475370][T2335@C0] C0 f0e8 00000000 00000000 94a58dc0 ffffff80 00000000 0 0000000 00000000 00000000 [ 103.484628][T2335@C0] C0 f108 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.493887][T2335@C0] C0 f128 00000000 00000000 00000000 00000000 9e6f0000 0 000007f 9e700000 0000007f [ 103.503149][T2335@C0] C0 f148 923f81d0 ffffff80 8f6f6e80 ffffff80 8f6f6ea1 f fffff80 00000000 00000000 [ 103.512409][T2335@C0] C0 f168 00000000 00000000 0001f000 00000000 8a438000 f fffff80 00000fc3 00600000 [ 103.521669][T2335@C0] C0 f188 00100073 00000000 93c51f80 ffffff80 00000000 0 0000000 00000000 00000000 [ 103.530926][T2335@C0] C0 f1a8 00000000 00000000 93c6a5d0 ffffff80 93c6a5d0 f fffff80 978660e0 ffffff80 [ 103.540188][T2335@C0] C0 f1c8 00000000 00000000 07f9e6f0 00000000 00000000 0 0000000 00000000 00000000 [ 103.549444][T2335@C0] [ 103.551778][T2335@C0] C0 X26: 0xffffff808829f0d8: [ 103.556454][T2335@C0] C0 f0d8 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 94a58dc0 ffffff80 [ 103.565715][T2335@C0] C0 f0f8 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.574974][T2335@C0] C0 f118 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.584235][T2335@C0] C0 f138 9e6f0000 0000007f 9e700000 0000007f 923f81d0 f fffff80 8f6f6e80 ffffff80 [ 103.593492][T2335@C0] C0 f158 8f6f6ea1 ffffff80 00000000 00000000 00000000 0 0000000 0001f000 00000000 [ 103.602754][T2335@C0] C0 f178 8a438000 ffffff80 00000fc3 00600000 00100073 0 0000000 93c51f80 ffffff80 [ 103.612011][T2335@C0] C0 f198 00000000 00000000 00000000 00000000 00000000 0 0000000 93c6a5d0 ffffff80 [ 103.621271][T2335@C0] C0 f1b8 93c6a5d0 ffffff80 978660e0 ffffff80 00000000 0 0000000 07f9e6f0 00000000 [ 103.630531][T2335@C0] [ 103.632865][T2335@C0] C0 X28: 0xffffff808bfb9280: [ 103.637540][T2335@C0] C0 9280 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.646800][T2335@C0] C0 92a0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.656061][T2335@C0] C0 92c0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.665320][T2335@C0] C0 92e0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.674580][T2335@C0] C0 9300 00000008 00000000 82917000 00000000 00000001 0 0000001 1388d000 ffffffc0 [ 103.683840][T2335@C0] C0 9320 1388d0d8 ffffffc0 00000000 00000000 13be8000 f fffffc0 00000001 00400040 [ 103.693101][T2335@C0] C0 9340 00000000 00000001 00000000 00000000 00000030 0 0000000 00000000 00000009 [ 103.702359][T2335@C0] C0 9360 ffff3fc7 00000000 94d62600 ffffff80 00000001 0 0000000 00000001 00000078 [ 103.711621][T2335@C0] sysdump: dump_die_cb save pregs_die_g ok . [ 103.717589][T2335@C0] Modules linked in: npu_img_vha(O) sprd_vdsp(O) vpu(O) s prdbt_tty(O) mali_kbase(O) sprd_wlan_combo(O) flash_ic_aw3641(O) chsc5xxx(O) spr d_compr_2stage_dma sprd_dmaengine_pcm snd_soc_sprd_dai snd_soc_sprd_vbc_fe snd_s oc_sprd_vbc_v4 sprd_platform_pcm_routing snd_soc_sprd_tdm snd_soc_sprd_pdm_r2p0 snd_soc_sprd_dummy_codec snd_soc_unisoc_dp_codec snd_soc_sprd_codec_ump9620 snd_ soc_sprd_codec_ump9620_power_dev snd_soc_sprd_codec_ump9620_power snd_soc_sprd_c ard snd_soc_sprd_ocp96011 snd_soc_sprd_pa_aw87390 voice_trigger_irq sprd_cp_dvfs sprd_pmic_wdt sprd_audcp_boot sprd_audcp_dvfs mcdt_hw_r2p0 audio_pipe sprd_apip e sprd_audio_usb_offload audio_dsp_dump audio_sipc audio_mem agdsp_pd [ 103.779131][T2335@C0] CPU: 0 PID: 2335 Comm: malloc-multi-th Tainted: G W O 5.15.74 #1 [ 103.788124][T2335@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 103.793924][T2335@C0] pstate: a0400005 (NzCv daif +PAN -UAO -TCO -DIT -SSBS B TYPE=--) [ 103.801712][T2335@C0] pc : kmem_cache_alloc+0x128/0x3dc [ 103.806904][T2335@C0] lr : vm_area_alloc+0x34/0xac [ 103.811664][T2335@C0] sp : ffffffc013bebb60 [ 103.815818][T2335@C0] x29: ffffffc013bebb70 x28: ffffff808bfb9300 x27: ffffff c00aec4000 [ 103.823780][T2335@C0] x26: ffffff808829f158 x25: ffffff808829f168 x24: ec95d2 9bb82a97d3 [ 103.831741][T2335@C0] x23: ffffffc0081d7e6c x22: 0000000000000000 x21: ffffff c0081d7e6c [ 103.839702][T2335@C0] x20: ffffff8080005c80 x19: 0000000000000cc0 x18: ffffff c01388d060 [ 103.847663][T2335@C0] x17: 0000000000000000 x16: ffffffc009828428 x15: ffffff c00a871000 [ 103.855629][T2335@C0] x14: 0000000000000001 x13: 0000000000000004 x12: ac2a12 1038d5682c [ 103.863587][T2335@C0] x11: 000000009fdd27de x10: ffffff808bfb9310 x9 : ff95d2 9bb82a9843 [ 103.871549][T2335@C0] x8 : 00000000006087c0 x7 : 0000000007f9e6e9 x6 : 000000 0000000000 [ 103.879511][T2335@C0] x5 : 0000000000000000 x4 : 0000000007f9e6f0 x3 : 000000 00006087e0 [ 103.887472][T2335@C0] x2 : 0000000000000000 x1 : 0000000000000cc0 x0 : ffffff 8080005c80 [ 103.895435][T2335@C0] Call trace: [ 103.898722][T2335@C0] kmem_cache_alloc+0x128/0x3dc [ 103.903569][T2335@C0] vm_area_alloc+0x34/0xac [ 103.907981][T2335@C0] mmap_region+0x268/0x728 [ 103.912394][T2335@C0] do_mmap+0x3d4/0x540 [ 103.916462][T2335@C0] vm_mmap_pgoff+0xd0/0x234 [ 103.920962][T2335@C0] ksys_mmap_pgoff+0xbc/0x108 [ 103.925634][T2335@C0] __arm64_sys_mmap+0x44/0x54 [ 103.930309][T2335@C0] invoke_syscall+0x6c/0x15c [ 103.934897][T2335@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 103.941644][T2335@C0] do_el0_svc+0x34/0xac [ 103.945800][T2335@C0] el0_svc+0x2c/0x94 [ 103.949694][T2335@C0] el0t_64_sync_handler+0x8c/0xf0 [ 103.954712][T2335@C0] el0t_64_sync+0x1b4/0x1b8 [ 103.959217][T2335@C0] Code: f9406e8c 91008103 8b8a2129 9100438a (f940012b) [ 103.966137][T2335@C0] ---[ end trace 4990effe52f21972 ]--- [ 103.990260][T2335@C0] <panic> p->addr = 0x0000000094d0f85d, pc = 0xffffffc008 1de8f8, pstate = 0x604000c5 [ 103.999625][T2335@C0] sprd_serror_debug: panic hook handler [ 103.999632][T2335@C0] Kernel panic - not syncing: Oops: Fatal exception [ 104.011742][T2335@C0] SMP: stopping secondary CPUs [ 104.016964][ T0@C2] unisoc-dump-info: CPU2: stopping... [ 104.022517][ T0@C3] unisoc-dump-info: CPU3: stopping... [ 104.028067][ T0@C1] unisoc-dump-info: CPU1: stopping... [ 104.033611][ T0@C4] unisoc-dump-info: CPU4: stopping... [ 104.039306][ T0@C6] unisoc-dump-info: CPU6: stopping... [ 104.045004][ T0@C5] unisoc-dump-info: CPU5: stopping... [ 104.050702][ T0@C7] unisoc-dump-info: CPU7: stopping... [ 104.056541][T2335@C0] ddr_cur_freq: 1 [ 104.070830][T2335@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 104.077102][T2335@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 104.083639][T2335@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 105.090244][T2335@C0] sysdump: [ 105.093284][T2335@C0] sysdump: ********************************************** ******* [ 105.100987][T2335@C0] sysdump: * * [ 105.108689][T2335@C0] sysdump: * Sysdump enter, preparing debug info to dump ... * [ 105.116391][T2335@C0] sysdump: * * [ 105.124093][T2335@C0] sysdump: ********************************************** ******* [ 105.131794][T2335@C0] sysdump: [ 105.134925][T2335@C0] sysdump: reason: Oops: Fatal exception, sprd_sysdump_in fo->crash_key: 0 [ 105.143524][T2335@C0] sysdump: [ 105.146569][T2335@C0] sysdump: ********************************************** ******* [ 105.154270][T2335@C0] sysdump: * * [ 105.161972][T2335@C0] sysdump: * Preparing debug info done ... * [ 105.169672][T2335@C0] sysdump: * * [ 105.177374][T2335@C0] sysdump: ********************************************** ******* [ 105.185077][T2335@C0] sysdump: [ 106.188392][T2335@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 106.194662][T2335@C0] PHYS_OFFSET: 0x80000000 [ 106.198981][T2335@C0] CPU features: 0x2,00000b83,23300e42 [ 106.204349][T2335@C0] Memory Limit: none
07-04
#include <malloc.h> #include <time.h> #include <sched.h> #include <errno.h> #include <string.h> #include <pthread.h> #include "test.h" #define THREAD_MAX_N 8 #define SIZE_ALIGN (4 * sizeof(size_t)) #define MMAP_THRESHOLD 131052 #define FREE_CYCLE 16 #define THRESHOLD (MMAP_THRESHOLD / 16) #define ITER_TIME 80 #define NANOSEC_PER_SEC 1e9 #define MALLOC_TIME (ITER_TIME * (THRESHOLD / (SIZE_ALIGN + 1))) void free_all(void **ptr) { for (int j = 0; j < FREE_CYCLE; j++) { if(ptr[j]){ free(ptr[j]); ptr[j]=NULL; } } } void *func(void *arg) { int *val = (int *)arg; cpu_set_t mask; struct timespec ts[2]; int num = 0; void *ptr[FREE_CYCLE]; CPU_ZERO(&mask); CPU_SET(0, &mask); if (sched_setaffinity(0, sizeof(mask), &mask) < 0) { t_error("Set CPU affinity of thread %d failure, ERROR:%s\n", *val, strerror(errno)); return NULL; } for (int i = 0; i < ITER_TIME; ++i) { for (size_t size = 0; size < THRESHOLD; size += SIZE_ALIGN + 1) { if (num == FREE_CYCLE) { free_all(ptr); num = 0; } ptr[num] = malloc(size); if (!ptr[num]) { t_error("Thread %d malloc failed for size %u\n", *val, size); *val = errno; return NULL; } num++; } } *val = 0; return NULL; } int main(int argc, char *argv[]) { printf("start\n"); struct timespec ts[2]; pthread_attr_t attr; pthread_t tids[THREAD_MAX_N]; int t_result[THREAD_MAX_N] = {0}; int flag = 0; int ret; int i; ret = pthread_attr_init(&attr); if (ret < 0) { t_error("Init pthread attribute failed: %s\n", strerror(errno)); return -1; } clock_gettime(CLOCK_REALTIME, ts); for (i = 0; i < THREAD_MAX_N; ++i) { t_result[i] = i; ret = pthread_create(&tids[i], &attr, func, &t_result[i]); if (ret < 0) { t_error("Create pthread %u failed: %s\n", i, strerror(errno)); flag = -1; break; } } for (i = 0; i < THREAD_MAX_N; ++i) { ret = pthread_join(tids[i], NULL); if (ret < 0) { t_error("Join thread %u failed: %s\n", i, strerror(errno)); } } clock_gettime(CLOCK_REALTIME, ts + 1); (void)pthread_attr_destroy(&attr); double cost = (ts[1].tv_sec - ts[0].tv_sec) * NANOSEC_PER_SEC + (ts[1].tv_nsec - ts[0].tv_nsec); if (!flag) { t_printf("Malloc and free %d threads %d times cost %lf s\n", THREAD_MAX_N, MALLOC_TIME, cost / NANOSEC_PER_SEC); t_status = 0; } return t_status; } 这是openharmony中的一个测试程序,产生了以下内核崩溃,openharmony4.1,linux内核版本5.15.74 第一个内核崩溃日志 [ 309.609779][T14@C0] BUG: KFENCE: use-after-free read in rcu_cblist_dequeue+0x28/0x48 [ 309.609779][T14@C0] [ 309.619642][T14@C0] Use-after-free read at 0x00000000da8dbea8 (in kfence-#60): [ 309.626824][T14@C0] rcu_cblist_dequeue+0x28/0x48 [ 309.631497][T14@C0] rcu_core+0x210/0x58c [ 309.635476][T14@C0] rcu_core_si+0x20/0x30 [ 309.639544][T14@C0] __do_softirq+0x170/0x5c8 [ 309.643867][T14@C0] run_ksoftirqd+0x50/0xac [ 309.648111][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 309.652868][T14@C0] kthread+0x170/0x1d4 [ 309.656761][T14@C0] ret_from_fork+0x10/0x20 [ 309.661001][T14@C0] [ 309.663166][T14@C0] kfence-#60: 0x00000000da8dbea8-0x0000000007d404e2, size=232, cache=vm_area_struct [ 309.663166][T14@C0] [ 309.674502][T14@C0] allocated by task 2266 on cpu 0 at 309.577745s: [ 309.680741][T14@C0] vm_area_dup+0x34/0x104 [ 309.684887][T14@C0] __split_vma+0x78/0x260 [ 309.689041][T14@C0] __do_munmap+0xf8/0x724 [ 309.693195][T14@C0] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [ 309.699600][T14@C0] __arm64_sys_munmap+0x50/0x68 [ 309.704276][T14@C0] invoke_syscall+0x6c/0x15c [ 309.708688][T14@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 309.715262][T14@C0] do_el0_svc+0x34/0xac [ 309.719242][T14@C0] el0_svc+0x2c/0x94 [ 309.722963][T14@C0] el0t_64_sync_handler+0x8c/0xf0 [ 309.727809][T14@C0] el0t_64_sync+0x1b4/0x1b8 [ 309.732137][T14@C0] [ 309.734300][T14@C0] freed by task 14 on cpu 0 at 309.594072s: [ 309.740017][T14@C0] __vm_area_free+0xa0/0xe0 [ 309.744343][T14@C0] rcu_do_batch+0x2ac/0x8f4 [ 309.748669][T14@C0] rcu_core+0x210/0x58c [ 309.752649][T14@C0] rcu_core_si+0x20/0x30 [ 309.756717][T14@C0] __do_softirq+0x170/0x5c8 [ 309.761043][T14@C0] run_ksoftirqd+0x50/0xac [ 309.765284][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 309.770041][T14@C0] kthread+0x170/0x1d4 [ 309.773938][T14@C0] ret_from_fork+0x10/0x20 [ 309.778176][T14@C0] [ 309.780345][T14@C0] CPU: 0 PID: 14 Comm: ksoftirqd/0 Tainted: G W O 5.15.74 #1 [ 309.788651][T14@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 309.794276][T14@C0] ================================================================== [ 309.802149][T14@C0] irqsoff_warn: C0 T:<14>ksoftirqd/0 D:200.198ms F:309.601950s E:199.878ms [ 309.810555][T14@C0] irqsoff_warn: C0 disabled IRQ at: [ 309.810555][T14@C0] trace_hardirqs_off+0x190/0x1bc [ 309.810555][T14@C0] _raw_spin_lock_irqsave+0x98/0xc8 [ 309.810555][T14@C0] kfence_handle_page_fault+0xc4/0x320 [ 309.810555][T14@C0] __do_kernel_fault+0x1a0/0x2f4 [ 309.810555][T14@C0] do_bad_area+0x40/0x100 [ 309.839200][T14@C0] irqsoff_warn: C0 enabled IRQ at: [ 309.839200][T14@C0] trace_hardirqs_on+0x19c/0x1c8 [ 309.839200][T14@C0] _raw_spin_unlock_irqrestore+0x38/0x70 [ 309.839200][T14@C0] kfence_handle_page_fault+0x2a8/0x320 [ 309.839200][T14@C0] __do_kernel_fault+0x1a0/0x2f4 [ 309.839200][T14@C0] do_bad_area+0x40/0x100 [ 314.997853][T2080@C0] <panic> p->addr = 0x0000000013c9adbe, pc = 0xffffffc0081de8f8, pstate = 0x20400005 [ 315.007246][T2080@C0] sprd_serror_debug: panic hook handler [ 315.007298][T2080@C0] Kernel panic - not syncing: CFI failure (target: 0x7fb3780000) [ 315.020480][T2080@C0] CPU: 0 PID: 2080 Comm: irq/128-dwc3 Tainted: G B W O 5.15.74 #1 [ 315.029220][T2080@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 315.035018][T2080@C0] Call trace: [ 315.038305][T2080@C0] dump_backtrace.cfi_jt+0x0/0x8 [ 315.043236][T2080@C0] show_stack+0x28/0x38 [ 315.047392][T2080@C0] dump_stack_lvl+0x84/0xcc [ 315.051892][T2080@C0] panic+0x180/0x444 [ 315.055787][T2080@C0] __cfi_slowpath_diag+0x1e4/0x230 [ 315.060894][T2080@C0] rcu_do_batch+0x36c/0x8f4 [ 315.065392][T2080@C0] rcu_core+0x210/0x58c [ 315.069547][T2080@C0] rcu_core_si+0x20/0x30 [ 315.073786][T2080@C0] __do_softirq+0x170/0x5c8 [ 315.078287][T2080@C0] do_softirq+0x78/0xf0 [ 315.082441][T2080@C0] __local_bh_enable_ip+0xec/0x138 [ 315.087544][T2080@C0] local_bh_enable+0x28/0x38 [ 315.092134][T2080@C0] dwc3_thread_interrupt+0x12bc/0x15d0 [ 315.097580][T2080@C0] irq_thread_fn+0x54/0xe4 [ 315.101999][T2080@C0] irq_thread+0x1c8/0x3b8 [ 315.106326][T2080@C0] kthread+0x170/0x1d4 [ 315.110392][T2080@C0] ret_from_fork+0x10/0x20 [ 315.114804][T2080@C0] SMP: stopping secondary CPUs [ 315.119802][ T0@C3] unisoc-dump-info: CPU3: stopping... [ 315.125327][ T0@C2] unisoc-dump-info: CPU2: stopping... [ 315.130842][ T0@C1] unisoc-dump-info: CPU1: stopping... [ 315.136368][ T0@C6] unisoc-dump-info: CPU6: stopping... [ 315.142057][ T0@C5] unisoc-dump-info: CPU5: stopping... [ 315.147740][ T0@C4] unisoc-dump-info: CPU4: stopping... [ 315.153429][ T0@C7] unisoc-dump-info: CPU7: stopping... [ 315.159266][T2080@C0] ddr_cur_freq: 3 [ 315.172415][T2080@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 315.178677][T2080@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 315.185210][T2080@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 316.191817][T2080@C0] sysdump: [ 316.194858][T2080@C0] sysdump: ***************************************************** [ 316.202560][T2080@C0] sysdump: * * [ 316.210263][T2080@C0] sysdump: * Sysdump enter, preparing debug info to dump ... * [ 316.217965][T2080@C0] sysdump: * * [ 316.225666][T2080@C0] sysdump: ***************************************************** [ 316.233367][T2080@C0] sysdump: [ 316.236505][T2080@C0] sysdump: reason: CFI failure (target: 0x7fb3780000), sprd_sysdump_info->crash_key: 0 [ 316.246187][T2080@C0] sysdump: [ 316.249230][T2080@C0] sysdump: ***************************************************** [ 316.256931][T2080@C0] sysdump: * * [ 316.264632][T2080@C0] sysdump: * Preparing debug info done ... * [ 316.272335][T2080@C0] sysdump: * * [ 316.280036][T2080@C0] sysdump: ***************************************************** [ 316.287738][T2080@C0] sysdump: [ 317.291051][T2080@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 317.297312][T2080@C0] PHYS_OFFSET: 0x80000000 [ 317.301635][T2080@C0] CPU features: 0x2,00000b83,23300e42 [ 317.307000][T2080@C0] Memory Limit: none 第二个内核崩溃日志 [ 2060.258228][T3311@C0] ------------[ cut here ]------------ [ 2060.263654][T3311@C0] kernel BUG at mm/mmap.c:721! [ 2060.268431][T3311@C0] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 2060.274774][T3311@C0] ---Die flow print cache!--- [ 2060.279467][T3311@C0] [ 2060.281812][T3311@C0] C0 X0: 0xffffff809453cd18: [ 2060.286423][T3311@C0] C0 cd18 95fbf448 ffffff80 00000003 00000000 9453cd28 f fffff80 9453cd28 ffffff80 [ 2060.295724][T3311@C0] C0 cd38 00000000 00000000 0a526818 ffffffc0 00000001 0 0000000 94363a40 ffffff80 [ 2060.305022][T3311@C0] C0 cd58 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.314323][T3311@C0] C0 cd78 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.323624][T3311@C0] C0 cd98 8a6e0000 0000007f 8a6e8000 0000007f 95410740 f fffff80 93184f68 ffffff80 [ 2060.332925][T3311@C0] C0 cdb8 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.342225][T3311@C0] C0 cdd8 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.351530][T3311@C0] C0 cdf8 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4810 ffffff80 [ 2060.360828][T3311@C0] [ 2060.363172][T3311@C0] C0 X1: 0xffffff8092fcd278: [ 2060.367784][T3311@C0] C0 d278 00000001 00000002 92fcd230 ffffff80 989d47e0 f fffff80 989d47e0 ffffff80 [ 2060.377084][T3311@C0] C0 d298 747131fc 192c0676 92fcd2a0 ffffff80 00000001 0 0000000 93f90000 ffffff80 [ 2060.386385][T3311@C0] C0 d2b8 00000000 00000000 92fcd2c0 ffffff80 92fcd2c0 f fffff80 00000000 00000000 [ 2060.395684][T3311@C0] C0 d2d8 00000000 00000000 00000000 00000000 00000001 0 0000003 92fcd2a0 ffffff80 [ 2060.404987][T3311@C0] C0 d2f8 947d4860 ffffff80 947d4860 ffffff80 747131fc 8 92d0676 92fcd310 ffffff80 [ 2060.414286][T3311@C0] C0 d318 00000000 00000000 00000000 00000000 00000000 0 0000000 92fcd330 ffffff80 [ 2060.423588][T3311@C0] C0 d338 92fcd330 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.432887][T3311@C0] C0 d358 00000000 00000000 92fcd310 ffffff80 00000000 0 0000000 00000000 00000000 [ 2060.442188][T3311@C0] [ 2060.444532][T3311@C0] C0 X4: 0xffffff8091b9c320: [ 2060.449144][T3311@C0] C0 c320 00000000 00000000 0000000a 00000000 91b9c330 f fffff80 91b9c330 ffffff80 [ 2060.458443][T3311@C0] C0 c340 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 965d1540 ffffff80 [ 2060.467744][T3311@C0] C0 c360 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.477045][T3311@C0] C0 c380 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.486344][T3311@C0] C0 c3a0 00000000 00000000 8a6e0000 0000007f 00000000 0 0000000 00000000 00000000 [ 2060.495645][T3311@C0] C0 c3c0 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.504947][T3311@C0] C0 c3e0 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.514247][T3311@C0] C0 c400 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4850 ffffff80 [ 2060.523548][T3311@C0] [ 2060.525893][T3311@C0] C0 X21: 0xffffff808102ce20: [ 2060.530588][T3311@C0] C0 ce20 93a55150 ffffff80 0a526818 ffffffc0 00000023 0 0000000 89da97c0 ffffff80 [ 2060.539890][T3311@C0] C0 ce40 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.549190][T3311@C0] C0 ce60 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.558491][T3311@C0] C0 ce80 8a4c0000 0000007f 8a4ca000 0000007f 8102ded0 f fffff80 91b9dc18 ffffff80 [ 2060.567791][T3311@C0] C0 cea0 97c62cd0 ffffff80 91ebe678 ffffff80 95402020 f fffff80 008c56a8 ffffff01 [ 2060.577094][T3311@C0] C0 cec0 9885e400 ffffff80 00000fc3 00600000 00000071 0 0000000 966d6d08 ffffff80 [ 2060.586394][T3311@C0] C0 cee0 00000000 00000000 00000000 00000000 00000009 0 0000000 8102cef8 ffffff80 [ 2060.595694][T3311@C0] C0 cf00 8102cef8 ffffff80 00000000 00000000 0a526818 f fffffc0 00000000 00000000 [ 2060.604994][T3311@C0] [ 2060.607339][T3311@C0] C0 X23: 0xffffff8092fcd220: [ 2060.612036][T3311@C0] C0 d220 947d4ba0 ffffff80 7471301c a92c0676 92fcd230 f fffff80 00000000 00000000 [ 2060.621335][T3311@C0] C0 d240 00000000 00000000 00000000 00000000 92fcd250 f fffff80 92fcd250 ffffff80 [ 2060.630640][T3311@C0] C0 d260 00000000 00000000 00000000 00000000 00000000 0 0000000 00000001 00000002 [ 2060.639938][T3311@C0] C0 d280 92fcd230 ffffff80 989d47e0 ffffff80 989d47e0 f fffff80 747131fc 192c0676 [ 2060.649241][T3311@C0] C0 d2a0 92fcd2a0 ffffff80 00000001 00000000 93f90000 f fffff80 00000000 00000000 [ 2060.658542][T3311@C0] C0 d2c0 92fcd2c0 ffffff80 92fcd2c0 ffffff80 00000000 0 0000000 00000000 00000000 [ 2060.667839][T3311@C0] C0 d2e0 00000000 00000000 00000001 00000003 92fcd2a0 f fffff80 947d4860 ffffff80 [ 2060.677141][T3311@C0] C0 d300 947d4860 ffffff80 747131fc 892d0676 92fcd310 f fffff80 00000000 00000000 [ 2060.686439][T3311@C0] [ 2060.688786][T3311@C0] C0 X25: 0xffffff809453cd18: [ 2060.693483][T3311@C0] C0 cd18 95fbf448 ffffff80 00000003 00000000 9453cd28 f fffff80 9453cd28 ffffff80 [ 2060.702782][T3311@C0] C0 cd38 00000000 00000000 0a526818 ffffffc0 00000001 0 0000000 94363a40 ffffff80 [ 2060.712085][T3311@C0] C0 cd58 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.721387][T3311@C0] C0 cd78 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.730685][T3311@C0] C0 cd98 8a6e0000 0000007f 8a6e8000 0000007f 95410740 f fffff80 93184f68 ffffff80 [ 2060.739988][T3311@C0] C0 cdb8 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.749288][T3311@C0] C0 cdd8 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.758590][T3311@C0] C0 cdf8 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4810 ffffff80 [ 2060.767889][T3311@C0] [ 2060.770233][T3311@C0] C0 X26: 0xffffff80954106c0: [ 2060.774932][T3311@C0] C0 06c0 00000000 00000000 00000000 00000000 954106d0 f fffff80 954106d0 ffffff80 [ 2060.784230][T3311@C0] C0 06e0 00000000 00000000 00000000 00000000 07f835a5 0 0000000 00000000 00000000 [ 2060.793533][T3311@C0] C0 0700 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.802831][T3311@C0] C0 0720 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.812133][T3311@C0] C0 0740 8a6f0000 0000007f 8a6f2000 0000007f 954100e8 f fffff80 9453cd98 ffffff80 [ 2060.821433][T3311@C0] C0 0760 91ebe678 ffffff80 95402f88 ffffff80 931842d8 f fffff80 00008000 00000000 [ 2060.830735][T3311@C0] C0 0780 9885e400 ffffff80 00000f82 04600000 00100070 0 0000000 00000000 00000000 [ 2060.840035][T3311@C0] C0 07a0 00000000 00000000 00000000 00000000 00000000 0 0000000 954107b8 ffffff80 [ 2060.849335][T3311@C0] [ 2060.851680][T3311@C0] C0 X27: 0xffffff8091b9c320: [ 2060.856379][T3311@C0] C0 c320 00000000 00000000 0000000a 00000000 91b9c330 f fffff80 91b9c330 ffffff80 [ 2060.865677][T3311@C0] C0 c340 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 965d1540 ffffff80 [ 2060.874979][T3311@C0] C0 c360 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.884277][T3311@C0] C0 c380 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.893578][T3311@C0] C0 c3a0 00000000 00000000 8a6e0000 0000007f 00000000 0 0000000 00000000 00000000 [ 2060.902880][T3311@C0] C0 c3c0 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.912179][T3311@C0] C0 c3e0 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.921482][T3311@C0] C0 c400 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4850 ffffff80 [ 2060.930780][T3311@C0] [ 2060.933127][T3311@C0] C0 X28: 0xffffff809453cd90: [ 2060.937822][T3311@C0] C0 cd90 00000000 00000000 8a6e0000 0000007f 8a6e8000 0 000007f 95410740 ffffff80 [ 2060.947123][T3311@C0] C0 cdb0 93184f68 ffffff80 93184db9 ffffff80 00000000 0 0000000 93184f88 ffffff80 [ 2060.956427][T3311@C0] C0 cdd0 00000000 00000000 9885e400 ffffff80 00000fc3 0 0600000 00100073 00000000 [ 2060.965726][T3311@C0] C0 cdf0 950c2900 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.975027][T3311@C0] C0 ce10 947d4810 ffffff80 947d4810 ffffff80 92fcd2a0 f fffff80 00000000 00000000 [ 2060.984326][T3311@C0] C0 ce30 0ff14dc6 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.993628][T3311@C0] C0 ce50 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2061.002929][T3311@C0] C0 ce70 00000000 00000000 00000000 00000000 10680000 0 000007f 106a4000 0000007f [ 2061.012233][T3311@C0] sysdump: dump_die_cb save pregs_die_g ok . [ 2061.018225][T3311@C0] Modules linked in: npu_img_vha(O) sprd_vdsp(O) vpu(O) s prdbt_tty(O) mali_kbase(O) sprd_wlan_combo(O) flash_ic_aw3641(O) chsc5xxx(O) spr d_compr_2stage_dma sprd_dmaengine_pcm snd_soc_sprd_dai snd_soc_sprd_vbc_fe snd_s oc_sprd_vbc_v4 sprd_platform_pcm_routing snd_soc_sprd_tdm snd_soc_sprd_pdm_r2p0 snd_soc_sprd_dummy_codec snd_soc_unisoc_dp_codec snd_soc_sprd_codec_ump9620 snd_ soc_sprd_codec_ump9620_power_dev snd_soc_sprd_codec_ump9620_power snd_soc_sprd_c ard snd_soc_sprd_ocp96011 snd_soc_sprd_pa_aw87390 voice_trigger_irq sprd_cp_dvfs sprd_pmic_wdt sprd_audcp_boot sprd_audcp_dvfs mcdt_hw_r2p0 audio_pipe sprd_apip e sprd_audio_usb_offload audio_dsp_dump audio_sipc audio_mem agdsp_pd [ 2061.080043][T3311@C0] CPU: 0 PID: 3311 Comm: malloc-multi-th Tainted: G W O 5.15.74 #1 [ 2061.089077][T3311@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 2061.094901][T3311@C0] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS B TYPE=--) [ 2061.102723][T3311@C0] pc : __vma_adjust+0xc44/0xc78 [ 2061.107589][T3311@C0] lr : __vma_adjust+0x260/0xc78 [ 2061.112460][T3311@C0] sp : ffffffc0144d3c10 [ 2061.116630][T3311@C0] x29: ffffffc0144d3c70 x28: ffffff809453ce10 x27: ffffff 8091b9c3a0 [ 2061.124628][T3311@C0] x26: ffffff8095410740 x25: ffffff809453cd98 x24: 000000 0000000000 [ 2061.132625][T3311@C0] x23: ffffff8092fcd2a0 x22: 0000000000000000 x21: ffffff 808102cea0 [ 2061.140620][T3311@C0] x20: 0000000000000000 x19: ffffffc00ac5e000 x18: ffffff c0132f5050 [ 2061.148618][T3311@C0] x17: 0000000000000000 x16: 0000000000000000 x15: 000000 0000000008 [ 2061.156613][T3311@C0] x14: 0000000000000000 x13: 0000000000000004 x12: 000000 0c78d2bef3 [ 2061.164612][T3311@C0] x11: 0000007f8a4c0000 x10: 0000007f8a6e0000 x9 : 000000 0000000000 [ 2061.172611][T3311@C0] x8 : 0000000000000000 x7 : 0000000000000000 x6 : 000000 0000000000 [ 2061.180607][T3311@C0] x5 : 0000000000000000 x4 : ffffff8091b9c3a0 x3 : ffffff c0144d3aa0 [ 2061.188604][T3311@C0] x2 : 000000010006b6fe x1 : ffffff8092fcd2f8 x0 : ffffff 809453cd98 [ 2061.196599][T3311@C0] Call trace: [ 2061.199906][T3311@C0] __vma_adjust+0xc44/0xc78 [ 2061.204424][T3311@C0] __split_vma+0x14c/0x260 [ 2061.208855][T3311@C0] __do_munmap+0x168/0x724 [ 2061.213291][T3311@C0] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [ 2061.219896][T3311@C0] __arm64_sys_munmap+0x50/0x68 [ 2061.224761][T3311@C0] invoke_syscall+0x6c/0x15c [ 2061.229369][T3311@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 2061.236150][T3311@C0] do_el0_svc+0x34/0xac [ 2061.240324][T3311@C0] el0_svc+0x2c/0x94 [ 2061.244235][T3311@C0] el0t_64_sync_handler+0x8c/0xf0 [ 2061.249276][T3311@C0] el0t_64_sync+0x1b4/0x1b8 [ 2061.253801][T3311@C0] Code: 9400281d aa1303ea 35fffe40 17fffd49 (d4210000) [ 2061.260749][T3311@C0] ---[ end trace 1949c3d540cc5187 ]--- [ 2061.287887][T238@C7] [SPRD_PDBG] #---------PDBG LIGHT SLEEP START---------# [ 2061.288611][T3311@C0] <panic> p->addr = 0x00000000d7c1766e, pc = 0xffffffc008 1de8f8, pstate = 0x604003c5 [ 2061.294790][T238@C7] [SPRD_PDBG] [SLP_STATE] deep: 0xfffffffffffffecc, light: 0xffffffffffffff20 [ 2061.304250][T3311@C0] sprd_serror_debug: panic hook handler [ 2061.304258][T3311@C0] Kernel panic - not syncing: Oops - BUG: Fatal exception [ 2061.304261][T3311@C0] SMP: stopping secondary CPUs [ 2061.304461][T238@C7] unisoc-dump-info: CPU7: stopping... [ 2061.304900][ T0@C1] unisoc-dump-info: CPU1: stopping... [ 2061.305319][ T0@C6] unisoc-dump-info: CPU6: stopping... [ 2061.305892][ T0@C2] unisoc-dump-info: CPU2: stopping... [ 2061.306313][ T0@C3] unisoc-dump-info: CPU3: stopping... [ 2061.306732][ T0@C5] unisoc-dump-info: CPU5: stopping... [ 2061.307305][ T0@C4] unisoc-dump-info: CPU4: stopping... [ 2061.307871][T3311@C0] ddr_cur_freq: 1 [ 2061.318118][T3311@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 2061.318303][T3311@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 2061.318315][T3311@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 2062.318360][T3311@C0] sysdump: [ 2062.318362][T3311@C0] sysdump: ********************************************** ******* [ 2062.318365][T3311@C0] sysdump: * * [ 2062.318367][T3311@C0] sysdump: * Sysdump enter, preparing debug info to dump ... * [ 2062.318369][T3311@C0] sysdump: * * [ 2062.318372][T3311@C0] sysdump: ********************************************** ******* [ 2062.318373][T3311@C0] sysdump: [ 2062.318392][T3311@C0] sysdump: reason: Oops - BUG: Fatal exception, sprd_sysd ump_info->crash_key: 0 [ 2062.318523][T3311@C0] sysdump: [ 2062.318527][T3311@C0] sysdump: ********************************************** ******* [ 2062.318528][T3311@C0] sysdump: * * [ 2062.318530][T3311@C0] sysdump: * Preparing debug info done ... * [ 2062.318532][T3311@C0] sysdump: * * [ 2062.318535][T3311@C0] sysdump: ********************************************** ******* [ 2062.318536][T3311@C0] sysdump: [ 2063.318737][T3311@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 2063.318747][T3311@C0] PHYS_OFFSET: 0x80000000 [ 2063.318749][T3311@C0] CPU features: 0x2,00000b83,23300e42 [ 2063.318756][T3311@C0] Memory Limit: none static void __insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma) { struct vm_area_struct *prev; struct rb_node **rb_link, *rb_parent; if (find_vma_links(mm, vma->vm_start, vma->vm_end, &prev, &rb_link, &rb_parent)) BUG(); __vma_link(mm, vma, prev, rb_link, rb_parent); mm->map_count++; } mmap.c 721代码如上 BUG();,如何修复这个问题
07-04
-dump time is 1970-01-01_08-51-07 -reboot reg is 80 -reset mode is d -reason is kernel_crash -bootcause_cmdline is Reboot into panic -exception_reboot_reason: kernel_crash Vmcoreinfo: -kimage_voffset = 0xffffffbf88000000 -phys_offset = 0x80000000 -kaslr_offset = 0x80000 -vabits_actual = 39 -exception_kernel_version:Linux version 5.15.74 (lhl@ISS) (OHOS (dev) clang version 15.0.4 (llvm-project 81cdec3cd117b1e6e3a9f1ebc4695d790c978463), LLD 15.0.4) #1 SMP PREEMPT Thu Jun 19 11:17:09 CST 2025 -exception_panic_reason:Oops - BUG: Fatal exception -exception_file_infoi: -exception_task_id:2271 -exception_task_family:[malloc-multi-th, 2271][hdcd, 1651] -exception_pc_symbol:[<ffffffc00848ee10>] __vma_adjust+0xc44/0xc78 -exception_stack_info:[<ffffffc00913ac08>] get_exception_stack_info+0x128/0x2a4 [<ffffffc00913afd4>] prepare_exception_info+0x178/0x1d0 [<ffffffc00913bc68>] sysdump_panic_event+0x730/0x92c [<ffffffc00821e0fc>] atomic_notifier_call_chain+0x88/0x100 [<ffffffc0081deaa0>] panic+0x1a8/0x444 [<ffffffc00814bed8>] die+0x2dc/0x2f4 [<ffffffc00814d5b8>] bug_handler+0x54/0xf8 [<ffffffc008139fc0>] brk_handler+0xa8/0x170 [<ffffffc008173c30>] do_debug_exception+0xc4/0x1a8 [<ffffffc00980e968>] el1_dbg+0x48/0x68 [<ffffffc00980e7a4>] el1h_64_sync_handler+0x48/0xa4 [<ffffffc008091b10>] el1h_64_sync+0x7c/0x80 [<ffffffc00848ee10>] __vma_adjust+0xc44/0xc78 [<ffffffc008491bc0>] __split_vma+0x14c/0x260 [<ffffffc008491e18>] __do_munmap+0xf8/0x724 [<ffffffc008492630>] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [<ffffffc00849276c>] __arm64_sys_munmap+0x50/0x68 [<ffffffc008159204>] invoke_syscall+0x6c/0x15c [<ffffffc008159110>] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [<ffffffc008158fc4>] do_el0_svc+0x34/0xac [<ffffffc00980edb0>] el0_svc+0x2c/0x94 [<ffffffc00980ed20>] el0t_64_sync_handler+0x8c/0xf0 [<ffffffc008091e48>] el0t_64_sync+0x1b4/0x1b8 -dump time is 1970-01-01_22-30-34 -reboot reg is 80 -reset mode is d -reason is kernel_crash -bootcause_cmdline is Reboot into panic -exception_reboot_reason: kernel_crash Vmcoreinfo: -kimage_voffset = 0xffffffbf88000000 -phys_offset = 0x80000000 -kaslr_offset = 0x80000 -vabits_actual = 39 -exception_kernel_version:Linux version 5.15.74 (lhl@ISS) (OHOS (dev) clang version 15.0.4 (llvm-project 81cdec3cd117b1e6e3a9f1ebc4695d790c978463), LLD 15.0.4) #1 SMP PREEMPT Thu Jun 19 11:17:09 CST 2025 -exception_panic_reason:Oops: Fatal exception -exception_file_infoi:not-bugon -exception_task_id:2335 -exception_task_family:[malloc-multi-th, 2335][hdcd, 1563] -exception_pc_symbol:[<ffffffc0084c492c>] kmem_cache_alloc+0x128/0x3dc -exception_stack_info:[<ffffffc00913ac08>] get_exception_stack_info+0x128/0x2a4 [<ffffffc00913afd4>] prepare_exception_info+0x178/0x1d0 [<ffffffc00913bc68>] sysdump_panic_event+0x730/0x92c [<ffffffc00821e0fc>] atomic_notifier_call_chain+0x88/0x100 [<ffffffc0081deaa0>] panic+0x1a8/0x444 [<ffffffc00814bed8>] die+0x2dc/0x2f4 [<ffffffc0081744dc>] __do_kernel_fault+0x298/0x2f4 [<ffffffc0081740d0>] do_bad_area+0x40/0x100 [<ffffffc00987fe4c>] do_translation_fault+0x5c/0x70 [<ffffffc00817364c>] do_mem_abort+0x74/0x138 [<ffffffc00980e844>] el1_abort+0x44/0x68 [<ffffffc00980e7c0>] el1h_64_sync_handler+0x64/0xa4 [<ffffffc008091b10>] el1h_64_sync+0x7c/0x80 [<ffffffc0084c492c>] kmem_cache_alloc+0x128/0x3dc [<ffffffc0081d7e6c>] vm_area_alloc+0x34/0xac [<ffffffc00848fc8c>] mmap_region+0x268/0x728 [<ffffffc00848f754>] do_mmap+0x3d4/0x540 [<ffffffc00845d308>] vm_mmap_pgoff+0xd0/0x234 [<ffffffc008490208>] ksys_mmap_pgoff+0xbc/0x108 [<ffffffc00814b394>] __arm64_sys_mmap+0x44/0x54 [<ffffffc008159204>] invoke_syscall+0x6c/0x15c [<ffffffc008159110>] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [<ffffffc008158fc4>] do_el0_svc+0x34/0xac [<ffffffc00980edb0>] el0_svc+0x2c/0x94 [<ffffffc00980ed20>] el0t_64_sync_handler+0x8c/0xf0 [<ffffffc008091e48>] el0t_64_sync+0x1b4/0x1b8 -dump time is 1970-01-01_23-09-04 -reboot reg is 80 -reset mode is d -reason is kernel_crash -bootcause_cmdline is Reboot into panic -exception_reboot_reason: kernel_crash Vmcoreinfo: -kimage_voffset = 0xffffffbf88000000 -phys_offset = 0x80000000 -kaslr_offset = 0x80000 -vabits_actual = 39 -exception_kernel_version:Linux version 5.15.74 (lhl@ISS) (OHOS (dev) clang version 15.0.4 (llvm-project 81cdec3cd117b1e6e3a9f1ebc4695d790c978463), LLD 15.0.4) #1 SMP PREEMPT Thu Jun 19 11:17:09 CST 2025 -exception_panic_reason:Oops - BUG: Fatal exception -exception_file_infoi: -exception_task_id:3311 -exception_task_family:[malloc-multi-th, 3311][hdcd, 1535] -exception_pc_symbol:[<ffffffc00848ee10>] __vma_adjust+0xc44/0xc78 -exception_stack_info:[<ffffffc00913ac08>] get_exception_stack_info+0x128/0x2a4 [<ffffffc00913afd4>] prepare_exception_info+0x178/0x1d0 [<ffffffc00913bc68>] sysdump_panic_event+0x730/0x92c [<ffffffc00821e0fc>] atomic_notifier_call_chain+0x88/0x100 [<ffffffc0081deaa0>] panic+0x1a8/0x444 [<ffffffc00814bed8>] die+0x2dc/0x2f4 [<ffffffc00814d5b8>] bug_handler+0x54/0xf8 [<ffffffc008139fc0>] brk_handler+0xa8/0x170 [<ffffffc008173c30>] do_debug_exception+0xc4/0x1a8 [<ffffffc00980e968>] el1_dbg+0x48/0x68 [<ffffffc00980e7a4>] el1h_64_sync_handler+0x48/0xa4 [<ffffffc008091b10>] el1h_64_sync+0x7c/0x80 [<ffffffc00848ee10>] __vma_adjust+0xc44/0xc78 [<ffffffc008491bc0>] __split_vma+0x14c/0x260 [<ffffffc008491e88>] __do_munmap+0x168/0x724 [<ffffffc008492630>] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [<ffffffc00849276c>] __arm64_sys_munmap+0x50/0x68 [<ffffffc008159204>] invoke_syscall+0x6c/0x15c [<ffffffc008159110>] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [<ffffffc008158fc4>] do_el0_svc+0x34/0xac [<ffffffc00980edb0>] el0_svc+0x2c/0x94 [<ffffffc00980ed20>] el0t_64_sync_handler+0x8c/0xf0 [<ffffffc008091e48>] el0t_64_sync+0x1b4/0x1b8 -dump time is 1970-01-01_23-52-44 -reboot reg is 80 -reset mode is d -reason is kernel_crash -bootcause_cmdline is Reboot into panic -exception_reboot_reason: kernel_crash Vmcoreinfo: -kimage_voffset = 0xffffffbf88000000 -phys_offset = 0x80000000 -kaslr_offset = 0x80000 -vabits_actual = 39 -exception_kernel_version:Linux version 5.15.74 (lhl@ISS) (OHOS (dev) clang version 15.0.4 (llvm-project 81cdec3cd117b1e6e3a9f1ebc4695d790c978463), LLD 15.0.4) #1 SMP PREEMPT Thu Jun 19 11:17:09 CST 2025 -exception_panic_reason:CFI failure (target: 0x7fb3780000) -exception_file_infoi:not-bugon -exception_task_id:2080 -exception_task_family:[irq/128-dwc3, 2080][kthreadd, 2] -exception_pc_symbol:[<ffffffc00913b728>] sysdump_panic_event+0x1f0/0x92c -exception_stack_info:[<ffffffc00913ac08>] get_exception_stack_info+0x128/0x2a4 [<ffffffc00913afd4>] prepare_exception_info+0x178/0x1d0 [<ffffffc00913bc68>] sysdump_panic_event+0x730/0x92c [<ffffffc00821e0fc>] atomic_notifier_call_chain+0x88/0x100 [<ffffffc0081deaa0>] panic+0x1a8/0x444 [<ffffffc0083fc9a0>] __cfi_slowpath_diag+0x1e4/0x230 [<ffffffc0082b56d0>] rcu_do_batch+0x36c/0x8f4 [<ffffffc0082b4fe8>] rcu_core+0x210/0x58c [<ffffffc0082ade4c>] rcu_core_si+0x20/0x30 [<ffffffc008090460>] __do_softirq+0x170/0x5c8 [<ffffffc0081ea344>] do_softirq+0x78/0xf0 [<ffffffc0081ea280>] __local_bh_enable_ip+0xec/0x138 [<ffffffc00813e280>] local_bh_enable+0x28/0x38 [<ffffffc008d507f4>] dwc3_thread_interrupt+0x12bc/0x15d0 [<ffffffc00828ee04>] irq_thread_fn+0x54/0xe4 [<ffffffc00828ea84>] irq_thread+0x1c8/0x3b8 [<ffffffc00821c220>] kthread+0x170/0x1d4 [<ffffffc008095118>] ret_from_fork+0x10/0x20 -dump time is 1970-01-01_08-26-27 -reboot reg is 80 -reset mode is d -reason is kernel_crash -bootcause_cmdline is Reboot into panic -exception_reboot_reason: kernel_crash Vmcoreinfo: -kimage_voffset = 0xffffffbf88000000 -phys_offset = 0x80000000 -kaslr_offset = 0x80000 -vabits_actual = 39 -exception_kernel_version:Linux version 5.15.74 (lhl@ISS) (OHOS (dev) clang version 15.0.4 (llvm-project 81cdec3cd117b1e6e3a9f1ebc4695d790c978463), LLD 15.0.4) #1 SMP PREEMPT Sat Jun 14 17:38:52 CST 2025 -exception_panic_reason:Oops: Fatal exception in interrupt -exception_file_infoi:not-bugon -exception_task_id:14 -exception_task_family:[ksoftirqd/0, 14][kthreadd, 2] -exception_pc_symbol:[<7f9b140000>] 0x7f9b140000 -exception_stack_info:[<ffffffc009165794>] get_exception_stack_info+0x128/0x2a4 [<ffffffc009165b60>] prepare_exception_info+0x178/0x1d0 [<ffffffc0091667f4>] sysdump_panic_event+0x730/0x92c [<ffffffc00821f770>] atomic_notifier_call_chain+0x88/0x100 [<ffffffc0081e0028>] panic+0x1b4/0x458 [<ffffffc00814c94c>] die+0x2cc/0x2f4 [<ffffffc008175984>] __do_kernel_fault+0x298/0x2f4 [<ffffffc0098ab4a8>] do_page_fault+0x2e8/0x694 [<ffffffc008174af4>] do_mem_abort+0x74/0x138 [<ffffffc0098393dc>] el1_abort+0x44/0x68 [<ffffffc009839358>] el1h_64_sync_handler+0x64/0xa4 [<ffffffc008091b10>] el1h_64_sync+0x7c/0x80 [<7f9b140000>] 0x7f9b140000 [<ffffffc0082b6a88>] rcu_core+0x210/0x58c [<ffffffc0082af8ec>] rcu_core_si+0x20/0x30 [<ffffffc008090460>] __do_softirq+0x170/0x5c8 [<ffffffc0081ed0ec>] run_ksoftirqd+0x50/0xac [<ffffffc008224724>] smpboot_thread_fn+0x2d4/0x3d8 [<ffffffc00821d894>] kthread+0x170/0x1d4 [<ffffffc008095118>] ret_from_fork+0x10/0x20 #include <malloc.h> #include <time.h> #include <sched.h> #include <errno.h> #include <string.h> #include <pthread.h> #include "test.h" #define THREAD_MAX_N 8 #define SIZE_ALIGN (4 * sizeof(size_t)) #define MMAP_THRESHOLD 131052 #define FREE_CYCLE 16 #define THRESHOLD (MMAP_THRESHOLD / 16) #define ITER_TIME 80 #define NANOSEC_PER_SEC 1e9 #define MALLOC_TIME (ITER_TIME * (THRESHOLD / (SIZE_ALIGN + 1))) void free_all(void **ptr) { for (int j = 0; j < FREE_CYCLE; j++) { free(ptr[j]); } } void *func(void *arg) { int *val = (int *)arg; cpu_set_t mask; struct timespec ts[2]; int num = 0; void *ptr[FREE_CYCLE]; CPU_ZERO(&mask); CPU_SET(0, &mask); if (sched_setaffinity(0, sizeof(mask), &mask) < 0) { t_error("Set CPU affinity of thread %d failure, ERROR:%s\n", *val, strerror(errno)); return NULL; } for (int i = 0; i < ITER_TIME; ++i) { for (size_t size = 0; size < THRESHOLD; size += SIZE_ALIGN + 1) { if (num == FREE_CYCLE) { free_all(ptr); num = 0; } ptr[num] = malloc(size); if (!ptr[num]) { t_error("Thread %d malloc failed for size %u\n", *val, size); *val = errno; return NULL; } num++; } } *val = 0; return NULL; } int main(int argc, char *argv[]) { struct timespec ts[2]; pthread_attr_t attr; pthread_t tids[THREAD_MAX_N]; int t_result[THREAD_MAX_N] = {0}; int flag = 0; int ret; int i; ret = pthread_attr_init(&attr); if (ret < 0) { t_error("Init pthread attribute failed: %s\n", strerror(errno)); return -1; } clock_gettime(CLOCK_REALTIME, ts); for (i = 0; i < THREAD_MAX_N; ++i) { t_result[i] = i; ret = pthread_create(&tids[i], &attr, func, &t_result[i]); if (ret < 0) { t_error("Create pthread %u failed: %s\n", i, strerror(errno)); flag = -1; break; } } for (i = 0; i < THREAD_MAX_N; ++i) { ret = pthread_join(tids[i], NULL); if (ret < 0) { t_error("Join thread %u failed: %s\n", i, strerror(errno)); } } clock_gettime(CLOCK_REALTIME, ts + 1); (void)pthread_attr_destroy(&attr); double cost = (ts[1].tv_sec - ts[0].tv_sec) * NANOSEC_PER_SEC + (ts[1].tv_nsec - ts[0].tv_nsec); if (!flag) { t_printf("Malloc and free %d threads %d times cost %lf s\n", THREAD_MAX_N, MALLOC_TIME, cost / NANOSEC_PER_SEC); t_status = 0; } return t_status; } 在鸿蒙开发者手机 4.1版本中 使用的时5.15.74版本linux内核,在跑上述的单核cpu多线程malloc和free时,出现了前面所述的几种内核崩溃类型,在最新linux5.15.y版本中是否有相应的解决提交记录
最新发布
07-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值