{"action":"created","issue":{"url":"https://api.github.com/repos/dyninst/dyninst/issues/96","repository_url":"https://api.github.com/repos/dyninst/dyninst","labels_url":"https://api.github.com/repos/dyninst/dyninst/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/dyninst/dyninst/issues/96/comments","events_url":"https://api.github.com/repos/dyninst/dyninst/issues/96/events","html_url":"https://github.com/dyninst/dyninst/issues/96","id":160490419,"number":96,"title":"Rewritten binary dies with SIGILL","user":{"login":"melsabagh","id":13213521,"avatar_url":"https://avatars.githubusercontent.com/u/13213521?v=3","gravatar_id":"","url":"https://api.github.com/users/melsabagh","html_url":"https://github.com/melsabagh","followers_url":"https://api.github.com/users/melsabagh/followers","following_url":"https://api.github.com/users/melsabagh/following{/other_user}","gists_url":"https://api.github.com/users/melsabagh/gists{/gist_id}","starred_url":"https://api.github.com/users/melsabagh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melsabagh/subscriptions","organizations_url":"https://api.github.com/users/melsabagh/orgs","repos_url":"https://api.github.com/users/melsabagh/repos","events_url":"https://api.github.com/users/melsabagh/events{/privacy}","received_events_url":"https://api.github.com/users/melsabagh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-06-15T18:23:35Z","updated_at":"2016-06-16T16:36:25Z","closed_at":null,"body":"On Ubuntu 16 x64, rewriting whetstone-double (from UnixBench) with anything besides null instrumentation results in illegal instructions:\r\n\r\n```\r\n$ parseThat --binary-edit=whetstone-double.dyn -i 3 whetstone-double\r\nWrite File Path is whetstone-double.dyn\r\n[ Processing whetstone-double ] ===============================================\r\nCreating new BPatch object.... done.\r\nRetrieving BPatch_image object.... done.\r\nParsing image for module information.... Found 4 module(s).\r\nParsing function data from whetstone-double module... Found 12 function(s).\r\nParsing CFG data from functions in whetstone-double module... done.\r\nParsing function data from crtfastmath.c module... Found 1 function(s).\r\nParsing CFG data from functions in crtfastmath.c module... done.\r\nParsing function data from whets.c module... Found 1 function(s).\r\nParsing CFG data from functions in whets.c module... done.\r\nParsing function data from crtstuff.c module... Found 2 function(s).\r\nParsing CFG data from functions in crtstuff.c module... done.\r\nInstrumenting functions in module whetstone-double... done.\r\nInstrumenting functions in module crtfastmath.c... done.\r\nInstrumenting functions in module whets.c... done.\r\nInstrumenting functions in module crtstuff.c... done.\r\nWaiting for mutator to exit...\r\nDyninst mutator exited normally and returned 0.\r\n[ Done processing whetstone-double ] ------------------------------------------\r\nAnalysis complete.\r\n```\r\n\r\nRunning the rewritten binary fails with SIGILL:\r\n```\r\n$ ./whetstone-double.dyn 10\r\nCalibrate\r\nIllegal instruction (core dumped)\r\n```\r\n```\r\n$ gdb ./whetstone-double.dyn\r\nReading symbols from ./whetstone-double.dyn...done.\r\n(gdb) r 10\r\nStarting program: whetstone-double.dyn \r\nCalibrate\r\n\r\nProgram received signal SIGILL, Illegal instruction.\r\n0x00000000007025b2 in ?? ()\r\n(gdb) bt\r\n#0  0x00000000007025b2 in ?? ()\r\n#1  0x00007ffff7ac9620 in _IO_2_1_stderr_ () from /lib/x86_64-linux-gnu/libc.so.6\r\n#2  0x000000000000000a in ?? ()\r\n#3  0x0000000000708010 in ?? ()\r\n#4  0x00007fffffffdeb0 in ?? ()\r\n#5  0x0000000000000000 in ?? ()\r\n```\r\n\r\nValgrind also fails to uplift the assembly to its IR, at the same offset. The sequence of offending instruction bytes are:\r\n```\r\n0x7025b2: 0x16 0xd0 0xff 0x0 0xc4 0xe1 0xe3 0x81\r\n```\r\n\r\nThe springboard debug output shows the following:\r\n```\r\n7025b2: push <INVALID_REG>, RSP\r\n```\r\nHere's the full  springboard and relocation debug output: [dyn-whets-sprng-reloc.txt](https://github.com/dyninst/dyninst/files/316896/dyn-whets-sprng-reloc.txt)\r\n\r\nUnixBench is available at: https://github.com/kdlucas/byte-unixbench.git \r\nThe benchmark programs are under the `UnixBench/pgms` directory. Run`make` to build.\r\n"},"comment":{"url":"https://api.github.com/repos/dyninst/dyninst/issues/comments/226541271","html_url":"https://github.com/dyninst/dyninst/issues/96#issuecomment-226541271","issue_url":"https://api.github.com/repos/dyninst/dyninst/issues/96","id":226541271,"user":{"login":"jdetter","id":4099508,"avatar_url":"https://avatars.githubusercontent.com/u/4099508?v=3","gravatar_id":"","url":"https://api.github.com/users/jdetter","html_url":"https://github.com/jdetter","followers_url":"https://api.github.com/users/jdetter/followers","following_url":"https://api.github.com/users/jdetter/following{/other_user}","gists_url":"https://api.github.com/users/jdetter/gists{/gist_id}","starred_url":"https://api.github.com/users/jdetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdetter/subscriptions","organizations_url":"https://api.github.com/users/jdetter/orgs","repos_url":"https://api.github.com/users/jdetter/repos","events_url":"https://api.github.com/users/jdetter/events{/privacy}","received_events_url":"https://api.github.com/users/jdetter/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T16:36:25Z","updated_at":"2016-06-16T16:36:25Z","body":"Ok, sounds good!"}}
{"actor":{"display_login":"jdetter"}}