Yew: Uncaught RangeError: Maximum call stack size exceeded

Created on 25 Jul 2020  路  8Comments  路  Source: yewstack/yew

Problem
Well, I get the error that's in the title but wasn't able to narrow it down. I have a stacktrace https://paste.ubuntu.com/p/jb226bFWrn/ but I am not sure how useful it is. (It is 4382 lines therefor in the paste)

Steps To Reproduce
Steps to reproduce the behaviour:
That's also not 100% certain. I know it is because I use a public agent/worker and it happens after an unknown amount of minutes. I do have every few seconds a message from worker to UI (daydream.js) because it is a chat app that does the sync in the worker.

Expected behavior
Well it shouldn't panic on the UI thread like that

Environment:

bug

Most helpful comment

This is finally fixed in v0.17.4, thank you to all who contributed to this issue, the examples and circumstances around the bug were helpful in tracking down the cause 馃憤

All 8 comments

I do know for certain that it happens with this app https://github.com/daydream-mx/Daydream/commit/67036f5a90d0ad10caee7d5efce660b6f6a7d836 (Run it with first installing cargo-make and then running cargo make run. Also a quick npm install is required. All rust deps get installed automaticly). If you want to actually test it by running it you will need a https://matrix.org account. (Its a chat app in the end ^^)

impl PartialEq for NodeRef seems to be the culprit, recursing (via Option<Self>) into itself over and over again under some circumstances. @jstarry

I have the same error in a project using Yew lastest version (gitlab-monitor-rs), after a certain amount of time (~11 minutes without touching anything, just waiting), it panics with error "Uncaught RangeError: Maximum call stack size exceeded"

Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at core::intrinsics::copy_nonoverlapping::h4eb3f7a25d6d517b (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[12011]:0x4a60c1)
    at core::ptr::read::h9a13a8bcd73d1ce7 (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[6974]:0x4215fe)
    at core::ptr::swap_nonoverlapping_one::h941ad73ffb899a43 (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[6074]:0x3ff52c)
    at core::mem::swap::h3ef6751e503e39ec (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[16004]:0x4eaa65)
    at core::mem::replace::hf6d7533a87cd8d7a (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[11494]:0x49b6f4)
    at core::cell::Cell<T>::replace::h5ab0cedc4002c48b (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[13391]:0x4c09ea)
    at core::cell::Cell<T>::set::h9ae899dc90ea4c06 (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[13242]:0x4bde84)
    at core::cell::BorrowRef::new::h0a0710715b31de56 (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[5392]:0x3e191e)
    at core::cell::RefCell<T>::try_borrow::h8a4cdf40bff3ab60 (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[5110]:0x3d403b)
    at core::cell::RefCell<T>::borrow::hd028dd0cc9d2dfd3 (:8080/pkg/gitlab_monitor_bg.wasm:wasm-function[6721]:0x4183aa)

Thanks everyone, we'll make sure this gets released as a patch release for v0.17 or at the very least in v0.18 soon. If anyone has time, I suspect @jplatte is right

Any workaround on this for in between releases? Thanks!

@fstuess I'll put out a patch release soon, just found the issue!

@jstarry this is really great news! Thank you, very cool!!

This is finally fixed in v0.17.4, thank you to all who contributed to this issue, the examples and circumstances around the bug were helpful in tracking down the cause 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FrontMage picture FrontMage  路  4Comments

thienpow picture thienpow  路  3Comments

Boscop picture Boscop  路  5Comments

kellytk picture kellytk  路  3Comments

ghost picture ghost  路  4Comments