-
tarantool --version
Tarantool Enterprise For Mac 2.3.0-331-g4d3b2e684
Target: Darwin-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=ON
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
C_FLAGS: -Wno-unknown-pragmas -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -msse2 -std=c11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts
CXX_FLAGS: -Wno-unknown-pragmas -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -msse2 -std=c++11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts tarantool> x = {}
---
...
tarantool> x.a = 'hello'
---
...
tarantool> debug.setmetatable(x.a, {__call = function() return 'good bye' end})
---
- true
...
tarantool> x.a
LuajitError: builtin/box/console.lua:557: attempt to index local 'buf' (a string value)
fatal error, exiting the event loop |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
This looks very similar to #4154 |
Beta Was this translation helpful? Give feedback.
-
I'm not sure because in #4154 the main problem is manipulation with global system functions/tables that are used in console module. In the current issue I don't affect any system things. All my actions are in "user-space" |
Beta Was this translation helpful? Give feedback.
-
yup, but the symptoms are quite alike. surely I do not close this bug, still investigating |
Beta Was this translation helpful? Give feedback.
-
There is also #4617 It's fact users can break the console with strange manipulations) |
Beta Was this translation helpful? Give feedback.
-
yes, all these bugs are in my todo list |
Beta Was this translation helpful? Give feedback.
-
Metatables on a string (and also numbers and nils) are shared and they implement interface of 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
This manipulation breaks not console but the whole tarantool runtime |
Beta Was this translation helpful? Give feedback.
-
@Mons, thanks a lot for your detailed explanation. In addition to it I can only cite Lua Reference Manual:
Closing with wontfix due to luajit misuse. |
Beta Was this translation helpful? Give feedback.
-
@igormunkin @Mons Thanks! |
Beta Was this translation helpful? Give feedback.
Metatables on a string (and also numbers and nils) are shared and they implement interface of
string
module.You CAN'T set metatable to anything arbitrary and expect, that everything will continue to work
This manipulation breaks not console but the whole tarantool runtime