[LLVMbugs] [Bug 17112] New: llvm-ld produces .bc file that does not terminate on execution

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 5 13:23:38 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17112

            Bug ID: 17112
           Summary: llvm-ld produces .bc file that does not terminate on
                    execution
           Product: tools
           Version: 3.1
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-ld
          Assignee: unassignedbugs at nondot.org
          Reporter: manishps824 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11148
  --> http://llvm.org/bugs/attachment.cgi?id=11148&action=edit
Folder contaning all files.

I have 3 files say file 1,2,3. File 1 is main test file. File 2, file 3 contain
some definitions of helper functions. File 1 is instrumented with calls to the
helper functions in other two files using a pass i have written. I use two
procedures to execute the code.

1)Instrument the file 1 to get a .bc file. Use clang to get .bc files of file 2
and file 3. Use llc to get the corresponding .s files. Finally link them using
gcc to get executable. This executable that i get performs as expected.

2)Instrument the file 1 to get a .bc file. Use clang to get .bc files of file 2
and file 3. Use llvm-ld to link these .bc files to get final .bc file. But when
i use lli to execute this bytecode the program gets stuck in some infinite
loop.

Strange part is addition of few print statements file 3 and reapplication of
process 2 , produces a fully working bytecode.

I provide the all .bc and .s files . The code involves spawning a new thread.

Use following command to recreate.

1)
llvm-ld lib.bc tryAndcrashNoSwitchReplicated.bc handleFunctionPointers.bc -o
final

./final

2)
gcc lib.s handleFunctionPointers.s tryAndcrashNoSwitchReplicated.s -lpthread

./a.out

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130905/8c7d438a/attachment.html>


More information about the llvm-bugs mailing list