Skip to content

Improve "block too big" errors - #2579

Open
PhoenixWhitefire wants to merge 9 commits into
luau-lang:masterfrom
PhoenixWhitefire:lmem-block-errors
Open

Improve "block too big" errors#2579
PhoenixWhitefire wants to merge 9 commits into
luau-lang:masterfrom
PhoenixWhitefire:lmem-block-errors

Conversation

@PhoenixWhitefire

@PhoenixWhitefire PhoenixWhitefire commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Will now be "memory allocation error: [string/buffer/userdata] too big (exceeds maximum of X bytes)" when applicable

@PhoenixWhitefire
PhoenixWhitefire marked this pull request as ready for review July 22, 2026 16:43
@PhoenixWhitefire PhoenixWhitefire changed the title Improve "block too big" error Improve "block too big" errors Jul 22, 2026
@deviaze

deviaze commented Jul 23, 2026

Copy link
Copy Markdown

Should also include the max allowed size of the type in the err message

@PhoenixWhitefire
PhoenixWhitefire marked this pull request as draft July 24, 2026 02:00
@PhoenixWhitefire
PhoenixWhitefire marked this pull request as ready for review July 24, 2026 07:31
@vegorov-rbx vegorov-rbx self-assigned this Aug 4, 2026
Comment thread VM/src/lbuffer.cpp Outdated
{
if (s > MAX_BUFFER_SIZE)
luaM_toobig(L);
luaM_toobig(L, "buffer too big (exceeds maximum of 1GiB)");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't include the size in the message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary maintenance burden, limits can be looked up in documentation of a particular runtime.

@PhoenixWhitefire PhoenixWhitefire Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be part of the format arguments for luaM_toobig - "memory allocation error: %s (exceeds maximum of %zi bytes)" with MAXSSIZE, INT_MAX - sizeof(Udata) being passed etc?

Comment thread VM/src/lstring.cpp Outdated
Comment thread VM/src/lstring.cpp Outdated
Comment thread VM/src/ludata.cpp Outdated
This reverts commit 15fdcc6.
@PhoenixWhitefire
PhoenixWhitefire requested a review from a team as a code owner August 5, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants