1# memcheck 2 3 4## Command Function 5 6This command is used to check whether the dynamically allocated memory block is complete and whether nodes in the memory pool are damaged due to out-of-bounds memory access. 7 8 9## Syntax 10 11memcheck 12 13 14## Parameters 15 16None. 17 18 19## Usage Guidelines 20 21- If all nodes in the memory pool are complete, "system memcheck over, all passed!" is displayed. 22 23- If a node in the memory pool is incomplete, information about the memory block of the corrupted node is displayed. 24 25 26## Example 27 28Run **memcheck**. 29 30Run **memcheck**, and memory overwriting occurs. 31 32 33## Output 34 35Example 1: No error is detected. 36 37``` 38OHOS # memcheck 39system memcheck over, all passed! 40``` 41 42Example 2: Memory overwriting is detected. 43 44``` 45[L0S DLnkCheckMenl 349, memory check 46stFreeNodeInfo.pstPrev:0x7e0d31f3 is out of legal mem range[0x80ba5f40, 0х83d00000] 47cur node: 0x81f2ce0c 48pre node: 0x81f28a98 49pre node was allocated by task:sofia 50uwEхcTуpe = 0х2 51puмExcBuffAddr pc = 0x803ad7a4 52puwExcBuffAddr lr = 0x803ad7a4 53puwExcBuffAddr sp = 0х80cb7de0 54puwExcBuffAddr fp = 0x80cb7dec 55***backtrace begin*** 56traceback 0 -- lr = 0х8037cb84 57traceback 0 -- fp = 0х80cb7e1c 58traceback 1 -- lr = 0х8037033c 59traceback 1 -- fp = 0х80cb7e24 60traceback 2 -- lr = 0x8000d108 61traceback 2 -- fp = 0х80cb7e94 62traceback 3 -- lr = 0х8037c7ac 63traceback 3 -- fp = 0х80cb7ea4 64traceback 4 -- lr = 0x803ad9e8 65traceback 4 -- fp = 9x11111111 66``` 67