Closed Niols closed 1 year ago
The issue could be reproduced exactly (file descriptors included):
A bisection shows that both 07301a6 (last commit on main
before @gabrielhdt's fork) and 35856cd (last commit on main
at time of writing this) are exempt of this bug.
Some trace-based debugging leads me to think that the bug is somewhere in this piece of code. To my surprise, it does not seem to take place in openAndParsePIR
but rather in execIncorrectnessLogic
.
Following up would involve debugging in Pirouette. Pirouette does not use the mentioned hGetLine
but it probably uses some higher-level version of it.
Trying to build gh@trythings
with IOHK's compiler (instead of the one from nixpkgs) does not improve the situation.
Bringing back LANG = "en_US.UTF-8";
and/or LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"
does not help with the situation.
8d14a973832e28b0fc6577fa5efd25ef12232530 seems to be the first commit with an issue. Sadly, this commit is pretty big.
Compiling https://github.com/tweag/plutus-libs/commit/8d14a973832e28b0fc6577fa5efd25ef12232530 with nixpkgs pinned to the version pinned by Niv in https://github.com/tweag/plutus-libs/commit/07301a69afaa2de0215a820dbd210ebe6e2f5748 (https://github.com/NixOS/nixpkgs/commit/74b10859829153d5c5d50f7c77b86763759e8654) also fails in the same way.
Compiling https://github.com/tweag/plutus-libs/commit/8d14a973832e28b0fc6577fa5efd25ef12232530 with an old version of Pirouette (https://github.com/tweag/pirouette/commit/3805638e0e11b5a0fc5cc6a41bd415d52674d23a) and Z3 and CVC4 in the Shell's buildInputs
works! So it probably has to do with the new integration of Z3.
Edit: welp, there it is. It was probably just CVC4 missing from the environment. SO DUMB.
My experiments show that, actually, everything runs fine with recent commits of Pirouette. Not the most recent ones because there was an API change. It looks like https://github.com/tweag/pirouette/commit/69d1eea works fine. Hence #209 (and its corresponding PR on @gabrielhdt's branch, https://github.com/gabrielhdt/plutus-libs/pull/1).
I ran a git bisect
on Pirouette to try and find where the bug was fixed. The last versions that contain the bug are:
cabal.project
.The first versions that do not contain the bug anymore are:
First, I include https://github.com/tweag/pirouette/pull/153 in my picture because it was merged into https://github.com/tweag/pirouette/pull/154 before this one was merged back into main
. Second, sadly, the very first commits of https://github.com/tweag/pirouette/pull/154 do not compile, so we only know that the bug was fixed on the path:
One could for instance compare what those commits change to try and understand where the bug comes from.
The conclusion of this debugging session is STUPID. plutus-libs
was following an old version of Pirouette... that was still using CVC4. Pirouette was not finding the binary and not managing to talk it and therefore failing when reading from it. It would deserve better error reporting but this point is made irrelevant by the recent changes in Pirouette that now relies on SMTLIB-backends. The improvement to error reporting can be tracked there, cf https://github.com/tweag/smtlib-backends/issues/43.
In the meantime, there are two possible fixes to this:
This issue is here to track the debugging of the issue caused by https://github.com/tweag/plutus-libs/pull/187 where: