Data structure repair
Download
1 / 13

Data Structure Repair - PowerPoint PPT Presentation


  • 97 Views
  • Updated On :

Data Structure Repair. Data structure repair problem. Broken Data Structure. Errors Missing elements Inappropriate sharing Dangling references Out of bounds array indices Inconsistent values. F = 20 G = 10 . F = 20 G = 5 . I = 5. J = 2. Solution. Broken Data Structure.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Data Structure Repair' - mendel


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Data structure repair problem l.jpg
Data structure repair problem

Broken Data Structure

Errors

  • Missing elements

  • Inappropriate sharing

  • Dangling references

  • Out of bounds array indices

  • Inconsistent values

F = 20

G = 10

F = 20

G = 5

I = 5

J = 2


Solution l.jpg
Solution

Broken Data Structure

Consistent Data Structure

F = 20

G = 10

F = 2

G = 1

F = 10

G = 5

F = 20

G = 10

F = 20

G = 5

Repair

Algorithm

I = 3

I = 5

J = 2

J = 2


Repair is computed over abstract model l.jpg
Repair is computed over abstract model

Broken

Abstract Model

Repaired

Abstract Model

Abstract

Repair

Model

Definition

Rules

10111001011

10101011101

10101110110

00011001011

10101011101

10101110110

Concrete Data

Structure Updates

Broken

Bits

Repaired

Bits


Reasoning at compile time l.jpg
Reasoning at Compile Time

  • Compile specifications into repair algorithms

  • Goal-directed reasoning takes place at compile time

  • Consider possibility that |Bitmap| = 0

  • Abstract repair

    • Choose a block in Free set

    • Add block to Bitmap set

  • Concrete repair

    • Find relevant model definition rule:

      true  d.block[d.blockbitmap]  Bitmap

    • Goal-directed reasoning finds following update:

      d.blockbitmap = index of block in d.block array

    • Check that block is an element of d.block array: b in [0..numblocks-1], d.block[b] Used d.block[b]Free


Multiple repairs l.jpg
Multiple Repairs

  • Some broken data structures may require multiple repairs

  • Reconstruct model

  • Reevaluate consistency constraints

  • Perform any required additional repairs


Architecture l.jpg
Architecture

Broken

Abstract Model

Repaired

Abstract Model

Abstract

Repair

. . . .

Model

Translation

10111001011

10101011101

10101110110

01011001011

10101011101

10101110110

00011001011

10101011101

10101110110

. . . .

Automatically

Generated

Concrete

Repair

Broken

Bits

Repaired

Bits


Acyclic repair dependences l.jpg
Acyclic Repair Dependences

  • Questions

    • Isn’t it possible for the repair of one constraint to invalidate another constraint?

    • What about infinite repair loops?

    • What about unsatisfiable specifications?

  • Answer

    • We require specifications to have no cyclic repair dependences between constraints

    • So all generated repair sequences terminate

    • Repair can fail only because of resource limitations

    • But, some repairs are never attempted


Repair dependence graph l.jpg
Repair Dependence Graph

4.

Satisfy Rule 6

(BlockStatus)

1. |Bitmap|=1

2. Add block to Bitmap

5. f.BlockStatus=false

3. d.blockbitmap=indexof(bfree)

6. Replace <f,true> with

<f,false> in BlockStatus

8. Remove <f,true>

from BlockStatus by

removing Bitmap

7. b.bitmap[j]=false

for j=indexof(f)


Repair dependence graph10 l.jpg
Repair Dependence Graph

4.

Satisfy Rule 6

(BlockStatus)

1. |Bitmap|=1

2. Add block to Bitmap

5. f.BlockStatus=false

3. d.blockbitmap=indexof(bfree)

6. Replace <f,true> with

<f,false> in BlockStatus

8. Remove <f,true>

from BlockStatus by

removing Bitmap

7. b.bitmap[j]=false

for j=indexof(f)


Repair dependence graph11 l.jpg
Repair Dependence Graph

4.

Satisfy Rule 6

(BlockStatus)

1. |Bitmap|=1

2. Add block to Bitmap

5. f.BlockStatus=false

3. d.blockbitmap=indexof(bfree)

6. Replace <f,true> with

<f,false> in BlockStatus

7. b.bitmap[j]=false

for j=indexof(f)


When to test for consistency and repair l.jpg
When to Test for Consistency and Repair

  • Persistent data structures

    • Repair can be independent activity, or

    • Repair when data written out or read in

  • Volatile data structures in running program

    • Under programmer control

    • Transaction-based approach

      • Identify transaction start and end

      • Repair at start, end, or both

    • Failure-based approach

      • Wait until program fails

      • Repair and restart from latest safe point


Experience l.jpg
Experience

  • We acquired five benchmarks (written in C/C++)

    • AbiWord

    • x86 emulator

    • CTAS (air-traffic control tool)

    • Simplified Linux file system

    • Freeciv interactive game

  • We developed specifications for all five

    • Little development time (days, not weeks)

    • Most of time spent figuring out Freeciv and CTAS

  • Each benchmark has

    • Workload

    • Bug or fault insertion methodology

  • Ran benchmarks with and without repair