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)

Most upvoted comments

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:

To be honest, I probably wouldn’t know an odd instruction if there is one. That said, here’s the gdb output:

(gdb) r Starting program: /home/vagrant/stoke/bin/stoke_search --init zero --config synthesize.conf [Thread debugging using libthread_db enabled] Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”. WARNING: Some cpu flags are not available on this hardware and will be removed: WARNING: { syscall rdtscp monitor fma movbe f16c rdrand lahf_lm abm xsaveopt fsgsbase bmi1 hle avx2 bmi2 erms invpcid rtm }

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f863e4 in ?? () (gdb) display/i $pc 1: x/i $pc => 0x7ffff7f863e4: callq *%rax

You can see I’m also getting more cpu flags are unsupported, not sure why 🤔 Here are the flags I’m currently compiling my code with, maybe there’s something there?

-std=c11 -O3 -fno-inline -fno-stack-protector -fPIC -ggdb

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/StanfordPL/stoke/issues/959#issuecomment-308953351, or mute the thread https://github.com/notifications/unsubscribe-auth/AAnG6StlgsLQJ976s9Y6WT8jAyYs8rGKks5sEizpgaJpZM4NpiME .

– Berkeley