Semion Prihodko
2011-Nov-06 17:09 UTC
[LLVMdev] LLVM: to catch 'unwind' instruction from calling C++ code
Hi! I have a little problem using LLVM and will be happy to get a solution. I need to handle in C++ code an uncaught unwind instruction while calling JIT (now I get segfault). I mean something like nonexistent ExecutionEngine::invokeFunction instead of callFunction. Setting llvm::JITExceptionHandling to true and enclosing the JIT-call within try/catch block does not help here, because there is no C++ style exception thrown, but a simple unwind instruction. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111106/2d2313da/attachment.html>
Duncan Sands
2011-Nov-07 09:10 UTC
[LLVMdev] LLVM: to catch 'unwind' instruction from calling C++ code
Hi Semion, the unwind instruction has been removed from LLVM. Also, the JIT and code generators never supported it: it never unwound the stack, it just resulted in a nasty crash. Ciao, Duncan.> I have a little problem using LLVM and will be happy to get a solution. I need > to handle in C++ code an uncaught unwind instruction while calling JIT (now I > get segfault). I mean something like nonexistent ExecutionEngine::invokeFunction > instead of callFunction. Setting llvm::JITExceptionHandling to true > and enclosing the JIT-call within try/catch block does not help here, because > there is no C++ style exception thrown, but a simple unwind instruction. Thanks > in advance. > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Semion Prihodko
2011-Nov-07 09:33 UTC
[LLVMdev] LLVM: to catch 'unwind' instruction from calling C++ code
oops... so how can unwind stack up to invoke call? Is there an alternative to establish a custom exception handling? 2011/11/7 Duncan Sands <baldrick at free.fr>> >> Hi Semion, the unwind instruction has been removed from LLVM. Also, the >> JIT >> and code generators never supported it: it never unwound the stack, it >> just >> resulted in a nasty crash. >> >> Ciao, Duncan. >> >> > I have a little problem using LLVM and will be happy to get a solution. >> I need >> > to handle in C++ code an uncaught unwind instruction while calling JIT >> (now I >> > get segfault). I mean something like nonexistent >> ExecutionEngine::invokeFunction >> > instead of callFunction. Setting llvm::JITExceptionHandling to true >> > and enclosing the JIT-call within try/catch block does not help here, >> because >> > there is no C++ style exception thrown, but a simple unwind >> instruction. Thanks >> > in advance. >> > >> > >> > >> > _______________________________________________ >> > LLVM Developers mailing list >> > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111107/86f3d615/attachment.html>
Duncan Sands
2011-Nov-07 11:28 UTC
[LLVMdev] LLVM: to catch 'unwind' instruction from calling C++ code
Hi Semion,> oops... so how can unwind stack up to invoke call? Is there an alternative to > establish a custom exception handling?you can call a library routine, for example __cxa_throw (the C++ throw routine) or the libgcc library routine _Unwind_RaiseException (which is what __cxa_throw calls after setting up a C++ specific exception). Ciao, Duncan.> > 2011/11/7 Duncan Sands <baldrick at free.fr <mailto:baldrick at free.fr>> > > Hi Semion, the unwind instruction has been removed from LLVM. Also, the JIT > and code generators never supported it: it never unwound the stack, it just > resulted in a nasty crash. > > Ciao, Duncan. > > > I have a little problem using LLVM and will be happy to get a > solution. I need > > to handle in C++ code an uncaught unwind instruction while calling > JIT (now I > > get segfault). I mean something like nonexistent > ExecutionEngine::invokeFunction > > instead of callFunction. Setting llvm::JITExceptionHandling to true > > and enclosing the JIT-call within try/catch block does not help here, > because > > there is no C++ style exception thrown, but a simple unwind > instruction. Thanks > > in advance. > > > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >
Possibly Parallel Threads
- [LLVMdev] LLVM: to catch 'unwind' instruction from calling C++ code
- [LLVMdev] Unwinds Gone Wild
- [LLVMdev] Catching exceptions passed through a JIT ExecutionEngine
- [LLVMdev] Crash in libunwind
- [LLVMdev] Catching exceptions passed through a JIT ExecutionEngine