Skip to content
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

RangeError - Call stack exceeeds for indexer #661

Closed
charlag opened this issue Oct 10, 2018 · 7 comments
Closed

RangeError - Call stack exceeeds for indexer #661

charlag opened this issue Oct 10, 2018 · 7 comments
Assignees
Labels
bug broken functionality, usability problems, unexpected errors

Comments

@charlag
Copy link
Contributor

charlag commented Oct 10, 2018

RangeError: Maximum call stack size exceeded
at https://mail.tutanota.com/worker.js:1:286989
at Array.filter ()
at IndexerCore.value (https://mail.tutanota.com/worker.js:1:286974)
at https://mail.tutanota.com/worker.js:1:286638
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402267)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
at _mapInCallContext (https://mail.tutanota.com/worker.js:1:402449)
@charlag charlag added the bug broken functionality, usability problems, unexpected errors label Oct 10, 2018
@charlag
Copy link
Contributor Author

charlag commented Oct 12, 2018

This error is a result of a fix we applied because of the non-spec-compliant browsers in c7759d9.
We've been afraid it will lead to stack exhaustion but we were not able to reproduce it.

For browsers with proper microtasks we don't need that fix. We have no choice but to apply this fix only for old browsers and hope for the best.

From our testing Safari 12.1 works without this hack (at least at one point).
It has been fixed in Firefox in 60 (see https://bugzilla.mozilla.org/show_bug.cgi?id=1193394, https://hg.mozilla.org/mozilla-central/rev/068c59c7c4ec, https://hg.mozilla.org/mozilla-central/rev/84ea422093dd).

Internal Mozilla slides about this problem (warning, Google Docs):
https://docs.google.com/presentation/d/1momsC3suU8m-CrdZyYD_6QATATehjzZHbkGmL6KsmSk/edit#slide=id.p

We should also check Edge but they should be mostly up-to-date

@armhub
Copy link
Contributor

armhub commented Oct 13, 2018

I just got this error in Chromium on Ubuntu:
error RangeError: Maximum call stack size exceeded
at EventQueue.value (https://mail.tutanota.com/worker.js:1:274139)
at IndexerCore.value (https://mail.tutanota.com/worker.js:1:282764)
at Indexer.value (https://mail.tutanota.com/worker.js:1:308998)
at https://mail.tutanota.com/worker.js:1:314804
at r (https://mail.tutanota.com/libs.js:32:9669)
at i._settlePromiseFromHandler (https://mail.tutanota.com/libs.js:31:14830)
at i._settlePromise (https://mail.tutanota.com/libs.js:31:15633)
at i._settlePromise0 (https://mail.tutanota.com/libs.js:31:16334)
at i._settlePromises (https://mail.tutanota.com/libs.js:31:17689)
at i._fulfill (https://mail.tutanota.com/libs.js:31:16705)
at i._resolveCallback (https://mail.tutanota.com/libs.js:31:13566)
at i._settlePromiseFromHandler (https://mail.tutanota.com/libs.js:31:14985)
at i._settlePromise (https://mail.tutanota.com/libs.js:31:15633)
at i._settlePromise0 (https://mail.tutanota.com/libs.js:31:16334)
at i._settlePromises (https://mail.tutanota.com/libs.js:31:17689)
at i._fulfill (https://mail.tutanota.com/libs.js:31:16705)

Is a fix for Chromium already included in this issue?

@armhub armhub reopened this Oct 13, 2018
@charlag
Copy link
Contributor Author

charlag commented Oct 15, 2018

@armhub That looks like completely different issue, it is not when indexing or searching but when loading EntityEvents on startup. Maybe we should open another one?

@charlag
Copy link
Contributor Author

charlag commented Oct 15, 2018

It looks like this issue to me: petkaantonov/bluebird#1326
Promise.each() is still dangerous to use when some iterations do not return Promisable.
We could try to mitigate that with returning promise in any case here:
https://github.com/tutao/tutanota/blob/master/src/api/worker/search/Indexer.js#L334

but I need to understand how to reproduce it

@armhub
Copy link
Contributor

armhub commented Jul 8, 2019

Occurs again in Chromium on Ubuntu when typing recipient mail address. Console log:

db aborted Eventbubbles: truecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: nulldefaultPrevented: falseeventPhase: 0isTrusted: truepath: []returnValue: truesrcElement: IDBTransaction {objectStoreNames: DOMStringList, mode: "readonly", db: IDBDatabase, error: DOMException, onabort: ƒ, …}target: IDBTransaction {objectStoreNames: DOMStringList, mode: "readonly", db: IDBDatabase, error: DOMException, onabort: ƒ, …}timeStamp: 0type: "abort"proto: Event
ErrorHandler.js:12 error CryptoErrormessage: "could not setup worker> Uncaught RangeError: Maximum call stack size exceeded"name: "CryptoError"stack: "CryptoError: could not setup worker> Uncaught RangeError: Maximum call stack size exceeded↵ at Worker. (https://mail.tutanota.com/main.js:1:1582550)"__proto__: TutanotaError
libs.js:26 Uncaught RangeError: Maximum call stack size exceeded
at F._settlePromiseFromHandler (libs.js:26)
at F._settlePromise (libs.js:26)
at F._settlePromise0 (libs.js:26)
at F._settlePromises (libs.js:26)
at F._fulfill (libs.js:26)
at F._resolveCallback (libs.js:26)
at F._settlePromiseFromHandler (libs.js:26)
at F._settlePromise (libs.js:26)
at F._settlePromise0 (libs.js:26)
at F._settlePromises (libs.js:26)
at F._fulfill (libs.js:26)
at F._resolveCallback (libs.js:26)
at F._settlePromiseFromHandler (libs.js:26)
at F._settlePromise (libs.js:26)
at F._settlePromise0 (libs.js:26)
at F._settlePromises (libs.js:26)

@armhub armhub reopened this Jul 8, 2019
@mpfau
Copy link
Contributor

mpfau commented Nov 1, 2019

@armhub that is also a different issue, now tracked at #1592

@charlag
Copy link
Contributor Author

charlag commented Feb 1, 2021

Not reported for some time

@charlag charlag closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug broken functionality, usability problems, unexpected errors
Projects
None yet
Development

No branches or pull requests

3 participants