Abhinav Anil Sharma
Abhinav Anil Sharma
I think it should be possible to avoid this multi-step complexity at the client side. In the insertion phase, we can find the spill slot used in the app2app phase...
Actually, using the first spill slot after the last app write won't work if that spill slot was later recycled. I remember this being a corner case also in the...
@derekbruening I thought it'd be useful to add an example for how the app2app phase should restore a spilled reg value so that the insertion phase can see it.
Is this ready for review? (checking since I didn't see a review request)
I've approved but please wait for Derek to have a look too and resolve the pending comments.
We do not want to assume the capability of modifying the kernel or loading a kernel module at runtime.
Here's the stack trace for the crash: ``` Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7e89909 in rseq_clear_tls_ptr (dcontext=0x7ffdb3b86080) at /home/abhinav92003/dynamorio-master/core/unix/rseq_linux.c:221 221 if (is_dynamo_address((byte *)(ptr_uint_t)app_rseq->rseq_cs.ptr64)) (gdb) bt #0 0x00007ffff7e89909 in rseq_clear_tls_ptr...
I see that we set `rseq_tls_offset` at two places: In `rseq_locate_rseq_regions` during init/takeover: https://github.com/DynamoRIO/dynamorio/blob/c233329152742864f3b1b72e4faf754fd2b1c65c/core/unix/rseq_linux.c#L732 In `rseq_process_syscall` post an rseq syscall: https://github.com/DynamoRIO/dynamorio/blob/c233329152742864f3b1b72e4faf754fd2b1c65c/core/unix/rseq_linux.c#L675 Also, we expect both of them to give the...
`rseq_process_syscall` and `rseq_locate_tls_offset` compute `rseq_tls_offset` relative to `get_app_segment_base`, however `rseq_clear_tls_ptr` adds it to `get_segment_base`, which is wrong as we need the app's seg base. It works when I change it...
A few observations: * Another, probably cleaner workaround than `-disable_rseq` is: ``` GLIBC_TUNABLES=glibc.pthread.rseq=0 export GLIBC_TUNABLES ``` This prevents glibc from registering its own rseq_cs; essentially disables the glibc rseq support....