-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 [email protected]
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 [email protected]