Closed roop-nvda closed 1 year ago
Hmm, it looks like the wrong private constructor is applied here. Which compiler version is this?
Out of curiosity, what happens if you replace the code throwing the error with:
const std::vector<Continuation::Command> exitCmds;
handlers.emplace(Continuation::Exception::Exit, Continuation::Body(exitCmds));
?
@fruffy
builds2/rmukherjee/p4c/build# gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I tried adding cost extCmds, that you suggested @fruffy but see no difference.
Scanning dependencies of target testgen
[ 45%] Building CXX object backends/p4tools/modules/testgen/CMakeFiles/testgen.dir/core/small_step/cmd_stepper.cpp.o
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp: In member function 'virtual bool P4Tools::P4Testgen::CmdStepper::preorder(const IR::P4Control*)':
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:251:74: error: 'P4Tools::P4Testgen::Continuation::Body::Body()' is private within this context
handlers.emplace(Continuation::Exception::Exit, Continuation::Body({}));
^
In file included from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/execution_state.h:28:0,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/concolic.h:23,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/program_info.h:19,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.h:14,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:1:
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/continuation.h:167:9: note: declared private here
Body() = default;
^~~~
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp: In member function 'virtual bool P4Tools::P4Testgen::CmdStepper::preorder(const IR::P4Program*)':
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:381:74: error: 'P4Tools::P4Testgen::Continuation::Body::Body()' is private within this context
handlers.emplace(Continuation::Exception::Drop, Continuation::Body({}));
^
In file included from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/execution_state.h:28:0,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/concolic.h:23,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/program_info.h:19,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.h:14,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:1:
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/continuation.h:167:9: note: declared private here
Body() = default;
^~~~
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:382:74: error: 'P4Tools::P4Testgen::Continuation::Body::Body()' is private within this context
handlers.emplace(Continuation::Exception::Exit, Continuation::Body({}));
^
In file included from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/execution_state.h:28:0,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/concolic.h:23,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/program_info.h:19,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.h:14,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:1:
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/continuation.h:167:9: note: declared private here
Body() = default;
^~~~
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:383:75: error: 'P4Tools::P4Testgen::Continuation::Body::Body()' is private within this context
handlers.emplace(Continuation::Exception::Abort, Continuation::Body({}));
^
In file included from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/execution_state.h:28:0,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/concolic.h:23,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/program_info.h:19,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.h:14,
from /builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp:1:
/builds2/rmukherjee/p4c/backends/p4tools/modules/testgen/lib/continuation.h:167:9: note: declared private here
Body() = default;
^~~~
backends/p4tools/modules/testgen/CMakeFiles/testgen.dir/build.make:206: recipe for target 'backends/p4tools/modules/testgen/CMakeFiles/testgen.dir/core/small_step/cmd_stepper.cpp.o' failed
make[2]: *** [backends/p4tools/modules/testgen/CMakeFiles/testgen.dir/core/small_step/cmd_stepper.cpp.o] Error 1
CMakeFiles/Makefile2:2053: recipe for target 'backends/p4tools/modules/testgen/CMakeFiles/testgen.dir/all' failed
make[1]: *** [backends/p4tools/modules/testgen/CMakeFiles/testgen.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
builds2/rmukherjee/p4c/build# git diff
diff --git a/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp b/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp
index dd852b02d..0029dff93 100644
--- a/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp
+++ b/backends/p4tools/modules/testgen/core/small_step/cmd_stepper.cpp
@@ -247,6 +247,7 @@ bool CmdStepper::preorder(const IR::P4Control *p4control) {
nextState->popBody();
// Exit terminates the entire control block (only the control).
std::map<Continuation::Exception, Continuation> handlers;
+ const std::vector<Continuation::Command> exitCmds;
handlers.emplace(Continuation::Exception::Exit, Continuation::Body({}));
nextState->pushCurrentContinuation(handlers);
// If the cmds are not empty, replace the body
We have limited support for Ubuntu 18 since it is nearing EOL soon. We do not test P4Testgen on it. It looks like this is an issue with GCC and empty list initialization. I can try to enable P4Testgen compilation for Ubuntu 18.
+ const std::vector<Continuation::Command> exitCmds;
handlers.emplace(Continuation::Exception::Exit, Continuation::Body({}));
Not quite clear from the diff but did you replace{}
with exitCmds
?
This was GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81311 by the way.
Thanks all. It was indeed the gcc bug. Compile works after upgrading g++.
I get the following compile error, when I enable p4testgen.
/builds2/rmukherjee/p4c/build# cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_TEST_TOOLS=ON -DENABLE_GTESTS=OFF -DENABLE_EBPF=OFF -DENABLE_DPDK=OFF -DENABLE_UBPF=OFF
Am I missing some flag? Perhaps @fruffy has a suggestion?
I think I have all the latest commits.