Why3 is unable to run prover on windows via cygwin - frama-c

I am trying to use cvc4 prover with Frama-c wp plugin through Why3 on Windows environment. I have frama-c and why3 installed on my system. Why3 is configured properly to include cvc4 as a prover :
$ why3 --list-provers
Known provers:
Alt-Ergo (0.95.2)
CVC4 (1.4)
I used frama-c Wp plugin to generate why3 format (.why) file corresponding to my .c file (C source file with ACSL Specifications) with following command:
frama-c -wp -wp-print -wp-proof-trace -wp-out C:/Users/user/temp -wp-prover cvc4 swap.c
The above command generate a file swap_Why3_ide.why in C:/Users/user/temp/typed directory.
When I try to prove Theories in generated swap_Why3_ide.why file using why3 with cvc4 as prover it fails with following error:
$ why3 prove -P cvc4 -L C:/cygwin/usr/local/share/frama-c/wp/why3 temp/typed/swap_Why3_ide.why
temp/typed/swap_Why3_ide.why VCswap_post WP : HighFailure (0.02s)
Prover exit status: exited with status 1
Prover output:
/usr/local/lib/why3/why3-cpulimit: Error: failed when launching <"/cygdrive/c/cvc4-1.4-win32-opt.exe" "--lang=smt2" "/tmp/why_29ba75_swap_Why3_ide-T-WP.smt2">
Fatal: CreateProcess failed with error 0: The operation completed successfully.
I performed same steps on a linux environment and why3 was able to execute prover:
why3 prove -P cvc4 -L /usr/local/share/frama-c/wp/why3/ temp/typed/swap_Why3_ide.why
temp/typed/swap_Why3_ide.why VCswap_post WP : Valid (0.05s)
Can anyone suggest how to execute Why3 on windows?

It seems like no one is using why3 on Windows. But anyways, for anyone who will try to use Why3 on windows in future, here are steps I performed to run a prover on theories in a .why file:
1) On Windows, even if provers are installed, executing why3 config --detect will not add provers. So when executing why3 config --detect --add-prover cvc4 path_to_executable_in_Windows_format make sure that path to executable is in windows format( for example C:\provers\cvc4-1.4-win32-opt.exe)
If path is not in windows format, following error is thrown:
/usr/local/lib/why3/why3-cpulimit: Error: failed when launching <"/cygdrive/c/cvc4-1.4-win32-opt.exe" "--lang=smt2" "/tmp/why_29ba75_swap_Why3_ide-T-WP.smt2">
Fatal: CreateProcess failed with error 0: The operation completed successfully.
2) After setting path to provers properly, try to execute why3 as follows:
why3 prove -P cvc4 -L C:/cygwin/usr/local/share/frama-c/wp/why3 C:/temp/typed/swap_Why3_ide.why
This will throw following error:
C:/temp/typed/swap_Why3_ide.why VCswap_post WP : HighFailure (0.03s)
Prover exit status: exited with status 1
Prover output:
(error "Couldn't open file: /tmp/why_727ef8_swap_Why3_ide-T-WP.smt2")
why3cpulimit cpu time: 0.015625s wall time: 0.015625s
This error is occurring because why3 generates *.smt2 files in cygwin tmp directory (/tmp) and when provers are called over these files complete path to these files in not provided and prover complain that it Couldn't open file /tmp/XX.smt2
To fix this I had to update command executed to run prover in .why3.conf as following:
[prover]
command = "%l/why3-cpulimit %t %m -s C:/provers/cvc4-1.4-win32-opt.exe --lang=smt2 C:/cygwin%f
driver = "/usr/local/share/why3/drivers/cvc4.drv"
editor = ""
in_place = false
interactive = false
name = "CVC4"
shortcut = "cvc4"
version = "1.4"
Note that I changed the file format from %f to C:/cygwin%f which is windows path to /tmp directory

Related

Jupyter Notebook Failing VSCode

The bounty expires in 3 days. Answers to this question are eligible for a +50 reputation bounty.
BoomBoxBoy is looking for an answer from a reputable source:
A Simple or Complex will do, just looking for the reason why this occurred randomly overnight..
When I attempt to run a Jupiter notebook in VS Code with a simple print("hello world") command,I get the following error printout:
Failed to start the Kernel.
Jupyter server crashed. Unable to connect.
Error code from Jupyter: 1
usage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
[--paths] [--json] [--debug]
[subcommand]
Jupyter: Interactive Computing
positional arguments:
subcommand the subcommand to launch
optional arguments:
-h, --help show this help message and exit
--version show the versions of core jupyter packages and exit
--config-dir show Jupyter config dir
--data-dir show Jupyter data dir
--runtime-dir show Jupyter runtime dir
--paths show all Jupyter paths. Add --json for machine-readable
format.
--json output paths as machine-readable json
--debug output debug information about paths
Available subcommands:
Jupyter command `jupyter-notebook` not found.
View Jupyter log for further details.
With this info in the Jupyter log
error 15:07:35.321: Error in execution (get message for cell) Er [Error]: Jupyter server crashed. Unable to connect.
Error code from Jupyter: 1
usage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
[--paths] [--json] [--debug]
[subcommand]
Jupyter: Interactive Computing
positional arguments:
subcommand the subcommand to launch
optional arguments:
-h, --help show this help message and exit
--version show the versions of core jupyter packages and exit
--config-dir show Jupyter config dir
--data-dir show Jupyter data dir
--runtime-dir show Jupyter runtime dir
--paths show all Jupyter paths. Add --json for machine-readable
format.
--json output paths as machine-readable json
--debug output debug information about paths
Available subcommands:
Jupyter command `jupyter-notebook` not found.
at Sm.rejectStartPromise (/Users/user1/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:17:254981)
at t._complete (/Users/user1/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:17:255541)
at t.n (/Users/user1/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:2:700797)
at t.__tryOrUnsub (/Users/user1/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:2:701037)
at t.complete (/Users/user1/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:2:700930)
at t._complete (/Users/user1/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:2:699446)
at t.complete (/Users/user1/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:2:699145)
at ChildProcess.<anonymous> (/Users/joshpurtell/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:2:1800927)
at Object.onceWrapper (node:events:646:26)
at ChildProcess.emit (node:events:538:35)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
category: 'jupyterconnection'
}
However, when I run the command jupyter-notebook in the python terminal with the same environment activated, I have no issue and it runs as expected.

Grunt plugin grunt-exec v2.0.0 doesn't execute a simple command while v1.0.1 does

I was using grunt-exec v1.0.1 with this configuration in Gruntfile.js:
grunt.initConfig({
exec: {
tsc: {
cmd: "tsc"
}
},
...
}
...
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('debug', [
...
'exec:tsc',
...
]);
Then running grunt debug in console tsc is executed correctly.
In another project with similar configuration it's installed the last version of
grunt-exec(v.2.0.0) and running grunt-debug the next error is returned:
Running "exec:tsc" (exec) task
>> Failed with: Error: spawn tsc ENOENT
Warning: Task "exec:tsc" failed. Use --force to continue.
With -verbose option it returns:
Running "exec:tsc" (exec) task
Verifying property exec.tsc exists in config...OK
File: [no files]
tsc
buffer : disabled
timeout : infinite
killSig : SIGTERM
shell : true
command : tsc
args : []
stdio : [ignore,pipe,pipe]
cwd : D:\Pruebas\Angular 2\ATemplate
exitcodes: 0
pid : undefined
>> Failed with: Error: spawn tsc ENOENT
Warning: Task "exec:tsc" failed. Use --force to continue.
I know I can have it working using v1.0.1 of grunt-exec but I want to know how must I do it with v2.0.0. The project documentation in github has not given me a clue.
Looks like the grunt-exec version v2.0.0 uses some ECMAScript features that are not supported in older versions of node.
The first one i saw was:
Symbol.match, String.prototype.endsWith that is not supported in node < v6.10.2
See here: http://node.green/
Upgrade your node version to fix this issue.

Linking PHPUnit with PhpStorm

PHPUnit: 4.8.31
PhpStorm: 2016.1
I'm having issues running PHPUnit from within PhpStorm. From a CMD window, running the test works fine, but the PhpStorm output is this:
"C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\php.exe" C:/Users/username/AppData/Local/Temp/ide-phpunit.php --no-configuration "C:\tests"
Testing started at 5:30 PM ...
Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\ext\php_curl.dll' - The specified procedure could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\ext\php_curl.dll' - The specified procedure could not be found.
Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\username\AppData\Local\Temp\ide-phpunit.php on line 253 in Unknown on line 0
PHP Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\username\AppData\Local\Temp\ide-phpunit.php on line 253
Process finished with exit code 255
I've included the folder with my phpunit.phar library in PhpStorm:
PhpStorm knows about the include paths, autocomplete works.
The run config looks like this:
The PHP version/install I'm using is the same one.
Windows:
PhpStorm:
Any ideas?
I tried running a script that uses curl from a CMD window and saw that the curl library wasn't loaded.
I did phpinfo(); and saw that the CMD window was using a different PHP installation (I had installed a new EasyPHP version).
I made the windows sys variable PATH point at my old one, then it started throwing some errors about not loading some libraries (php_curl.dll, libssh2.dll), so I moved them from the new install folder to the old one and to Windows\SysWOW64.
Miraculously, the PhpStorm run config was also fixed, which leads me to believe it doesn't use the interpreter I set in its options, but rather the one from PATH..
The PhpStorm output is now:
"C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\php.exe" C:/Users/username/AppData/Local/Temp/ide-phpunit.php --no-configuration "C:\tests"
Testing started at 9:22 AM ...
Warning: The use statement with non-compound name 'PHPUnit_Framework_TestCase' has no effect in C:\DummyTest.php on line 3
PHPUnit 4.8.31 by Sebastian Bergmann and contributors.
PHP Warning: The use statement with non-compound name 'PHPUnit_Framework_TestCase' has no effect in C:\DummyTest.php on line 3
No tests found in class "TestDummy".
Time: 372 ms, Memory: 10.00MB
FAILURES!
Tests: 1, Assertions: 0, Failures: 1.
Process finished with exit code 1

Getting "org.scala-sbt#sbt;0.13.8: not found" error though I have the same version installed in my system.How to resolve this?

set -e pipefail; sbt -Dsbt.log.noformat=true -DchiselVersion="latest.release" "run Parity --genHarness --compile --test --backend c --vcd " | tee Parity.out
Getting org.scala-sbt sbt 0.13.8 ...
problems summary ::
WARNINGS
module not found: org.scala-sbt#sbt;0.13.8
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.8: not found
::::::::::::::::::::::::::::::::::::::::::::::
ERRORS
Server access Error: Connection refused url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml
Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom
Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.8: not found
Error during sbt execution: Error retrieving required libraries
Error: Could not retrieve sbt 0.13.8
this might be proxy issue.
Edit $SBT_HOME/conf directory/sbtconfig.txt file and add following entries:
-Dhttp.proxyHost=<proxy server>
-Dhttp.proxyPort=<proxy port>
-Dhttp.proxyUser=<username>
-Dhttp.proxyPassword=<password>
-Dhttps.proxyHost=<proxy server>
-Dhttps.proxyPort=<proxy port>
-Dhttps.proxyUser=<username>
-Dhttps.proxyPassword=<password>
-Dftp.proxyHost=<proxy server>
-Dftp.proxyPort=<proxy port>
-Dftp.proxyUser=<username>
-Dftp.proxyPassword=<password>
Notes:
https settings are necessary as many urls referred by the SBT are https based.
Don't include "http://" in the value
I faced a similar issue. Seems like the issue is with the java that is used. By mistake my environment was pointing to jre rather than jdk. After pointing to right JAVA_HOME as below, the sbt clean package compile worked fine.
[root#spark-sql-perf]# update-alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
*+ 1 java-1.8.0-openjdk.ppc64le (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.ppc64le/jre/bin/java)
2 java-1.7.0-openjdk.ppc64le (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.121-2.6.8.0.el7_3.ppc64le/jre/bin/java)
Enter to keep the current selection[+], or type selection number: q
There are 2 programs which provide 'java'.
Selection Command
*+ 1 java-1.8.0-openjdk.ppc64le (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.ppc64le/jre/bin/java)
2 java-1.7.0-openjdk.ppc64le (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.121-2.6.8.0.el7_3.ppc64le/jre/bin/java)
Enter to keep the current selection[+], or type selection number: ^C
[root#spark-sql-perf]# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.ppc64le/
[root#spark-sql-perf]# export PATH=$JAVA_HOME/bin:$PATH

Troubleshooting Parse Errors when running robot tests on Plone

I'm really not sure what's wrong with my setup. The robot tests were added recently and we've seen them run successfully on another developer's OS X machine.
I'm attempting to run the same robot tests on an Ubuntu machine with Plone and Firefox installed. The package is https://github.com/collective/collective.academicprogrammes
I had to add plone.app.robotframework to the [test] section of my develop.cfg file.
This is what my develop.cfg looks like now:
[sources]
collective.academicprogrammes = git git#github.com:collective/collective.academicprogrammes.git
[buildout]
test-packages =
collective.academicprogrammes[test]
extends =
buildout.cfg
extensions +=
mr.developer
eggs +=
Products.DocFinderTab
plone.reload
collective.academicprogrammes
parts +=
test
diazotools
zopeskel
robot
always-checkout = force
sources = sources
auto-checkout = *
[test]
recipe = zc.recipe.testrunner
defaults = ['--exit-with-status',
'--auto-color', '--auto-progress']
eggs =
${buildout:eggs}
${buildout:test-packages}
[zopeskel]
recipe = zc.recipe.egg
eggs =
ZopeSkel
Paste
PasteDeploy
PasteScript
zopeskel.diazotheme
zopeskel.dexterity
zest.releaser
${buildout:eggs}
[robot]
recipe = zc.recipe.egg
eggs =
Pillow
${test:eggs}
plone.app.robotframework
After running bin/buildout -c develop.cfg to install everything I
attempted to run bin/test -t robot I get the following errors:
File "parser.pxi", line 569, in
lxml.etree._ParserContext._handleParseResultDoc
(src/lxml/lxml.etree.c:74567) File "parser.pxi", line 650, in
lxml.etree._handleParseResult (src/lxml/lxml.etree.c:75458) File
"parser.pxi", line 590, in lxml.etree._raiseParseError
(src/lxml/lxml.etree.c:74791)
File "lxml.etree.pyx", line 2756, in lxml.etree.fromstring
(src/lxml/lxml.etree.c:54726) bash: syntax error near unexpected token
(' (precise)david#localhost:~/Plone/zeocluster$ File "parser.pxi",
line 1571, in lxml.etree._parseMemoryDocument
(src/lxml/lxml.etree.c:82792) bash: syntax error near unexpected token
... File "parser.pxi",
line 1450, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:81590) bash:
syntax error near unexpected token('
And it ends with:
AssertionError: Setup failed: WebDriverException: Message: 'Can\'t
load the profile. Profile Dir: /tmp/tmpqsX6Ky/webdriver-py-profilecopy
Firefox output: Gtk-Message: Failed to load module
"canberra-gtk-module"\n*** LOG addons.xpi: startup\n*** LOG
addons.xpi: checkForChanges\n*** LOG addons.xpi: No changes
found\n**********************************\n*
Call to xpconnect wrapped JSObject produced this error:
*\n[Exception... "\'[JavaScript Error: "this.updateDisplay is not a function" {file: "chrome://browser/content/search/search.xml" line:
83}]\' when calling method:
[nsIBrowserSearchInitObserver::onInitComplete]" nsresult: "0x80570021
(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame ::
resource://gre/components/nsSearchService.js :: onSuccess :: line
3257" data:
yes]\n**********************************\n'
The error is two-fold. One has to do with the fact that I installed a lightweight Linux OS that didn't include all the dependencies. Specifically I had to install libcanberra.
To do this on Ubuntu I ran the following command 'sudo apt-get install libcanberra-gtk-module'. That was enough to fix the error about canberra-gtk-module.
The second issue was related to the version of Firefox used. It turns out that Selenium 2.34 is not compatible with Firefox 27 (the browser I'm using).
see:
http://selenium.googlecode.com/git/py/CHANGES
There are two options, upgrade Selenium to 2.40.0
OR
run robot browser tests against Firefox 25.
I opted to get Firefox 25 and use it when running tests.
Related information about this issue can be found here:
http://seleniumsimplified.com/problems-running-webdriver-on-firefox-26/
http://support.mozilla.org/en-US/questions/986545

Resources