Skip to content

LuajitError: builtin/box/console.lua:557: attempt to index local 'buf' (a string value) #4742

Answered by Mons
olegrok asked this question in Q&A
Discussion options

You must be logged in to vote

Metatables on a string (and also numbers and nils) are shared and they implement interface of string module.

tarantool> debug.getmetatable("").__index == require 'string'
---
- true
...

tarantool> debug.getmetatable("a") == debug.getmetatable("b")
---
- true
...

You CAN'T set metatable to anything arbitrary and expect, that everything will continue to work

users can break the console

This manipulation breaks not console but the whole tarantool runtime

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

olegrok
Jan 23, 2020
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

olegrok
Jan 23, 2020
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by igormunkin
Comment options

You must be logged in to vote
0 replies
Comment options

olegrok
Jan 23, 2020
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
wontfix This will not be worked on question Further information is requested luajit misuse Issues related to LuaJIT API misuse (both Lua and Lua C)
4 participants
Converted from issue

This discussion was converted from issue #4742 on December 16, 2020 15:53.