Introduce signal intercepting example
It is a nice first attempt to demonstrate the idea, far from complete.
To give it a try, start the dummy program which installs a signal handler:
LD_LIBRARY_PATH=./examples LD_PRELOAD=libsignal_interceptor.so ./examples/signaller
Send it a USR1 signal, and see what happens.
Ref: #4
BTW, this can be used to handle nasty pointers pass to pmemfile via syscall interfaces, e.g.:
thread_local sigjmp_buf user_pointer_jmb_buf;
thread_local bool jump_back_to_pmemfile;
pmemfile_write(pfp, file, buf, size)
{
ssize_t result;
jump_back_to_pmemfile = true;
if (sigsetjmp(user_pointer_jmb_buf, 0) == 0) {
memcpy(buf, pmemfile_block, size);
result = size;
} else {
result = -EFAULT;
}
jump_back_to_pmemfile = false;
return result;
}
signal_hook(int sig, siginfo_t *info, void *arg)
{
if (sig == SIGSEGV && jump_back_to_pmemfile) {
/* fault due to pointer from user */
siglongjmp(user_pointer_jmb_buf, 1);
}
}
So, this info could be added to the source file and/or to some README.
Reviewed 3 of 3 files at r1. Review status: all files reviewed at latest revision, all discussions resolved.
Comments from Reviewable
This build fails. Not quite sure why.
I think there is something really wrong with the docker related scripts, which wasn't manifested until #48 was merged. It might be a good a idea to copy docker build scripts from the pmemfile repo.
Codecov Report
Merging #46 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #46 +/- ##
=======================================
Coverage 69.71% 69.71%
=======================================
Files 19 19
Lines 1433 1433
Branches 391 391
=======================================
Hits 999 999
Misses 235 235
Partials 199 199
| Flag | Coverage Δ | |
|---|---|---|
| #pmemfile_tests | 65.67% <ø> (ø) |
:arrow_up: |
| #regular_tests | 56.38% <ø> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update e15d384...154f91f. Read the comment docs.