Fixes the Clang compiler caused deadloop issue#4530
Conversation
|
Here is the full description of the bug: |
5d7b4a3 to
96aa837
Compare
When clang do tail optimization calling to ecma_op_object_get_with_receiver, the stack size will not increase. That's cause testcase tests/jerry/es.next/regression-test-issue-3785.js to be deadloop instead of stack overflow exception. Use -fno-optimize-sibling-calls to disable the tail optimization. JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
96aa837 to
0a24797
Compare
Yeap, it's not a bug of clang, I've verified that. |
|
Maybe we need use something like this to disable tail-optimization: |
|
Please provide a backtrace so we can understand what is happening here. |
|
Here is the backtrace In which condition, ecma_op_object_get_with_receiver tail calling will not Stack-trace-base stack-trace-new, it's hope ecma_op_object_get_with_receiver to deeper, but Same clang , build it with debug flag, the issue gone. I am wonder if there The c code The full source tree |
|
@galpeter could you please share your progress about this issue? AFAIK you also tried some other approach. |
|
yeah I have a way to resolve this. The macros @lygstate mentioned were used to add the tail call disable at given points and also added extra stack checks in the Proxy internal methods. Will upload soon. Note: this is not a clang specific thing and is a very edge case to construct a proxy which recurses (infinite times). |
|
Close as proper fix exist. |
Clang mis-optimization tail calling to ecma_op_object_get_with_receiver:
When ecma_op_object_get_with_receiver are called, the stack size will not increase.
That's cause testcase tests/jerry/es.next/regression-test-issue-3785.js to be deadloop
instead of stack overflow exception.
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com