• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# memcheck
2
3## Command Function<a name="section191633812516"></a>
4
5This 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.
6
7## Syntax<a name="section428816435510"></a>
8
9memcheck
10
11## Parameters<a name="section1939943304411"></a>
12
13None
14
15## Usage<a name="section228914491951"></a>
16
17-   If all nodes in the memory pool are complete, "system memcheck over, all passed!" is displayed.
18-   If a node in the memory pool is incomplete, information about the memory block of the corrupted node is displayed.
19
20## Example<a name="section17373205314515"></a>
21
22Run  **memcheck**.
23
24## Output<a name="section13406205385413"></a>
25
26Example 1: All nodes in the memory pool are complete.
27
28```
29OHOS # memcheck
30system memcheck over, all passed!
31```
32
33Example 2: Out-of-bounds memory access is detected.
34
35```
36[L0S DLnkCheckMenl 349, memory check
37stFreeNodeInfo.pstPrev:0x7e0d31f3 is out of legal mem range[0x80ba5f40, 0х83d00000]
38cur node: 0x81f2ce0c
39pre node: 0x81f28a98
40pre node was allocated by task:sofia
41uwEхcTуpe = 0х2
42puмExcBuffAddr pc = 0x803ad7a4
43puwExcBuffAddr lr = 0x803ad7a4
44puwExcBuffAddr sp = 0х80cb7de0
45puwExcBuffAddr fp = 0x80cb7dec
46*******backtrace begin*******
47traceback 0 -- lr = 0х8037cb84
48traceback 0 -- fp = 0х80cb7e1c
49traceback 1 -- lr = 0х8037033c
50traceback 1 -- fp = 0х80cb7e24
51traceback 2 -- lr = 0x8000d108
52traceback 2 -- fp = 0х80cb7e94
53traceback 3 -- lr = 0х8037c7ac
54traceback 3 -- fp = 0х80cb7ea4
55traceback 4 -- lr = 0x803ad9e8
56traceback 4 -- fp = 9x11111111
57```
58
59