apalache-mc / apalache

APALACHE: symbolic model checker for TLA+ and Quint
https://apalache-mc.org/
Apache License 2.0
427 stars 40 forks source link

[BUG] Unable to enable statistics #762

Closed Isaac-DeFrain closed 3 years ago

Isaac-DeFrain commented 3 years ago

Description

I have statistics reporting enabled in the toolbox and would like to enable statistics for Apalache, but I keep getting an exception in thread "main" java.io.IOException: No such file or directory.

Input specification

N/A

The command line parameters used to run the tool

apalache config --enable-stats=true

Expected behavior

Statistics are enabled.

Log files

$ apalache config --enable-stats=true
Assuming you bind-mounted your local directory into /var/apalache...
# Tool home: /opt/apalache
# Package:   /opt/apalache/mod-distribution/target/apalache-pkg-0.15.4-SNAPSHOT-full.jar
# JVM args: -Xmx4096m -DTLA-Library=/opt/apalache/src/tla
#
Picked up _JAVA_OPTIONS: -Djdk.net.URLClassPath.disableClassPathURLCheck=true
# APALACHE version 0.15.4-SNAPSHOT build v0.15.3-15-g8c71e2c
#
# WARNING: This tool is in the experimental stage.
#          Please report bugs at: [https://github.com/informalsystems/apalache/issues]
# 
# Usage statistics is OFF. We care about your privacy.
# If you want to help our project, consider enabling statistics with config --enable-stats=true.

Configuring Apalache                                              I@00:52:52.995
Statistics collection is ON.                                      I@00:52:52.997
This also enabled TLC and TLA+ Toolbox statistics.                I@00:52:52.997
It took me 0 days  0 hours  0 min  0 sec                          I@00:52:53.000
Total time: 0.3 sec                                               I@00:52:53.001
Exception in thread "main" java.io.IOException: No such file or directory
        at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.base/java.io.File.createNewFile(File.java:1024)
        at util.ExecutionStatisticsCollector.set(ExecutionStatisticsCollector.java:164)
        at at.forsyte.apalache.tla.Tool$.configure(Tool.scala:361)
        at at.forsyte.apalache.tla.Tool$.run(Tool.scala:113)
        at at.forsyte.apalache.tla.Tool$.main(Tool.scala:45)
        at at.forsyte.apalache.tla.Tool.main(Tool.scala)
$ apalache version
Assuming you bind-mounted your local directory into /var/apalache...
# Tool home: /opt/apalache
# Package:   /opt/apalache/mod-distribution/target/apalache-pkg-0.15.4-SNAPSHOT-full.jar
# JVM args: -Xmx4096m -DTLA-Library=/opt/apalache/src/tla
#
Picked up _JAVA_OPTIONS: -Djdk.net.URLClassPath.disableClassPathURLCheck=true
# APALACHE version 0.15.4-SNAPSHOT build v0.15.3-15-g8c71e2c
#
# WARNING: This tool is in the experimental stage.
#          Please report bugs at: [https://github.com/informalsystems/apalache/issues]
# 
# Usage statistics is OFF. We care about your privacy.
# If you want to help our project, consider enabling statistics with config --enable-stats=true.

0.15.4-SNAPSHOT build v0.15.3-15-g8c71e2c
EXITCODE: OK

System information

konnov commented 3 years ago

I suspect that there is a problem with permissions. Definitely, the tool should write what went wrong.

konnov commented 3 years ago

Oh, that's hilarious. It throws an exception when the directory $HOME/.tlaplus does not exist :-)

lemmy commented 3 years ago

What's also hilarious is that we independently discovered and fixed the same bug in TLC/Toolbox: https://github.com/tlaplus/tlaplus/commit/227f515065425752ec36f9f9b3285b95d1b19dbf

konnov commented 3 years ago

That's amazing! I wanted to open a PR in tlaplus but gave up on running the tests for the whole thing :-)

konnov commented 3 years ago

In our case, if you never ran Toolbox (which is not the case for most of us), then apalache would have crashed as in the bug report.

lemmy commented 3 years ago

That's amazing! I wanted to open a PR in tlaplus but gave up on running the tests for the whole thing :-)

$ ant -f tlatools/org.lamport.tlatools/customBuild.xml for TLC and $ mvn clean verify for the Toolbox+TLC should "just work".

konnov commented 3 years ago

True. It is even written in DEVELOPING.md. I just typed mvn test in the root directory, and that was a wrong move.