Yuri
2010-Sep-22 22:11 UTC
[LLVMdev] Why isn't __deregister_frame called anywhere in LLVM?
I have two JIT runs in the same process. First one runs fine. During the second JIT run the exception is thrown, and process catches SEGV after it is thrown and before it is caught. In debugger I see that crash occurs in the function 'classify_object_over_fdes' called from 'init_object' called from 'search_object' called from '_Unwind_Find_registered_FDE'. Crash occurs on invalid FDE object after several iterations over the valid FDE objects. So it looks like an invalid FDE object is attached to the valid ones. Also when I split two JIT runs into the separate processes nothing crashes. As I understand, __deregister_frame has to be called during code removal. I can only see __register_frame call, and not __deregister_frame. Why? Yuri
Yuri
2010-Sep-24 09:34 UTC
[LLVMdev] [PATCH] Why isn't __deregister_frame called anywhere in LLVM?
Please check in an attached patch. Synopsys of the change: fixed the cleanup process of exception information in JIT. Now JIT deregisters registered by it FDE structures allowing consecutive JIT runs to succeed. Note: tools like lli should delete ExecutionEngine object and not the module. Module is deleted by ExecutionEngine. Also I am not sure if this is proper for the module to be owned by ExecutionEngine. I think they should be independently owned. Yuri 23.09.2010 01:11, Yuri wrote:> I have two JIT runs in the same process. > First one runs fine. During the second JIT run the exception is > thrown, and process catches SEGV after it is thrown and before it is > caught. > > In debugger I see that crash occurs in the function > 'classify_object_over_fdes' called from 'init_object' called from > 'search_object' called from '_Unwind_Find_registered_FDE'. Crash > occurs on invalid FDE object after several iterations over the valid > FDE objects. So it looks like an invalid FDE object is attached to the > valid ones. Also when I split two JIT runs into the separate processes > nothing crashes. > > As I understand, __deregister_frame has to be called during code > removal. I can only see __register_frame call, and not > __deregister_frame. Why? > > Yuri-------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100924/aaa8ff8e/attachment.txt>
Yuri
2010-Oct-03 10:43 UTC
[LLVMdev] [PATCH] Why isn't __deregister_frame called anywhere in LLVM?
On 09/24/2010 02:34, Yuri wrote:> Please check in an attached patch. > > Synopsys of the change: fixed the cleanup process of exception > information in JIT. Now JIT deregisters registered by it FDE > structures allowing consecutive JIT runs to succeed. > > Note: tools like lli should delete ExecutionEngine object and not the > module. Module is deleted by ExecutionEngine. Also I am not sure if > this is proper for the module to be owned by ExecutionEngine. I think > they should be independently owned. > > YuriFor some reason I failed to attract any attention or acknowledgement of the issue. So I filed this PR: http://llvm.org/bugs/show_bug.cgi?id=8285 Yuri
Reasonably Related Threads
- [LLVMdev] Why isn't __deregister_frame called anywhere in LLVM?
- Possible stack corruption during call to JITSymbol::getAddress()
- Possible stack corruption during call to JITSymbol::getAddress()
- Possible stack corruption during call to JITSymbol::getAddress()
- Possible stack corruption during call to JITSymbol::getAddress()