exceptions4c icon indicating copy to clipboard operation
exceptions4c copied to clipboard

Exception context lost while using dynamic exception-aware libraries

Open jchapon opened this issue 9 years ago • 0 comments

Hello

I tried exceptions4c in an application with dynamic libraries like this:

program
 |_ lib1.so          (uses exception framework)
      |_lib2.so      (uses exception framework)

In my case, the context is lost between lib1 and lib2 even if the macro e4c_reusing_context is used.

The first tests were OK but with static libraries only.

I tested test_h08, edited to simulate my case, and here are the results in a static and dynamic way : ** static **

ext1:__ext1_the_context_WAS_NOT_ready
ext1:__ext1_before_REUSING_CONTEXT
ext1:__ext1_before_TRY_block
ext1:__ext1_before_CALL_FUNCTION_ext2
ext2:____ext2_the_context_WAS_ready
ext2:____ext2_before_REUSING_CONTEXT
ext2:before_CALL_FUNCTION_aux
aux:_____aux_no_exception_was_thrown
ext2:after_CALL_FUNCTION_aux
ext2:after_REUSING_CONTEXT_ext2
ext2:____ext2_the_context_IS_ready
ext2:____ext2_there_was_no_error
ext1:__ext1_after_CALL_FUNCTION_ext2
ext1:__ext1_inside_FINALLY_block
ext1:__ext1_after_TRY_block
ext1:__ext1_after_REUSING_CONTEXT
ext1:__ext1_the_context_IS_NOT_ready
ext1:__ext1_there_was_no_error
main:after_CALL_FUNCTION_ext1
main:result_was_0

** dynamic **

main:before_CALL_FUNCTION_ext1
ext1:__ext1_the_context_WAS_NOT_ready
ext1:__ext1_before_REUSING_CONTEXT
ext1:__ext1_before_TRY_block
ext1:__ext1_before_CALL_FUNCTION_ext2
ext2:____ext2_the_context_WAS_NOT_ready
ext2:____ext2_before_REUSING_CONTEXT
ext2:before_CALL_FUNCTION_aux
aux:_____aux_no_exception_was_thrown
ext2:after_CALL_FUNCTION_aux
ext2:after_REUSING_CONTEXT_ext2
ext2:____ext2_the_context_IS_NOT_ready
ext2:____ext2_there_was_no_error
ext1:__ext1_after_CALL_FUNCTION_ext2
ext1:__ext1_inside_FINALLY_block
ext1:__ext1_after_TRY_block
ext1:__ext1_after_REUSING_CONTEXT
ext1:__ext1_the_context_IS_NOT_ready
ext1:__ext1_there_was_no_error
main:after_CALL_FUNCTION_ext1
main:result_was_0

jchapon avatar Jan 25 '16 17:01 jchapon