Christian Schafmeister
2013-May-04 22:24 UTC
[LLVMdev] Exception handling code works with JIT but not when compiled offline to object files.
I've generated a lot of exception handling code that works perfectly when I JIT the code or write it out as bitcode, load it back in to my executable and JIT it. However, when I compile the bitcode files to object files with llc and then link them into a bundle with ld and load the bundle back into my executable the exception handling occasionally fails. I'm running this on OS X 10.8. Has anyone seen this problem before? The test case is large and I'd be happy to provide it or more details if you need more details. Best, .Chris. Christian Schafmeister Associate Professor Chemistry Department Temple University
edA-qa mort-ora-y
2013-May-05 04:02 UTC
[LLVMdev] Exception handling code works with JIT but not when compiled offline to object files.
On 05/05/13 00:24, Christian Schafmeister wrote:> However, when I compile the bitcode files to object files with llc > and then link them into a bundle with ld and load the bundle back > into my executable the exception handling occasionally fails.I had this problem with my exception handling code as well. I was testing on Linux but perhaps a similar issue exists. What I discovered is that for some reason the exception handling in JIT is more lenient than in a compiled executable. That is, I discovered two things in my exception code which were wrong but nonetheless working in the JIT. 1. In some cases I was calling Unwind_Resume even though I wasn't technically in an exception anymore (I had reported it was already handled). 2. For cleanup code I wasn't setting the selector correctly (the value you pass to Unwind_SetGR in regno(1)). I'm still not positive why this caused it to fail, but it did. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 261 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130505/f027cbe8/attachment.sig>