cloudflare / cloudflare/workerd

Internal Errors of Type Invalid Arguments/Out of Bound Array Access

Open
#3,532 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

Recently, I encountered an intensive error rate (~30%) of type `internal errors` in my deployed worker and had no idea of the origin of these errors. After working on the issue for a couple of days and getting help from the CF team, I found that the `internal errors` were being thrown because of `Invalid Arguments/Out Of Bound Array Access` (90% accurate conclusion). I had a `DataView` for which I was passing incorrect arguments, new `DataView(mBuffer, count * 2, 2)`. The `count * 2` was bigger than the length of `mBuffer`, causing the `DataView` to encounter an `Out of Bound Array Access`. The variable `count` would increase over time, and when the worker was running for a long period, `count` would exceed the size of `mBuffer`, resulting in `internal errors` being thrown.

As the CF team suggested, I opened this issue to be sorted for future developments to add an informative `js` exception for such conditions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.