stoke: unsupported instruction errors
specs: OS: Ubuntu 16.04 branch: ubuntu16.04
problem: In general, I’m running into a lot of “unsupported instruction” errors particularly in stoke extract and debug simplify. Here they are just for reference:
$ stoke debug simplify --functions bins --target bins/edge_coverage.s
FATAL ERROR: Auxiliary function (deregister_tm_clones) contains an unsupported instruction: jmpq %rax
$ stoke extract -i ./bin/mini -o bins
WARNING: Cannot parse function 'read_edges', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'create_graph', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'create_sequence', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'read_file', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
I’m compiling my code with gcc-4.9.3 -std=c11 -O3 -fno-inline. I was reading #896 which looks like its describing the same problem. So is there a gcc flag I can set to prevent x64asm memory segments from being used, or is that something I do in the code?
Also, the IntegrationTest.SandboxRip test is failing for me:
WARNING: Cannot parse function 'main', skipping. Error(s): Could not encode 'rep movsq %ds:(%rsi),%es:(%rdi)' within 3 bytes.
WARNING: Cannot parse function 'nibble_sort_bloom', skipping. Error(s): Could not encode 'rep stosq %es:(%rdi)' within 3 bytes.
WARNING: Cannot parse function 'nibble_sort_burton1', skipping. Error(s): Could not encode 'rep stosq %es:(%rdi)' within 3 bytes.
WARNING: Cannot parse function 'nibble_sort_carlos', skipping. Error(s): Could not encode 'vpgatherqq %ymm7,0x627100(,%ymm8,8),%ymm0' within 10 bytes.
WARNING: Cannot parse function 'nibble_sort_grayson', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'nibble_sort_jarkko', skipping. Error(s): Could not encode 'rep stosq %es:(%rdi)' within 3 bytes.
WARNING: Cannot parse function 'nibble_sort_justin', skipping. Error(s): Could not encode 'rep stosq %es:(%rdi)' within 3 bytes.
WARNING: Cannot parse function 'nibble_sort_mats', skipping. Error(s): Could not encode 'rep stosq %es:(%rdi)' within 3 bytes.
WARNING: Could not encode 'rep stosq %es:(%rdi)' within 3 bytes.
WARNING: Cannot parse function 'nibble_sort_mentre', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'nibble_sort_mike', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'nibble_sort_pdewacht1', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'nibble_sort_rogers', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'nibble_sort_rosen', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'validate', skipping. Error(s): Could not encode 'rep movsq %ds:(%rsi),%es:(%rdi)' within 3 bytes.
WARNING: Could not encode 'rep movsq %ds:(%rsi),%es:(%rdi)' within 3 bytes.
WARNING: Cannot parse function 'nibble_sort_vetter2', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
WARNING: Cannot parse function 'nibble_sort_vlad', skipping. Error(s): Could not encode 'movq %fs:0x28,%rax' within 9 bytes.
WARNING: Could not encode 'xorq %fs:0x28,%rax' within 9 bytes.
Errors:
--testcases <path/to/file>
Error reading value: Unable to open source file!
make[1]: *** [sandbox] Error 1
././tests/integration/integration.h:252: Failure
Value of: shell("make")
Actual: 512
Expected: 0ull
Which is: 0
[ FAILED ] IntegrationTest.SandboxRip (8732 ms)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (12 by maintainers)
Ah, yes, this makes sense. We don’t support indirect jumps in the STOKE sandbox yet – that’s a limitation we should document better. You’re probably calling a function pointer, executing a dispatch to a C++ virtual method or something similar. Your best bet is to run STOKE on leaf functions, those which do not call any others, although we do support regular function calls (but it can take some tweaking).
On Fri, Jun 16, 2017 at 12:21 AM, James Albert notifications@github.com wrote:
– Berkeley