HarmonyOS 鸿蒙Next HI3861上socket数据解析过程,发生KERNEL PANIC No suitable free block, require free node size:

发布于 1周前 作者 htzhanglong 最后一次编辑是 5天前 来自 鸿蒙OS

HarmonyOS 鸿蒙Next HI3861上socket数据解析过程,发生KERNEL PANIC,大神帮看下是啥原因:[ERR] [OsMemAllocWithCheck] No suitable free block, require free node size:

hi3861开发板上socket高频通讯出现以下问题(注:程序中主要逻辑是解析和打印数据包),求助!无可用内存块么:

[ERR] [OsMemAllocWithCheck] No suitable free block, require free node size: 0x128<button style="position: absolute; padding: 4px 8px 0px; cursor: pointer; top: 8px; right: 8px; font-size: 14px;">复制</button>

=======KERNEL PANIC=======

syserr info start
kernel_ver      : Hi3861V100 R001C00SPC025,2020-09-03 18:10:00
Exception Information
PC Task Name    : pthread9
PC Task ID      = 9
Cur Task ID     = 9
Task Stack Size = 0x1000
Exception Type  = 0x4
reg info
mepc         = 0x41ef06
mstatus      = 0x1800
mtval        = 0x52bc8b87
mcause       = 0x4
ccause       = 0x0
ra           = 0x41eeea
sp           = 0xfb070
gp           = 0x11a9c0
tp           = 0x7b0ae04f
t0           = 0x8
t1           = 0xffffffe0
t2           = 0x0
s0           = 0xe
s1           = 0xe4d4c
a0           = 0x88
a1           = 0xe
a2           = 0x0
a3           = 0xdaa801da
a4           = 0x52bc8b8b
a5           = 0xad5400ed
a6           = 0xa
a7           = 0x6c
s2           = 0xe5000
s3           = 0x108c78
s4           = 0x88
s5           = 0x11d000
s6           = 0xfb1f8
s7           = 0x4a0000
s8           = 0x7070707
s9           = 0x6060606
s10          = 0x5050505
s11          = 0x4040404
t3           = 0x0
t4           = 0xeded62
t5           = 0x0
t6           = 0x0
memory info
Pool Addr    = 0xe8a40
Pool Size    = 0x2fb80
Fail Count   = 0x0
Peek Size    = 0x21610
Used Size    = 0x215bc
task info
Name         : pthread9
ID           = 9
Status       = 0x14
Stack Index  = 0x8
Stack Peak   = 0x644
Stack Size   = 0x1000
SP           = 0x11a860
Stack        : 0xfa4a0 to 0xfb4a0
Real SP      = 0xfb070
Stack Overflow  = 0
track_info
current_item:0x8
item_cnt:10
Index   TrackType   TrackID  CurTime  Data1  Data2
0001 0065 0009 0x12c0 0x3f5e78 0x3f4870
0002 0016 0034 0x12c0 0x3f4870 0x0
0003 0065 0007 0x12c0 0x3f4870 0x3f5e78
0004 0065 0009 0x12c0 0x3f5e78 0x3f4870
0005 0016 0007 0x12c0 0x3f486c 0x0
0006 0065 0000 0x12c1 0x3f486c 0x3f5e78
0007 0065 0007 0x12c1 0x3f5e78 0x3f5e78
0008 0065 0009 0x12c1 0x3f5e78 0x3f486c
0009 0016 0034 0x12c0 0x3f4870 0x0
0010 0065 0007 0x12c0 0x3f4870 0x3f5e78
Call Stack
Call Stack 0 – 41efcc addr:fb12c
Call Stack 1 – 496010 addr:fb14c
Call Stack 2 – 49632c addr:fb18c
Call Stack 3 – 496730 addr:fb1ec
Call Stack 4 – 4964aa addr:fb21c
Call Stack 5 – 496420 addr:fb450
Call Stack 6 – 496fc2 addr:fb45c
Call Stack 7 – 3f78c0 addr:fb48c
Call Stack 8 – 3f5e24 addr:fb49c
Call Stack end
6 回复
欢迎知道的大牛来帮帮楼主~
暂时已经解决,原因是动态分配的内存未及时释放

楼主,是怎么释放的,用的是liteos内核里面的函数吗?

内存问题没了,但出现了watchdog问题:


**********watchdog isr********** **********syserr info start********** kernel_ver : Hi3861V100 R001C00SPC025,2020-09-03 18:10:00 **********Exception Information********** PC Task Name : IdleCore PC Task ID = 1 Cur Task ID = 1 Task Stack Size = 0x400 Exception Type = 0x80000021 **********reg info********** mepc = 0xd99ec mstatus = 0x1880 mtval = 0x0 mcause = 0x80000021 ccause = 0x0 ra = 0xd99c8 sp = 0xeb2b0 gp = 0x11a9c0 tp = 0x7908e04f t0 = 0x4249d2 t1 = 0x3fa9a0 t2 = 0x28282828 s0 = 0xe8ba0 s1 = 0x14141414 a0 = 0x0 a1 = 0x7e0 a2 = 0x29 a3 = 0xfffffff1 a4 = 0xd00a0dff a5 = 0x0 a6 = 0x0 a7 = 0x20202020 s2 = 0x13131313 s3 = 0x12121212 s4 = 0x11111111 s5 = 0x10101010 s6 = 0x9090909 s7 = 0x8080808 s8 = 0x7070707 s9 = 0x6060606 s10 = 0x5050505 s11 = 0x4040404 t3 = 0x19191919 t4 = 0x18181818 t5 = 0x17171717 t6 = 0x16161616 **********memory info********** Pool Addr = 0xe8a40 Pool Size = 0x2fb80 Fail Count = 0x0 Peek Size = 0x18e1c Used Size = 0x14b54 **********task info********** Name : IdleCore ID = 1 Status = 0x14 Stack Index = 0x8 Stack Peak = 0x134 Stack Size = 0x400 SP = 0x119880 Stack : 0xeaf80 to 0xeb380 Real SP = 0xeb2b0 Stack Overflow = 0 **********track_info********** current_item:0x7 item_cnt:10 Index TrackType TrackID CurTime Data1 Data2 0001 0016 0007 0xd58d 0xd99ec 0x0 0002 0016 0007 0xd58e 0xd99ec 0x0 0003 0065 0000 0xd58f 0xd99ec 0x3f5e78 0004 0065 0007 0xd58f 0x3f5e78 0x3f5e78 0005 0065 0001 0xd58f 0x3f5e78 0xd99ec 0006 0016 0007 0xd58f 0xd99ec 0x0 0007 0016 0007 0xd590 0xd99ec 0x0 0008 0065 0006 0xd58c 0xd99ec 0x3f5e78 0009 0065 0001 0xd58c 0x3f5e78 0xd99ec 0010 0016 0007 0xd58c 0xd99ec 0x0 **********Call Stack********** Call Stack 0 -- 3f6cf8 addr:eb35c Call Stack 1 -- 3f78c0 addr:eb36c Call Stack 2 -- 3f5e24 addr:eb37c **********Call Stack end**********<button style="position: absolute; padding: 4px 8px 0px; cursor: pointer; top: 8px; right: 8px; font-size: 14px;">复制</button>

在HarmonyOS鸿蒙系统上,遇到KERNEL PANIC通常表明内核遇到了无法恢复的错误。您提到的[ERR] [OsMemAllocWithCheck] No suitable free block, require free node size:错误提示表明在内存分配时找不到足够大的空闲块。这可能是因为:

  1. 内存碎片严重,导致虽然总内存足够,但无法找到连续的大块内存。
  2. 应用程序或其他服务占用了过多内存,导致可用内存不足。

建议检查以下几点:

  • 审查内存使用情况,查看是否有内存泄漏。
  • 优化内存管理策略,减少碎片化。
  • 评估是否有必要增加系统内存或优化内存分配逻辑。

如果问题依旧没法解决请加我微信,我的微信是itying888。

回到顶部