Purify: Fast Detection of Memory Leaks and Access Errors PowerPoint PPT Presentation

presentation player overlay
About This Presentation
Transcript and Presenter's Notes

Title: Purify: Fast Detection of Memory Leaks and Access Errors


1
????? ?????? ????? ?????
  • Purify Fast Detection of Memory Leaks and Access
    Errors

???? ?????
2
?????
????? ?????? - ??? ???????? ??????? ??????
?? ????? ????? ????? ??????? ?????? ?????
??? ??? ?????? ?????? ?????? ????
3
??? ???? ????? ???????? ?????? ?????? ??????
?????? ? ??????? ?????? ????? ??????? ?????? ??
????? ????? ????-????. ???????? ???? ?????? -
??????? ???????, ??????? ?????? ??????. ??????
?????? ???? ????? ????. ??? ???? ??? ??????
?????? ???? ????? ?????? ?????? ?? ????
??????.
4
???? ?????? ????? ?????? ?????? ? Memory Access
Errors ????? ??????? ????? ?????? ??? ?????
???? (??-??????, ????? ??????
??????) ????? ?????? ??? ????? ?????? ?????
5
????? ?????? ?????? ????
6
????? ?????? ?????? ?? ??????
7
????? ?????? ?????? ?????? ?????
8
????? ?????? ?????
9
????? ?? Run-Time Debugging
Source Code
Instrumentation
Executable
Run-Time debugger
BUG
10
(No Transcript)
11
  • Purify
  • ???? ??????
  • Object Code Insertion
  • ??????? ?????
  • ??????

12
Error Warning Information
13
(No Transcript)
14
(No Transcript)
15
(No Transcript)
16
(No Transcript)
17
(No Transcript)
18
(No Transcript)
19
(No Transcript)
20
(No Transcript)
21
(No Transcript)
22
(No Transcript)
23
???? ?????? ??????? ??? ?????? ?? ???? ???????
?????
24
(No Transcript)
25
(No Transcript)
26
(No Transcript)
27
(No Transcript)
28
(No Transcript)
29
(No Transcript)
30
(No Transcript)
31
(No Transcript)
32
(No Transcript)
33
???? ????? ?????? ?? ????? ????? ??????? ???-??
?????
34
(No Transcript)
35
(No Transcript)
36
(No Transcript)
37
(No Transcript)
38
(No Transcript)
39
(No Transcript)
40
???? ?? ????? ?????? ?-Object Code??? ??? ?????
(Third Party Code)
?????
41
(No Transcript)
42
(No Transcript)
43
(No Transcript)
44
(No Transcript)
45
(No Transcript)
46
Code Instrumentation
1) Including Files
Source Code
2) Source Code Insertion
Object Code
3) Object Code Insertion
Executable
4) Executable Code Insertion
??? ?? ????? ?? ???? ?????? ??? ??????
47
(No Transcript)
48
(No Transcript)
49
(No Transcript)
50
(No Transcript)
51
(No Transcript)
52
Object Code Insertion
53
????? ?????? ????? ?? Purify
54
????? ????? ???????
?????? ??????????? ??
???????? ????? ????????????? ?? ?????? (???, ???)
?????? ????????(unresolved references)
?????? ????????(unresolved references)
???? ??????
55
(No Transcript)
56
Old Object Code Table
New Object Code Table
Forward Index Table
Forward Index Control Table
Inter-Item Offset Table
57
????? ?????? ???? ????
Memory Status Array Memory
Monitoring Memory Access - byte-level detection -
stack access efficiency
58
Detecting Array Bounds Violations
????? ?-red-zones ?????? ??? ?????? (watch points)
59
(No Transcript)
60
(No Transcript)
61
(No Transcript)
62
(No Transcript)
63
Detecting Memory Leaks
??? ????? MARK ????? ?? ??????? ??? ??
???????? ????????????. ??? ??? SWEEP ????? ??
??????? ???????. ( ?? ???? ????? ?? ????? ?????,
????? ?????. ) ?-Heap ????? ?????? ????? -
?????? ????? ???? ???? ??? (??? ??????? ?????) -
?????? ??? ??? ????????? (??? ??????? ???????) -
?????? ????? ??? (?? ??????? ???????)
64
??????? OCI
1) ???? ?????? 2) Instrumentation ???? ????? ???
????? ????????? 3) ??? ????? ??????, ??? ????
???? ?????. ???? ????? ??? ?? ???? ???? ???
?-assembly ??????? ????????. 4) ????? ????
????? ????? ????? ???? ???? ???? ?-object
code ???? ?????? ??????? ?????? ?? ?? ????.
65
??????? ???????
1) ???? ???? ???? ?????? ??????????, ???? ?????
?????? ?????? (????? ????? ?? ??????). 2)
????? ?????? ???? ???? ????. 3) ??????? ??????
?????????? ????? ???????? - ?????? ????? -
?????? ??????? ?????? - dangling pointers -
?-Purify ?? ?????? ???? ????? ??????? (Sub-Allocat
ors)
66
Working at Source Level
Memdebug (Schmit Rene) ????? ????????? ???????
malloc, calloc, realloc ?-free. ????? ??
????? ?-PreProcessor
?? ????? ?-header ???? memdebug.h, define
MEMDEBUG ????? ???? ????? ??????.???? ?????
?????? ?????? ????? ?-stdout.
67
??????? ??????
?????? ??????? - ?? sentinels memorization
?-BlockDescriptor ???? ?????
????? ?-CallSequence record ???? ?????? ?????
(?????????)
????? ?-malloc
68
????? ?-free
??? ????? ???? ?????? ???? ?? ??????? ???????
????? ???.
69
Insure / ParaSoft Source Code Insertion
????? ???? ???? ??????? ???? (printf(d,
1.0 . ???? ?????? ??? ??????? - ??? ????
?????? ?? ????? ??????, ????? ????? ???.
???? ?????? ??? ???????? - ????? ???? ????? ????
????? ???? ???? ????? ????. ????? ??????
?????? ?? reference counting ???? ??????.
????? ?????? ?????? ???????. ????? ?????? ?????
?-object code (??? Sentinel). Interfaces.
70
Mutation Testing
Subsumption of the coverage criteria
Statement coverage Decision
coverage Condition coverage The coupling
effect Effective test case killed mutant
Adequate test sets
71
Creating the Test Set
72
The Mothra system mutation operators
Write a Comment
User Comments (0)
About PowerShow.com