tarantool / tarantool

Get your data in RAM. Get compute close to data. Enjoy the performance.
https://www.tarantool.io
Other
3.41k stars 380 forks source link

Segmentation fault if inappropriate function used for trigger #656

Closed pgulutzan closed 9 years ago

pgulutzan commented 9 years ago

I have Ubuntu 12.04 and Tarantool 1.6 pulled from source today.

I execute these requests:

box.cfg{}
box.schema.space.create('T')
box.space.T:create_index('primary',{})
box.space.T:on_replace(os.exit)
box.space.T:replace{1}

The result after 'box.space.T:replace{1}' looks like this:

tarantool> box.space.T:replace{1}
Segmentation fault
Current time: 1418425533
Please file a bug at http://github.com/tarantool/tarantool/issues
Attempting backtrace... Note: since the server has already crashed, 
this may fail as well
#0  0x41e117 in sig_fatal_cb(int)+191
#1  0x7f2fe31cecb0 in ?
#2  0x516f64 in lua_getfield+24
#3  0x4541f7 in box_lua_space_delete(lua_State*, unsigned int)+37
#4  0x446e54 in space_cache_delete(unsigned int)+43
#5  0x4475fa in schema_free()+169
#6  0x420bad in box_free+31
#7  0x41f0e2 in tarantool_free()+47
#8  0x7f2fe1f00901 in ?
2014-12-12 16:05:33.928 [13264] main/101/spawner I> Exiting: master shutdown
Aborted (core dumped)
kostja commented 9 years ago

Peter, please document this (you already did). We could make os.exit work, but overall Tarantool stored procedures code is runing in unprotected environment, you can do whatever you want, including shooting yourself in the foot.