code-philia / microbat

A feedback-based debugger for interactively recommending suspicious step in buggy program execution.
2 stars 2 forks source link

Cli 17: cannot locate root cause with RootCauseFinder #52

Open HongshuW opened 1 week ago

HongshuW commented 1 week ago
myxxxsquared commented 1 week ago

Failure due to nature of the algorithm.

To fix this bug, we need to add a basic block alignment module to align each jump in the code, which is a huge change to the algorithm.

This algorithm will never find root cause in the following programs.

correct

def func():
    global x
    x = 1
    return
    x = 2

func()
assert(x == 1)

buggy

def func():
    global x
    x = 1
    x = 2

func()
assert(x == 1)

To fix this bug, we need to align each basic block and insert fake jump operations. For this example, a fake line in buggy will be added.

buggy

def func():
    global x
    x = 1
    if False: return # Fake line added to align the "return" statement in the correct program.
    x = 2
myxxxsquared commented 6 days ago

This could not be solved by mending. Because, using mending, you will know which trace make a step be executed. But you will not know why a step is not executed. Consider if there is a jump statement, you will not know which jump statement is wrong so that a step is not executed.