• No results found

Some Meanderings

N/A
N/A
Protected

Academic year: 2022

Share "Some Meanderings"

Copied!
414
0
0

Loading.... (view fulltext now)

Full text

(1)

(www.cse.iitb.ac.in/˜uday)

Department of Computer Science and Engineering, Indian Institute of Technology, Bombay

Feb 2022

(2)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Some meanderings in precise and scalable analysis

• Intraprocedural analysis

• Interprocedural analysis

• Conclusions

1/99

(3)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

The following people have contributed to the work presented in these slides Alan Mycroft,

Amey Karkare, Amitabha Sanyal, Anshuman Dhuliya, Bageshri Sathe, Komal Pathade, Mehul Jain,

Prashant Singh Rawat, Pritam Gharat, Rasesh Tongia, Rohan Padhye, Supratik Chakraborty Swati Jaiswal, Vini Kanvar, . . . and many more have contributed indirectly

(4)

Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Some Meanderings

(5)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

“The worst thing that has happened to Computer Science is C, because it brought pointers with it . . . ”

- Frances Allen, IITK Workshop (2007)

• A couple of influential papers

◦ Which Pointer Analysis should I Use?

Michael Hind and Anthony Pioli. ISTAA 2000

◦ Pointer Analysis: Haven’t we solved this problem ? Michael Hind PASTE

yet 2001

(6)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• A keynote address:

“The worst thing that has happened to Computer Science is C, because it brought pointers with it . . . ”

- Frances Allen, IITK Workshop (2007)

• A couple of influential papers

◦ Which Pointer Analysis should I Use?

Michael Hind and Anthony Pioli. ISTAA 2000

◦ Pointer Analysis: Haven’t we solved this problem ? Michael Hind PASTE

yet 2001

3/99

(7)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

“The worst thing that has happened to Computer Science is C, because it brought pointers with it . . . ”

- Frances Allen, IITK Workshop (2007)

• A couple of influential papers

◦ Which Pointer Analysis should I Use?

Michael Hind and Anthony Pioli. ISTAA 2000

◦ Pointer Analysis: Haven’t we solved this problem ? Michael Hind PASTE

yet 2001

◦ 2022 . . .

(8)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

In the most general situation

• Alias analysis is undecidable.

Landi-Ryder [POPL 1991], Landi [LOPLAS 1992], Ramalingam [TOPLAS 1994]

• Flow insensitive alias analysis is NP-hard Horwitz [TOPLAS 1997]

• Points-to analysis is undecidable Chakravarty [POPL 2003]

Adjust your expectations suitably to avoid disappointments!

4/99

(9)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

To quote Hind [PASTE 2001]

(10)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

To quote Hind [PASTE 2001]

• “Fortunately many approximations exist”

5/99

(11)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

To quote Hind [PASTE 2001]

• “Fortunately many approximations exist”

• “Unfortunately too manyapproximations exist!”

(12)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

To quote Hind [PASTE 2001]

• “Fortunately many approximations exist”

• “Unfortunately too manyapproximations exist!”

Engineering of pointer analysis is much more dominant than its science

5/99

(13)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

The tyranny of (exclusive) OR Precision OR Efficiency?

• Science view Build cleanabstractions

Can we harness the Genius of AND?

Precision AND Efficiency?

(14)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Engineering view Build quickapproximations

The tyranny of (exclusive) OR Precision OR Efficiency?

• Science view Build cleanabstractions

Can we harness the Genius of AND?

Precision AND Efficiency?

• Most common trend as evidenced by publications

◦ Build acceptable approximations guided by empirical observations

◦ The notion of acceptability is often constrained by beliefs rather than possibilities

6/99

(15)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

values

• Mapping concrete values to abstract values

◦ Abstraction.

Deciding which properties of the concrete values are essential What Ease of understanding, reasoning, modelling etc. Why

◦ Approximation.

Deciding which properties of the concrete values cannot What be represented accurately and should be summarized

Decidability, tractability, or efficiency and scalability Why

(16)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Capture the clouds in this picture for study Need to meet some resource constraints Cannot represent the entire picture accurately

8/99

(17)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Need to meet some resource constraints Cannot represent the entire picture accurately

Use approximation and meet resource constraints Usually easy and scalable, but imprecise

Some times, too imprecise to be of any use

(18)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Capture the clouds in this picture for study Need to meet some resource constraints Cannot represent the entire picture accurately

Use approximation and meet resource constraints Usually easy and scalable, but imprecise

Some times, too imprecise to be of any use

Use abstraction and meet resource constraints Usually difficult, need to dig deeper to define exactly what is needed and what can be thrown away However, it can be precise and scalable

8/99

(19)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Abstractions

◦ focus on precision and conciseness of modelling

◦ tell us what we can ignore without being imprecise

• Approximations

◦ focus on efficiency and scalability

◦ tell us the imprecision that we have to tolerate

(20)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Abstractions

◦ focus on precision and conciseness of modelling

◦ tell us what we can ignore without being imprecise

• Approximations

◦ focus on efficiency and scalability

◦ tell us the imprecision that we have to tolerate

• Our Holy Grail

Build clean abstractions before surrendering to the approximations

9/99

(21)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Ideally, an analysis should be

◦ Sound

◦ Precise

◦ Scalable

(22)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Common belief

• Precision and scalability cannot be achieved together for exhaustive analysis Common Practice

• Trade off precision using approximations

• Ideally, an analysis should be

◦ Sound

◦ Precise

◦ Scalable

10/99

(23)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Ideally, an analysis should be

◦ Sound

◦ Precise

◦ Scalable

• The main factors enhancing the precision of an exhaustive (as against a demand-driven) analysis are

◦ Flow sensitivity

◦ Context sensitivity

◦ Field sensitivity

◦ Precise heap abstraction

◦ Precise call graph

(24)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Compromises on these lead to approximations

• Ideally, an analysis should be

◦ Sound

◦ Precise

◦ Scalable

• The main factors enhancing the precision of an exhaustive (as against a demand-driven) analysis are

◦ Flow sensitivity

◦ Context sensitivity

◦ Field sensitivity

◦ Precise heap abstraction

◦ Precise call graph

10/99

(25)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Exhaustive. Compute all possible information

• Demand-Driven. Compute only the requested information (by a client) Different from incremental analysis which also computes only some information but it updates the earlier computed solution

(26)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction Role in precision Cause of non-scalability Distinguishes between Needs to consider Flow sensitivity

Context sensitivity Field sensitivity

Precise heap abstraction Precise call structure

12/99

(27)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction

Distinguishes between Needs to consider Flow sensitivity Information at different

program points Context sensitivity Information in

different contexts Field sensitivity Different fields

of an object Precise heap abstraction Different heap

locations

Precise call structure Indirect calls made to different callees from the same program point

(28)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction Role in precision Cause of non-scalability Distinguishes between Needs to consider Flow sensitivity Information at different

program points A large number of program points Context sensitivity Information in

different contexts Exponentially large number of contexts Field sensitivity Different fields

of an object Pointees along different fields Precise heap abstraction Different heap

locations Unbounded number

of heap locations Precise call structure Indirect calls made to

different callees from the same program point

Precise points-to information

12/99

(29)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Approximation Admits

Flow insensitivity Context insensitivity (or partial context sensitivity) Field insensitivity

Imprecision in call graphs Allocation site based heap abstraction

(30)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Approximation Admits

Flow insensitivity Spurious intraprocedural paths Context insensitivity (or

partial context sensitivity) Spurious interprocedural paths Field insensitivity Spurious paths in the memory graph Imprecision in call graphs Spurious call sequences

Allocation site based

heap abstraction Spurious paths in the memory graph

13/99

(31)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Approximation Imprecision

causes

Non-Scalability causemay

may seem to warrant

(32)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

• Approximations may create a vicious cycle

Approximation Imprecision

causes

Non-Scalability causemay

may seem to warrant

• Two examples of non-scalability cause by approximations

◦ k-limited call strings may create “butterfly cycles” causing spurious

fixed point computations [Hakjoo, 2010]

◦ Imprecision in function pointer analysis overapproximates calls may create spurious recursion in call graphs

14/99

(33)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

1 S1 1 2 S2 23 S3 3

i Si i

m Sm m

Start

0 S001 S112 S223 S33

. . .

i Si i

. . .

m Smm

End

(34)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

0 S0 0 1 S1 1 2 S2 23 S3 3

i Si i

m Sm m

Start

0 S001 S112 S223 S33

. . .

i Si i

. . .

m Smm

End

Assumption: Statements can be executed in any order

15/99

(35)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

1 S1 1 2 S2 23 S3 3

i Si i

m Sm m

Start

0 S001 S112 S223 S33

. . .

i Si i

. . .

m Smm

End

(36)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startp x= &a; Startp

y=x;a p1

x= &b;

p2

Endp y =x; Endp

x−→a,x−→b, y−→a,y−→b

Flow-insensitive analysis is less precise than a flow-sensitive analysis

Flow-insensitive points-to information

x−→b, y−→a Flow-sensitive points-to information

16/99

(37)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

(38)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

17/99

(39)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

(40)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

17/99

(41)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

a c

(42)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

a c

17/99

(43)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

a c

a b

×

×

(44)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

a c

17/99

(45)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

a c

a c

× ×

(46)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

a c

a b a c

17/99

(47)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startr

Endr Starts

a= &b

Ends Ci

Ri

ci

Startt a= &c

Endt Cj

Rj

cj

fr

a b

a b

a c

a c

a b a c

(48)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Starts

Ci

Ri

Ends

call

return callingstop

18/99

(49)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

s

Ci

Ri

Ends

call

return callingstop

• Paths fromStarts toEnds should constitute a context free language

calln·stop·returnn

• If we treat cycle of recursion as an SCC

◦ Calls and returns become jumps, and

◦ paths are approximated by a regular language

call·stop·return

(50)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

19/99

(51)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(52)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,2)

• What is the value range ofa?

19/99

(53)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,2) (2,2)

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

(54)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,2) (2,2)

(2,2)

(3,3)

• What is the value range ofa?

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

19/99

(55)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,2) (2,2)

(2,2)

(3,3)

(3,3)

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

(56)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,2) (2,2)

• What is the value range ofa?

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

19/99

(57)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,2)

(1,2)

(2,3)

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

(58)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1) (1,2)

(2,3)

(2,3) (2,3)

• What is the value range ofa?

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

19/99

(59)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,3)

(1,3)

(2,4)

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

(60)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1) (1,3)

(2,4)

(2,4) (2,4)

• What is the value range ofa?

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

19/99

(61)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1)

(2,4)

(1,4)

(2,5)

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

(62)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

(1,1) (1,4)

(2,5)

(2,5) (2,5)

• What is the value range ofa?

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

◦ Range ofaatEndmainis (2, . . .)

19/99

(63)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

◦ Range ofaatEndmainis (2, . . .)

(64)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Startmain

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

• What is the value range ofa?

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

◦ Range ofaatEndmainis (2, . . .)

• Spurious interprocedural loops

19/99

(65)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

a= 1

CallP

CallP

CallP

Endmain

Startp

a=a+1

Endp

• Context sensitive analysis

◦ Data flow value propagated back to thecurrentcaller ofP

◦ Range ofaatEndmainis (3,3)

• Context insensitive analysis

◦ Data flow value propagated back to every caller

◦ Range ofaatEndmainis (2, . . .)

• Spurious interprocedural loops

• Spurious fixed point computations

(66)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Program Field-sensitive points-to graph

Field-insensitive points-to graph

x→f = &y x→g = &z w =x→f

x y

z w f

g

20/99

(67)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Program Field-sensitive points-to graph

Field-insensitive points-to graph

x→f = &y x→g = &z w =x→f

x y

z w f

g

x y

z w

(68)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Program Field-sensitive points-to graph

Field-insensitive points-to graph

x→f = &y x→g = &z w =x→f

x y

z w f

g

Field-insensitive analysis is less precise than a field-sensitive analysis

x y

z w

20/99

(69)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

[B] Ability to store data flow information parameterized by contexts at each program point

[C] Flow sensitivity at the intraprocedural level (otherwise distinct calls to the same procedure within a procedure cannot be distinguished)

(70)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

[A] Full context sensitivity regardless of the call depth even in recursion [B] Ability to store data flow information parameterized by contexts at each

program point

[C] Flow sensitivity at the intraprocedural level (otherwise distinct calls to the same procedure within a procedure cannot be distinguished)

• In particular

◦ k-limiting violates [A]

◦ Treating recursion as an SCC violates [A]

◦ Functional approaches violate [B]

◦ Object sensitivity violates [C]

21/99

(71)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

[B] Ability to store data flow information parameterized by contexts at each program point

[C] Flow sensitivity at the intraprocedural level (otherwise distinct calls to the same procedure within a procedure cannot be distinguished)

• In particular

◦ k-limiting violates [A]

◦ Treating recursion as an SCC violates [A]

◦ Functional approaches violate [B]

◦ Object sensitivity violates [C]

• Object sensitivity (without the creation sites) can be modelled by call context sensitivity

◦ by a flow sensitive propagation of values representing objects, and

◦ identifying a procedure by an (object, procedure) pair, and

(72)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

FI=

FI

FISSA

FSNoKill FS

CI CSObjSens CSRecIns CS

FlowSensitivityIncreases

Context Sensitivity Increases

precision of points-to analysis (flow, context, and field sensitivity), hamper scalability

22/99

(73)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

FI=

FI

FISSA

FSNoKill FS

CI CSObjSens CSRecIns CS

FlowSensitivityIncreases

Data structures: BDDs, probabilistic

(74)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

FI=

FI

FISSA

FSNoKill FS

CI CSObjSens CSRecIns CS

FlowSensitivityIncreases

Context Sensitivity Increases

precision of points-to analysis (flow, context, and field sensitivity), hamper scalability

Data structures: BDDs, probabilistic Methods: Parallel, demand, randomized

22/99

(75)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

FI=

FI

FISSA

FSNoKill FS

CI CSObjSens CSRecIns CS

FlowSensitivityIncreases

Data structures: BDDs, probabilistic Methods: Parallel, demand, randomized

Refinement: Level-wise, bootstrapping

(76)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

FI=

FI

FISSA

FSNoKill FS

CI CSObjSens CSRecIns CS

FlowSensitivityIncreases

Context Sensitivity Increases

precision of points-to analysis (flow, context, and field sensitivity), hamper scalability

Data structures: BDDs, probabilistic Methods: Parallel, demand, randomized

Refinement: Level-wise, bootstrapping Data structures: BDDs, probabilistic

Methods: Parallel, demand, randomized Refinement: Level-wise, bootstrapping

Crowded Area

Thinly populated Refinement: Level-wise, bootstrapping Data structures: BDDs, probabilistic

Methods: Parallel, demand, randomized

22/99

(77)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

FI=

FI

FISSA

FSNoKill FS

CI CSObjSens CSRecIns CS

FlowSensitivityIncreases

Data structures: BDDs, probabilistic Methods: Parallel, demand, randomized

Refinement: Level-wise, bootstrapping Data structures: BDDs, probabilistic

Methods: Parallel, demand, randomized Refinement: Level-wise, bootstrapping

Crowded Area

Thinly populated Refinement: Level-wise, bootstrapping Data structures: BDDs, probabilistic

Methods: Parallel, demand, randomized

That’s the corner we are trying to occupy :)

(78)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction

Flow- and Field- sensitivity Context- sensitivity (actually

caller- sensitivity)

Precise heap abstraction Precise call structure

23/99

(79)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Flow- and Field- sensitivity Context- sensitivity (actually

caller- sensitivity)

Precise heap abstraction Precise call structure

Restrict the computation only to the usable data.

Weave liveness discovery into the analysis

(80)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction

Flow- and Field- sensitivity

Joint liveness and points-to analysis Partial accomplishment (SAS12) Bypassing irrelevant calls for liveness

and points-to analysis Work in progress

Context- sensitivity (actually

caller- sensitivity)

Precise heap abstraction Precise call structure

Avoid propagation of irrelevant information about pointers to callees

23/99

(81)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Flow- and Field- sensitivity

Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress Context-

sensitivity (actually

caller- sensitivity)

Precise heap abstraction Precise call structure

Automatic flexible need-based collaboration between analyses

(82)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction

Flow- and Field- sensitivity

Joint liveness and points-to analysis Partial accomplishment (SAS12) Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Precise heap abstraction Precise call structure

Lifting any given analyses to a level where known infeasible paths are excluded

23/99

(83)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Flow- and Field- sensitivity

Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Value contexts Mature accomplishment (CC08,SOAP13)

Precise heap abstraction Precise call structure

Distinguish between contexts by their data flow values and not their call chains

(84)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction

Flow- and Field- sensitivity

Joint liveness and points-to analysis Partial accomplishment (SAS12) Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Value contexts Mature accomplishment (CC08,SOAP13) GPG based bottom-up summary

flow functions Mature accomplishment (SAS16,

TOPLAS20)

Precise heap abstraction Precise call structure

Avoid recomputations for each context.

Use a higher level abstraction of memory.

23/99

(85)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Flow- and Field- sensitivity

Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Value contexts Mature accomplishment (CC08,SOAP13) GPG based bottom-up summary

flow functions Mature accomplishment (SAS16,

TOPLAS20) A Unified model of context-sensitive

methods Mature accomplishment (CSUR21)

Precise heap abstraction Precise call structure

Model the essential requirements of context- sensitivity

(86)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction

Flow- and Field- sensitivity

Joint liveness and points-to analysis Partial accomplishment (SAS12) Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Value contexts Mature accomplishment (CC08,SOAP13) GPG based bottom-up summary

flow functions Mature accomplishment (SAS16,

TOPLAS20) A Unified model of context-sensitive

methods Mature accomplishment (CSUR21)

Interprocedural SSA form Work in progress Precise heap

abstraction Precise call structure

Eliminate pointer dereferences and construct context-sensitive SSA

23/99

(87)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Flow- and Field- sensitivity

Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Value contexts Mature accomplishment (CC08,SOAP13) GPG based bottom-up summary

flow functions Mature accomplishment (SAS16,

TOPLAS20) A Unified model of context-sensitive

methods Mature accomplishment (CSUR21)

Interprocedural SSA form Work in progress Precise heap

abstraction

Liveness analysis of heap Partial accomplishment (TOPLAS07)

Precise call structure

Identify the part of heap actually accessed in terms of patterns of accesses

(88)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Abstraction

Flow- and Field- sensitivity

Joint liveness and points-to analysis Partial accomplishment (SAS12) Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Value contexts Mature accomplishment (CC08,SOAP13) GPG based bottom-up summary

flow functions Mature accomplishment (SAS16,

TOPLAS20) A Unified model of context-sensitive

methods Mature accomplishment (CSUR21)

Interprocedural SSA form Work in progress Precise heap

abstraction

Liveness analysis of heap Partial accomplishment (TOPLAS07) Combined allocation site and

access path abstraction Mature accomplishment (ISMM17) Precise call

structure

Distinguish between heap locations based on how they are accessed apart from how they are allocated

23/99

(89)

Uday Khedker IIT Bombay Talk Title:

PSPA Research Topic:

Some Meanderings Intraprocedural Analysis Interprocedural Analysis Conclusions References

Flow- and Field- sensitivity

Bypassing irrelevant calls for liveness

and points-to analysis Work in progress Synergistic program analyses Work in progress

Partially path-sensitive analysis Mature accomplishment (CC18,CC19) Context-

sensitivity (actually

caller- sensitivity)

Value contexts Mature accomplishment (CC08,SOAP13) GPG based bottom-up summary

flow functions Mature accomplishment (SAS16,

TOPLAS20) A Unified model of context-sensitive

methods Mature accomplishment (CSUR21)

Interprocedural SSA form Work in progress Precise heap

abstraction

Liveness analysis of heap Partial accomplishment (TOPLAS07) Combined allocation site and

access path abstraction Mature accomplishment (ISMM17) Precise call

structure

Callee sensitivity Work in progress

Call strings record call history. We need to record callfuturealso.

References

Related documents

I Sets, relations, functions, partial orders, graphs Combinatorics.. Elements of graph theory Elements of

(Only calls that get disconnected after 30 seconds from transfer to the ACD will be considered for computation of this SLA). AHT shall be calculated as the sum of the

Call Centre with detailed specifications of Hardware & Software in the bid document. The selected bidder will be solely responsible for the training of the Call Centre staff

Penalties for contraventions in manufacture and sale of Drugs Under section 27 of the Act, the sale, stocking, exhibition or distribution of any adulterated, spurious and

The cyclomatic number is equal to the number of linearly independent paths through a program in its graphs representation.... Fig.: The basic construct of the

• The noise immunity of a logic circuit refers to the circuits ability to tolerate noise.. without causing spurious change in the

The transmittance and reflectance show a marked thickness dependency at particular frequencies where transmittance (voltage) becomes greater than one and

The deductor can use the TAN view facility available at TIN website to verify both upload and booking status of the TDS/TCS statement uploaded by it. What are