Comments (4)
Debugging an instrumented binary can be incredibly difficult. At this time, there is no way to rewrite DWARF information, so the stack traces tend to be unhelpful (as you can see here).
Also, have you ever seen instrumentation fail with certain optimization flags?
I can't think of a specific instance, but it could be that Dyninst is making an assumption about code layout that is incorrect for a particular optimization pass.
A few things to help us direct you:
- Are you doing static or dynamic instrumentation?
- What kind of instrumentation are you inserting (e.g., changing function arguments, tracing memory access, etc.)?
- Which hardware architecture and OS?
from dyninst.
Since dyninst doesn't rewrite the DWARF information, if a function is shifted slightly or instrumented code overwrites existing instruction bytes, the debug information maps to wrong the function/source/line. If code is moved or added at a location that did not previously have code (or the PC get corrupted) then gdb fails to find any mapping and you get ???. Then since the data to unwind the stack doesn't know how to unwind the stack because the data is missing for PC location, the stack unwinding can fail and you get nonsensical stack frames.
One thing to try or confirm is the use of -fno-omit-frame-pointer
when compiling which will enable the fallback stack unwinding mechanism. Often gcc is configured to include -fomit-frame-pointer
at -O1
or -O2
. This may allow the discovery functions for more the stack frames.
To get a sense of what shared object the crash is happening in (assuming the PC is valid at the time of the crash), you can look for the address in the list of mapped addresses from the gdb command maint info sections -all-objects
.
from dyninst.
@hainest
Hi Tim,
We are using TAU and inserting TAU instrumentation with dyninst, similar to the codeCoverage example, but we are inserting our own instrumentation at the start and end of functions and an initialization at the start of the application. However, the application fails after some iterations, where it has already called the instrumented functions for some time, not at the start. The tested case is static instrumentation.
The architecture is 2 x Xeon 4410T with Ubuntu 22.
from dyninst.
With the -fno-omit-frame-pointer
flag, the bug I was seeing is not triggered anymore (at least the times I tried), but another appeared and I can see some execution information.
Thank for the help, I will try to debug as I can see some symbols now.
from dyninst.
Related Issues (20)
- BPatch_funcCallExpr does not conform to ARMv8 ABI HOT 14
- aarch64 stackwalking needs work. HOT 1
- Segmentation fault on libc-2.27.so:i386
- Make Parser::getSyscallNumber architecture-agnostic and handle multiple syscall arguments
- Issues with Static Instruction Insertion using Dyninst HOT 4
- Difficulty Inserting Instructions Using Dyninst Toolkit: Seeking Unified Solution HOT 1
- GitHub Release for 13.0.0 HOT 3
- release cmake configury: unable to install under /usr/lib64/... HOT 7
- AMD GPU Instruction Decoder Failed to expand operand HOT 1
- Upgrading SelectiveTaint: Replacing dyninst9.3 with dyninst13.0 in Ubuntu 14.04 Environment HOT 13
- (Unintentional) dependency in C++ static constructor order; causes SIGFPE when source files are reordered HOT 1
- How to instrument a non-x86_64 binary with dyninst library built upon x86_64 ? HOT 2
- Substantial increase in build times with gcc-14. HOT 1
- Build failures with gcc-14 HOT 1
- strange runtime error: odd - couldn't find kept register 2 HOT 1
- Instruction Operation missing x86 FLAG read/write properties
- Just upgrde gcc version to 8.5.0, also do those soft link trick,but found issue"Dyninst requires gcc >= 6.0" HOT 1
- Missing entries in DWARF line information lookup HOT 1
- Incorrect jump table detection HOT 2
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 dyninst.