Comments (4)
I started an implementation of this, then realized that there's a problem. If you longjmp
/siglongjmp
from a signal handler and go on to call any non-async-signal-safe function, the result is undefined behavior. From end of signal-safety(7)
:
* If a signal handler interrupts the execution of an unsafe function, and the handler terminates via a call to longjmp(3) or siglongjmp(3) and the program subsequently calls an unsafe function, then the behavior of the program is undefined.
For us, the biggest problem is that the signal we want to handle could have interrupted some (in general) async-unsafe code under test. So, if we trapped a signal from the test code, called DeepState_Fail()
, and thus non-locally jumped back to the main loop of DeepState_Run()
, it might corrupt some global/static state which would impact subsequent test runs. We can't get around this just by e.g. narrowly scoping when we trap the signal, trying to make all our harness code async-safe, &c.
A few options:
- Don't support catching signals for now.
- Do it anyway, perhaps making this demon-plagued behavior configurable via a flag.
- Fork when executing test functions with the native harness, gather results using IPC.
Option (3) probably requires some big cross-cutting changes, and might have some gotchas with respect to the executors (though we could just not fork when being run by an executor). I think (2) will lead to grief later on down the line, so I'd suggest putting this issue on hold until we can address it via (3).
from deepstate.
What about a variant of options (2) and (3). If a flag is not set, then the signal handler, upon catching the signal, prints out that the option isn't set and then promptly exit
s. If the flag is set, then we fork
for each test, and the parent process uses waitpid
, WIFSIGNALED
, and WTERMSIG
to check if the child was signalled.
from deepstate.
@pgoodman, I think we can close this, as it should be subsumed by the move to forking test runs in #29.
That work does not introduce any signal handler-based hooks or options, but I think that to it would be better to avoid them unless we have a really compelling use case that can't be addressed with the process-oriented test running.
from deepstate.
Sounds good :-)
from deepstate.
Related Issues (20)
- Complete demoting assumption failures
- Build fails on macOS with GCC compiler, assembly errors HOT 2
- --which_test for AFL at least seems to not work
- Fails run with using docker. HOT 2
- The Deepstate CI pipeline has been failing for 3 months due to python version issues HOT 3
- Use uniform_real_distribution to provide floats in C++ HOT 1
- Rare crash in DeepState_Setup HOT 1
- Deprecated use of Setuptools' setup.py-based installations and a requirement of admin-privileges/permissions while installing the DeepState python package
- `--num_workers` argument not being detected HOT 6
- Executor failed running [/bin/sh -c bash install_angora.sh $make_j] during setup via Docker HOT 3
- Fix Manticore python version problem in Docker HOT 1
- See if Eclipser can still build by Docker recipe, if so add it back in HOT 1
- Range conversions can crash reducer HOT 1
- Avoiding position-independent executables due to linker error 'Relocation R_X86_64_32S against symbol `DeepState_UsingSymExec` can not be used when making a PIE object'
- Add mode to make integral ranges select extremes of the range when value is not in range HOT 1
- Improve Build Documentation and Process HOT 1
- Docker Build Fails HOT 1
- Add AFLplusplus
- Pattern match on Windows
- Bounties? 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 deepstate.