Repository navigation
Skip some tests if run with 32-bit rr under a 64-bit kernel - #2784
Conversation
I'm not sure what to do when someone tries to exec a 64-bit binary under 32-bit rr, but hitting that DEBUG_ASSERT is probably not the right thing to do (for one thing, it will behave differently in release builds). I think we should probably have an explicit check somewhere in the exec code and either cause rr to die with FATAL(), or cause the execve syscall to fail. |
My preference would be to fail the execve with ENOEXEC: which is what would happen if you tried to exec an incorrect architecture executable. With 32bit rr we're essentially a 32bit kernel, so that seems like the right thing to do. |
|
Thank you all for your input, but I fear I am not able to find a location where I can intercept the exec syscall. As far as I see rr recognizes the architecture first in Is something similar done already somewhere else? |
|
That's a good question. It's probably not worth trying to predict what the kernel will end up execing so we can test it. Let's just fail with a FATAL() instead. |
72e5b56 to
87f268a
Compare
|
I hope it is ok to just add that FATAL to the place where rr first detects that we have a x86_64 process instead of changing the DEBUG_ASSERT? |
| if [[ "_32" == $bitness ]] || [[ "$(uname -m)" =~ i[3-6]86 ]]; then | ||
| if [[ "_32" == $bitness ]] || | ||
| [[ "$(uname -m)" =~ i[3-6]86 ]] || | ||
| [[ "$(file $RESOURCE_PATH/lib/rr/librrpage.so | grep 32-bit -c)" == "1" ]]; |
There was a problem hiding this comment.
I think we need to split skip_if_32_bit into two functions:
-- One that aborts the test if it's a 32-bit test. Let's say skip_if_test_32_bit
-- One that aborts the test if this is a 32-bit rr build. Let's say skip_if_rr_32_bit.
There was a problem hiding this comment.
I don't think we need to check uname and librrpage.so. Just checking librrpage.so is a good way to detect 32-bit rr.
There was a problem hiding this comment.
I have split skip_if_32_bit into two, dropped the uname, and added skip_if_rr_32_bit to the just failing two tests.
This helps tests vdso_gettimeofday_stack and vdso_time_stack.
This helps tests simple_script and simple_script_debug.
87f268a to
4c2b16f
Compare
This is mostly done by detecting bitness or the name of librrpage.so.
Can we take a
whichandfilein the environment as given?In 64bit_child.c the following comment makes me wonder if it is still true:
In my tests a 32-bit rr with a 64-bit shell under a 64-bit kernel, if not skipped, does abort like this:
Therefore should this comment be removed too?
Related to #2782