Comments (5)
This issues has been fixed. Signals are now delivered properly.
There is noticeable delay between delivering a signal and the tracee receiving the signal. Consider the program:
#include <signal.h>
#include <stdio.h>
int main(){
raise(SIGABRT);
printf("Hello World!\n");
}
Running this program by itself aborts. But under dettrace it completes. We don't really have power to when the signal is delivered so this may be nondeterministic. We discussed a solution by:
- Saving the state of the program
- Jumping to the signal handler by moving the instruction pointer.
Signals may be ignored if done through ptrace. From man ptrace(2):
Restarting ptrace commands issued in ptrace-stops other than signal-delivery-stop are
not guaranteed to inject a signal, even if sig is nonzero. No error is reported; a
nonzero sig may simply be ignored. Ptrace users should not try to "create a new sig‐
nal" this way: use tgkill(2) instead.
The fact that signal injection requests may be ignored when restarting the tracee
after ptrace stops that are not signal-delivery-stops is a cause of confusion among
ptrace users.
So it seems tgkill is the way to go.
from dettrace.
Reopening this until we whitelist signal delivery.
Summarizing some Slack discussion here for future reference:
- Deterministic signal delivery likely requires jumping directly to the signal handler, so we can be sure when the signal is "delivered"
- Need to jump back to application code once the signal handler is done. How do we figure out when the handler is "done"? Maybe we can munge the signal stack and overwrite the return address appropriately? Also need to ensure that the app context is restored.
from dettrace.
As far as your second bullet point. I believe we receive a sigreturn/rt_sigreturn
when the handler is done.
from dettrace.
[this came up briefly in the call today]
@devietti - re: "jumping directly to the signal handler", is the idea that signal delivery would be instantaneous? E.g., in a sequentialized set of processes/threads, one thread sending a SIGKILL should resolve immediately before any other code runs.
Instantaneous signal delivery seems really appealing in a sequential scheduler. But, hmm, perhaps that would compromise achieving observable equivalence between a sequential scheduler and one that employs true parallelism...
from dettrace.
Closing this thanks to #106, we have this working for SIGALRM.
from dettrace.
Related Issues (20)
- --base-env=empty still defines HOME HOT 1
- Run cosmos.network tests (Go code) under DT HOT 13
- Dotnetcore hello world runs
- Go run hello world dies on `waitid` syscall HOT 1
- List of supported languages/frameworks for DetTrace
- Making DetTrace More Flexible
- `--in-docker` should have implied `--base-env=host` HOT 1
- DetTrace Dependencies HOT 2
- RFC: Better Testing For DetTrace HOT 7
- DetTrace Related Work
- DetTrace Running on Cloud Platforms HOT 2
- tty program returns unexpected result HOT 4
- Out-of-bounds system call number in error message
- timer_create: DT fails to write virtualized timerid due to glibc wrapper HOT 10
- sampleProgram open.c exhibits nondeterminism HOT 2
- siginfo_t field si_timerid is not determinized HOT 1
- `isNoop` is not thread safe
- Compilation Error due to gettid function. HOT 3
- can't make test HOT 2
- a problem about using dettrace 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 dettrace.