hernanponcedeleon / Dat3M

A verification tool for many memory models
MIT License
77 stars 29 forks source link

Null pointer exception when using baselines for safe-stack #280

Closed hernanponcedeleon closed 2 years ago

hernanponcedeleon commented 2 years ago

The following command raise an exception

java -jar dartagnan/target/dartagnan-3.0.0.jar cat/tso.cat --bound=2 --refinement.baseline=no_oota,uniproc,atomic_rmw --target=TSO --method=caat /home/Dat3M/dartagnan/src/test/resources/lfds/safe_stack-3.bpl

while this one does not

java -jar dartagnan/target/dartagnan-3.0.0.jar cat/tso.cat --bound=2 --target=TSO --method=caat /home/Dat3M/dartagnan/src/test/resources/lfds/safe_stack-3.bpl
ThomasHaas commented 2 years ago

This problem is triggered because of new code related to the PR that introduced the Dependency class (i.e. the dependency analysis). Since then, the BasicRegRelation.getSMTVar method calls task.getProgramEncoder().dependencyEdge(...), so there is a dependency on task.getProgramEncoder. The problem now is this:

All this happens because of a combination of hacky code and unfortunate dependencies (the dependency on ProgramEncoder should not be there IMO). I will create another hacky fix for now, by giving the newly created VerificationTask the same ProgramEncoder. Eventually, we need to fix this mess properly though.

ThomasHaas commented 2 years ago

Fixed in #281