-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example: snap_tool fails with "Check failed: std::filesystem::exists(p)" error when processing valid input #17
Comments
I suspect it's not finding the runner binary. Runtime data dependencies in bazel are a little bit fragile unfortunately. Please try explicitly setting |
Unfortunately, it did not resolve the issue. I explicitly set the --runner argument as instructed, but I am still encountering the same error. Here is the command I used and the output I received:
|
Try |
Unfortunately it still did not work. I tried creating a simple snapshot too, and it was giving the same output. |
I am able to reproduce the issue. It looks like the dependency finding code for the Bazel build assumes that you're invoking the tools through Bazel. This works, for example:
It will also work if you first Basically when you run the tool directly it is looking for $CWD/runner/reading_runner_main_nolibc rather than inside the bazel-bin dir. Further more, even when you override the binary it still does the search and the check fails. Step 1, I will make sure it doesn't search for the binary when it doesn't need to. |
Tip-of-tree snap_tool should now work when you pass an explicit --runner path. |
I encountered an issue while using the snap_tool in the Silifuzz project. When attempting to process valid raw x86 machine code, the tool fails with an error indicating that a required file or dependency is missing (Check failed: std::filesystem::exists(p)). Despite ensuring the environment is set up as per the documentation, the tool does not generate the expected output or snapshot.
Steps to Reproduce
$echo -en '\xFF\xC0' > /tmp/inc_eax
$SILIFUZZ_BIN_DIR/tools/snap_tool --raw print /tmp/inc_eax
I am expecting this below.
Metadata:
Id: inc_eax
Architecture: x86_64 Linux
Completeness: complete
Registers:
gregs (non-0 only)
rax = 0x20000000
....
The tool fails with the following error:
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
F0000 00:00:1733272965.389669 625799 data_dependency.cc:37] Check failed: std::filesystem::exists(p)
*** Check failure stack trace: ***
@ 0xad7684 absl::log_internal::LogMessage::SendToLog()
@ 0xad74b9 absl::log_internal::LogMessage::Flush()
@ 0xad7ab9 absl::log_internal::LogMessageFatal::~LogMessageFatal()
@ 0x9d857f silifuzz::GetDataDependencyFilepathBazelabi:cxx11
@ 0x9d802e silifuzz::GetDataDependencyFilepathabi:cxx11
@ 0x9d7ed8 silifuzz::RunnerLocationabi:cxx11
@ 0x84695e silifuzz::MakingConfig::Default()
@ 0x83e677 silifuzz::CreateSnapshotFromRawInstructions()
@ 0x84062e silifuzz::SnapToolMain()
@ 0x8436e1 main
@ 0xd9fbc4 __libc_start_call_main
Aborted
Could you please confirm if there are additional data dependencies that need to be explicitly set up or included for the snap_tool to work? Additionally, is there a way to debug what file/path std::filesystem::exists(p) is checking for?
Environment
Running on a google cloud instance
Debian GNU/Linux 12 (bookworm)
gcc 12.2.0
Thanks
The text was updated successfully, but these errors were encountered: