marxin / cvise

Super-parallel Python port of the C-Reduce
Other
219 stars 25 forks source link

IfPass has encountered a bug: pass error state: BinaryState: 0-10993 of 10993 instances #104

Closed pkubaj closed 1 year ago

pkubaj commented 1 year ago
Package: cvise 2.4.0
Git version: 5c63665
LLVM version: 13.0.1
System: uname_result(system='FreeBSD', node='talos-powerpc64', release='14.0-CURRENT', version='FreeBSD 14.0-CURRENT #6 main-n260996-a1ffc2fe9ce5: Fri Feb 17 03:13:42 CET 2023     root@talos-powerpc64:/usr/obj/usr/src/powerpc.powerpc64/sys/GENERIC64', machine='powerpc')
***************************************************

IfPass has encountered a bug:
pass error
state: BinaryState: 0-10993 of 10993 instances

Please consider tarring up cvise_bug_1
and creating an issue at https://github.com/marxin/cvise/issues and we will try to fix the bug.

***************************************************

cvise_bug_1.tar.gz

marxin commented 1 year ago

Can you please re-run it with the following patch:

diff --git a/cvise/passes/ifs.py b/cvise/passes/ifs.py
index 99edb77..bb155b8 100644
--- a/cvise/passes/ifs.py
+++ b/cvise/passes/ifs.py
@@ -75,6 +75,9 @@ class IfPass(AbstractPass):
         cmd = [self.external_programs['unifdef'], '-B', '-x', '2', '-k', '-o', test_case, tmp_file.name]
         stdout, stderr, returncode = process_event_notifier.run_process(cmd)
         if returncode != 0:
+            print(stdout)
+            print(stderr)
+            print(returncode)
             return (PassResult.ERROR, state)
         else:
             return (PassResult.OK, state)

Note I have no experience running C-Vise on BSD and a PowerPC system.

marxin commented 1 year ago

And can you please try using a newer release?

pkubaj commented 1 year ago

2.7.0 fails to build with:

error: unknown warning option '-Werror=maybe-uninitialized'; did you mean '-Werror=uninitialized'? [-Werror,-Wunknown-warning-option]
ninja: build stopped: subcommand failed.                                                                                                                                                                                                    

Using -Wno-error=uninitialized works fine. The compiler is LLVM 15.0.7.

After that, build fails with:

/usr/ports/devel/cvise/work/cvise-2.7.0/clang_delta/RenameParam.cpp:257:7: error: variable 'MaxIteration' set but not used [-Werror,-Wunused-but-set-variable]
  int MaxIteration = 0;
      ^
1 error generated.
marxin commented 1 year ago

Ok, so let's disable -Werror:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd18631..c28fa1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -151,8 +151,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
     OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   # XXX figure out how to get "-std=c++17 -fno-rtti" from LLVM.  That's how we
   # get those options in the Automake path...
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wno-error=maybe-uninitialized")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fno-rtti -fno-strict-aliasing -Wall -Wextra -Wno-unused-parameter -Werror -Wno-error=maybe-uninitialized")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-error=maybe-uninitialized")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fno-rtti -fno-strict-aliasing -Wall -Wextra -Wno-unused-parameter -Wno-error=maybe-uninitialized")
   if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
   endif()
marxin commented 1 year ago

Can you please report what you get with the debug patch?

marxin commented 1 year ago

@pkubaj: Please re-open if you have more info.