1 / 13

# Data Structure Repair - PowerPoint PPT Presentation

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.

Related searches for Data Structure Repair

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

## PowerPoint Slideshow about 'Data Structure Repair' - mendel

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

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

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

Broken

Abstract Model

Repaired

Abstract Model

Abstract

Repair

Model

Definition

Rules

10111001011

10101011101

10101110110

00011001011

10101011101

10101110110

Concrete Data

Broken

Bits

Repaired

Bits

• 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

• Some broken data structures may require multiple repairs

• Reconstruct model

• Reevaluate consistency constraints

• Perform any required additional repairs

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

• Questions

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

• What about infinite repair loops?

• 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

4.

Satisfy Rule 6

(BlockStatus)

1. |Bitmap|=1

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)

4.

Satisfy Rule 6

(BlockStatus)

1. |Bitmap|=1

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)

4.

Satisfy Rule 6

(BlockStatus)

1. |Bitmap|=1

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)

• 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

• 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