{"action":"created","issue":{"url":"https://api.github.com/repos/seahorn/crab-llvm/issues/41","repository_url":"https://api.github.com/repos/seahorn/crab-llvm","labels_url":"https://api.github.com/repos/seahorn/crab-llvm/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/seahorn/crab-llvm/issues/41/comments","events_url":"https://api.github.com/repos/seahorn/crab-llvm/issues/41/events","html_url":"https://github.com/seahorn/crab-llvm/issues/41","id":468699234,"node_id":"MDU6SXNzdWU0Njg2OTkyMzQ=","number":41,"title":"Devirtualization Error","user":{"login":"shankarapailoor","id":3027955,"node_id":"MDQ6VXNlcjMwMjc5NTU=","avatar_url":"https://avatars1.githubusercontent.com/u/3027955?v=4","gravatar_id":"","url":"https://api.github.com/users/shankarapailoor","html_url":"https://github.com/shankarapailoor","followers_url":"https://api.github.com/users/shankarapailoor/followers","following_url":"https://api.github.com/users/shankarapailoor/following{/other_user}","gists_url":"https://api.github.com/users/shankarapailoor/gists{/gist_id}","starred_url":"https://api.github.com/users/shankarapailoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankarapailoor/subscriptions","organizations_url":"https://api.github.com/users/shankarapailoor/orgs","repos_url":"https://api.github.com/users/shankarapailoor/repos","events_url":"https://api.github.com/users/shankarapailoor/events{/privacy}","received_events_url":"https://api.github.com/users/shankarapailoor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"caballa","id":5025780,"node_id":"MDQ6VXNlcjUwMjU3ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/5025780?v=4","gravatar_id":"","url":"https://api.github.com/users/caballa","html_url":"https://github.com/caballa","followers_url":"https://api.github.com/users/caballa/followers","following_url":"https://api.github.com/users/caballa/following{/other_user}","gists_url":"https://api.github.com/users/caballa/gists{/gist_id}","starred_url":"https://api.github.com/users/caballa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caballa/subscriptions","organizations_url":"https://api.github.com/users/caballa/orgs","repos_url":"https://api.github.com/users/caballa/repos","events_url":"https://api.github.com/users/caballa/events{/privacy}","received_events_url":"https://api.github.com/users/caballa/received_events","type":"User","site_admin":false},"assignees":[{"login":"caballa","id":5025780,"node_id":"MDQ6VXNlcjUwMjU3ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/5025780?v=4","gravatar_id":"","url":"https://api.github.com/users/caballa","html_url":"https://github.com/caballa","followers_url":"https://api.github.com/users/caballa/followers","following_url":"https://api.github.com/users/caballa/following{/other_user}","gists_url":"https://api.github.com/users/caballa/gists{/gist_id}","starred_url":"https://api.github.com/users/caballa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caballa/subscriptions","organizations_url":"https://api.github.com/users/caballa/orgs","repos_url":"https://api.github.com/users/caballa/repos","events_url":"https://api.github.com/users/caballa/events{/privacy}","received_events_url":"https://api.github.com/users/caballa/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2019-07-16T14:48:00Z","updated_at":"2019-07-17T22:00:11Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm running crabllvm-pp on [this](https://drive.google.com/open?id=1ZBn3SFC8j-vfeGUxYYKNATJJtY6Lez1S) bitcode with the following commands:\r\n\r\n```bash\r\n./crabllvm-pp -crab-devirt -devirt-resolver=dsa -crab-lower-select -crab-lower-unsigned-icmp -o strings_pp.bc strings.bc\r\n```\r\n\r\nHowever, I get the following error:\r\n\r\n```\r\n#0 0x000056470871b13b llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/shankara/llvm-project/llvm/lib/Support/Unix/Signals.inc:495:0\r\n #1 0x000056470871b1ce PrintStackTraceSignalHandler(void*) /home/shankara/llvm-project/llvm/lib/Support/Unix/Signals.inc:559:0\r\n #2 0x0000564708718db2 llvm::sys::RunSignalHandlers() /home/shankara/llvm-project/llvm/lib/Support/Signals.cpp:69:0\r\n #3 0x000056470871ab5d SignalHandler(int) /home/shankara/llvm-project/llvm/lib/Support/Unix/Signals.inc:358:0\r\n #4 0x00007f3c68f51890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)\r\n #5 0x00007f3c6824de97 gsignal /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0\r\n #6 0x00007f3c6824f801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0\r\n #7 0x00007f3c6823f39a __assert_fail_base /build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0\r\n #8 0x00007f3c6823f412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)\r\n #9 0x000056470766707f llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&) /home/shankara/llvm-project/llvm/lib/IR/Instructions.cpp:372:0\r\n#10 0x0000564706ffe778 _ZN4llvm8CallInstC4EPNS_12FunctionTypeEPNS_5ValueENS_8ArrayRefIS4_EENS5_INS_17OperandBundleDefTIS4_EEEERKNS_5TwineEPNS_11InstructionE /usr/local/include/llvm/IR/Instructions.h:1725:0\r\n#11 0x0000564706ffe778 llvm::CallInst::Create(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::Instruction*) /usr/local/include/llvm/IR/Instructions.h:1490:0\r\n#12 0x0000564706ffe778 llvm::CallInst::Create(llvm::Function*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::Instruction*) /usr/local/include/llvm/IR/Instructions.h:1535:0\r\n#13 0x0000564706ffe778 crab_llvm::DevirtualizeFunctions::mkDirectCall(llvm::CallSite, crab_llvm::CallSiteResolver*) /home/shankara/crab-llvm/lib/Transforms/DevirtFunctions.cc:527:0\r\n#14 0x0000564706fffbd7 crab_llvm::DevirtualizeFunctions::resolveCallSites(llvm::Module&, crab_llvm::CallSiteResolver*) /home/shankara/crab-llvm/lib/Transforms/DevirtFunctions.cc:603:0\r\n#15 0x0000564706ff9764 crab_llvm::DevirtualizeFunctionsPass::runOnModule(llvm::Module&) /home/shankara/crab-llvm/lib/Transforms/DevirtFunctionsPass.cc:82:0\r\n#16 0x00005647076a5c54 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/shankara/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1744:0\r\n```\r\n\r\nI observed that during the devirtualization that crabllvm is reusing the bounce function:\r\n\r\n```\r\nReusing bounce function for  call void (i8*, ...) %152(i8* %call94, %struct.bfd* %153, %struct.bfd_section* %154, %struct.reloc_cache_entry* %156)\r\n\tseahorn.bounce.16::void (void (i8*, ...)*, i8*, %struct.bfd*, %struct.bfd_section*, %struct.reloc_cache_entry*, i32)*\r\n```\r\n\r\nIt seems there is this additional i32 argument which shouldn't be there."},"comment":{"url":"https://api.github.com/repos/seahorn/crab-llvm/issues/comments/512584810","html_url":"https://github.com/seahorn/crab-llvm/issues/41#issuecomment-512584810","issue_url":"https://api.github.com/repos/seahorn/crab-llvm/issues/41","id":512584810,"node_id":"MDEyOklzc3VlQ29tbWVudDUxMjU4NDgxMA==","user":{"login":"caballa","id":5025780,"node_id":"MDQ6VXNlcjUwMjU3ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/5025780?v=4","gravatar_id":"","url":"https://api.github.com/users/caballa","html_url":"https://github.com/caballa","followers_url":"https://api.github.com/users/caballa/followers","following_url":"https://api.github.com/users/caballa/following{/other_user}","gists_url":"https://api.github.com/users/caballa/gists{/gist_id}","starred_url":"https://api.github.com/users/caballa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caballa/subscriptions","organizations_url":"https://api.github.com/users/caballa/orgs","repos_url":"https://api.github.com/users/caballa/repos","events_url":"https://api.github.com/users/caballa/events{/privacy}","received_events_url":"https://api.github.com/users/caballa/received_events","type":"User","site_admin":false},"created_at":"2019-07-17T22:00:11Z","updated_at":"2019-07-17T22:00:11Z","author_association":"CONTRIBUTOR","body":"I committed a fix. The problem is related to vararg functions. For now, I don't create bounce functions for those. Let me know if this is a problem."}}
{"actor":{"display_login":"caballa"}}