Library version: v1.8.1
I am encountering an OCSD_ERR_RET_STACK_OVERFLOW error when decoding a specific ETMv4 trace sequence involving back-to-back exceptions. The packet sequence looks similar to the following:
EXCEPTION
ADDR
...
ATOM_E
EXCEPTION_RETURN
TIMESTAMP
EXCEPTION
ADDR
...
I tried to debug the execution and found:
- After committing
ATOM_E (indicating the exception return), m_return_stack.pop_pending() becomes true.
- When the library attempts to commit the subsequent
EXCEPTION packet, it tries to pop the stack because pop_pending() is true.
- Since the stack is empty at this point, the library triggers
OCSD_ERR_RET_STACK_OVERFLOW.
Based on sections 5.2.8 and 5.3.1 of the ETMv4 specification, it appears the library should not attempt to pop the stack if the preceding ATOM_E indicates an exception return.
I tested adding m_return_stack.clear_pop_pending() within case P0_EXCEP_RET: of TrcPktDecodeEtmV4I::commitElements. The decoding result looks correct for this specific trace. However, I am not sure if this is the correct way to fix this issue.
Library version: v1.8.1
I am encountering an
OCSD_ERR_RET_STACK_OVERFLOWerror when decoding a specific ETMv4 trace sequence involving back-to-back exceptions. The packet sequence looks similar to the following:I tried to debug the execution and found:
ATOM_E(indicating the exception return),m_return_stack.pop_pending()becomestrue.EXCEPTIONpacket, it tries to pop the stack becausepop_pending()istrue.OCSD_ERR_RET_STACK_OVERFLOW.Based on sections 5.2.8 and 5.3.1 of the ETMv4 specification, it appears the library should not attempt to pop the stack if the preceding
ATOM_Eindicates an exception return.I tested adding
m_return_stack.clear_pop_pending()withincase P0_EXCEP_RET:ofTrcPktDecodeEtmV4I::commitElements. The decoding result looks correct for this specific trace. However, I am not sure if this is the correct way to fix this issue.