__apply_relocations recursion causing call stack exceeded error on Safari 13

30 views
Skip to first unread message

Manish Kasat

unread,
Oct 3, 2019, 7:32:44 AM10/3/19
to emscripten-discuss
Hi,

We are using dynamic linking in our app and recently it started giving us error "Range Error: Maximum call stack size exceeded." on Safari version 13. Digging further we noticed that error was happening due to globalCtors was calling __apply_relocations function which then was recursively calling __apply_relocations1 and then 2 and so on. This was causing the call stack size to exceed the Safari 13 limit and hence the error.  

On thing to note is that we don't see this error if we don't use dynamic linking. And Safari did modify the limit as our app was working fine with earlier versions of Safari. 

Can this be fixed such that the generated code is not growing the call stack beyond that limit or is there some way to limit the stack size on emscripten side?

Any suggestions?


Thanks,
Manish

Alon Zakai

unread,
Oct 3, 2019, 12:49:32 PM10/3/19
to emscripte...@googlegroups.com
Looks like this is a limitation of the fastcomp backend. To fix it, we'd need to modify the dynamic linking code there.

However, this is not a problem in the upstream backend. We are close to switching the default to there anyhow, so I'd recommend upgrading,


- Alon


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/bd6d394a-b2b8-4624-88dc-c3cf787aa32d%40googlegroups.com.

Manish Kasat

unread,
Oct 4, 2019, 1:54:55 AM10/4/19
to emscripten-discuss
Thank you Alon for quick response. We will a try to latest upstream then.

-Manish

On Thursday, 3 October 2019 22:19:32 UTC+5:30, Alon Zakai wrote:
Looks like this is a limitation of the fastcomp backend. To fix it, we'd need to modify the dynamic linking code there.

However, this is not a problem in the upstream backend. We are close to switching the default to there anyhow, so I'd recommend upgrading,


- Alon


On Thu, Oct 3, 2019 at 4:32 AM Manish Kasat <manishka...@gmail.com> wrote:
Hi,

We are using dynamic linking in our app and recently it started giving us error "Range Error: Maximum call stack size exceeded." on Safari version 13. Digging further we noticed that error was happening due to globalCtors was calling __apply_relocations function which then was recursively calling __apply_relocations1 and then 2 and so on. This was causing the call stack size to exceed the Safari 13 limit and hence the error.  

On thing to note is that we don't see this error if we don't use dynamic linking. And Safari did modify the limit as our app was working fine with earlier versions of Safari. 

Can this be fixed such that the generated code is not growing the call stack beyond that limit or is there some way to limit the stack size on emscripten side?

Any suggestions?


Thanks,
Manish

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages