Comments (2)
Thanks for reporting this. I am going to divide you post into three parts and comment on each.
1. Scarab works fine when the assertion is commented out.
Scarab is probably not working fine when the assertion is commented out. Let me explain.
Scarab is divided into two parts, which we refer to as "the frontend" and "the backend". The frontend is a PIN based, instruction-level functional simulator that is responsible for actually executing the program. In your example, the frontend is the unit responsible for actually running clang
and generating the resulting hello.out
executable.
The backend is the microarchitecture timing model, which is responsible for modeling all aspects of the system (fetch, decode, ROB, DRAM, etc.). Decoupling the frontend and the backend provides Scarab with several advantages, which I will not touch on here. However, there is one unfortunate side effect: bugs in the backend (timing model) do not necessarily result in incorrect functional results (frontend). This is why, despite there being some issue in the backend, clang
still runs correctly.
2. Scarab only runs statically linked binaries.
The link you sent to the LLVM Downloads Page only contains dynamically compiled versions of LLVM.
In theory, Scarab should be able to run dynamically linked executables, however in practice we have seen random crashes when running dynamically linked executables. We do not fully understand those crashes, so we decided to not support it while we roll out the main features of Scarab. There are no currently plans to fix these issues.
The easiest workaround here is to compile the LLVM binary statically. This may not be what is causing this particular issue, but it is certainly the first thing I would check.
3. Why else could the assert be firing?
Here is the million dollar question. I am not sure what the issue is without debugging Scarab; however I can help point you in the right direction. This assertion is perhaps one of Scarab's most common. It happens when the frontend sends the backend an instruction that the backend was not expecting (the fetch address is what the backend was expecting, the op address is what was sent from the frontend).
The first thing I would check is which of the two addresses is actually correct. That way the bug can be isolated to the frontend or backend. Easiest way to do this is to follow the direction to debug Scarab, making sure to enable debug mode for an instruction range that contains the assert. The assert message you pasted shows the instruction count when the assertion was fired (I=23546173
). You can then look at the value of the PC for the op that was fetched just before the ASSERT and look into the clang
binary to see what the actual next PC after that op should be.
Based on the value of the fetch address that is causing the ASSERT (0x7fffe...
), it seems like the ASSERT is probably happening during some of the dynamically linked code. In that case, looking into the clang
binary will not help you see what the actual next PC should be. Instead, you should enable debug in the frontend to get a trace of expected instructions. To do that, you need to compile the frontend for debug:
cd src/pin/pin_exec
make debug_print
This will print a trace to the pin.out log file that should give you a good sense of what the correct PC should be.
To limit the scope of the debug prints, add -debug_print_start_uid
and -debug_print_end_uid
to the scarab launch command:
./bin/scarab_launch.py --program "$CLANG hello.c" --param src/PARAMS.* --pintool_args="-debug_print_start_uid 29000000 -debug_print_end_uid 30000000"
You will probably need to fine tune the actual values of -debug_print_start_uid
and -debug_print_end_uid
to match the actual inst_uid
values that occur during the assertion.
from scarab.
Closing this issue as there has been no activity in over a week. Feel free to open again if further issues arise.
from scarab.
Related Issues (20)
- [Question] Configure prefetcher cache HOT 5
- [Question] How do you access metadata about the Cache from a prefetcher function? HOT 2
- [Question] !ENABLE_ICACHE_PACKET_BREAKING && !PERFECT_BP HOT 8
- [Question] Runahead Execution in Scarab HOT 6
- [Question] Decoder: Redirect on btb_miss and !taken HOT 2
- recipe for target 'pin_exec' failed HOT 19
- [BUG] Running SPEC2006 Checkpoints with PIN tool HOT 1
- Tests cannot access github secret values when pull request created by fork
- [Question]About wrong path execution HOT 1
- [Question]About Wrong Path Execution HOT 2
- [Question] mem_req buffer and queues HOT 1
- [Question] Assertion failure when running gcc in SPEC2017 IntSpeed HOT 3
- [Question] Proper documentation for running SPEC 17 HOT 2
- [BUG] Link to auto-generated software documentation is broken HOT 1
- [Question] make -C docs fails HOT 1
- [Question] Running make in src/ fails HOT 8
- Running make in scarab/src fails HOT 1
- [BUG] "scarab --help" info is out of date?
- [Question and Bug] "Invalid header for input file #0" HOT 1
- Having issue in building src in scarab
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scarab.