{"action":"opened","issue":{"url":"https://api.github.com/repos/minetest/minetest/issues/7576","repository_url":"https://api.github.com/repos/minetest/minetest","labels_url":"https://api.github.com/repos/minetest/minetest/issues/7576/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/7576/comments","events_url":"https://api.github.com/repos/minetest/minetest/issues/7576/events","html_url":"https://github.com/minetest/minetest/issues/7576","id":343351371,"node_id":"MDU6SXNzdWUzNDMzNTEzNzE=","number":7576,"title":"Lua functions have poor argument checking.","user":{"login":"beyondlimits","id":7702857,"node_id":"MDQ6VXNlcjc3MDI4NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/7702857?v=4","gravatar_id":"","url":"https://api.github.com/users/beyondlimits","html_url":"https://github.com/beyondlimits","followers_url":"https://api.github.com/users/beyondlimits/followers","following_url":"https://api.github.com/users/beyondlimits/following{/other_user}","gists_url":"https://api.github.com/users/beyondlimits/gists{/gist_id}","starred_url":"https://api.github.com/users/beyondlimits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beyondlimits/subscriptions","organizations_url":"https://api.github.com/users/beyondlimits/orgs","repos_url":"https://api.github.com/users/beyondlimits/repos","events_url":"https://api.github.com/users/beyondlimits/events{/privacy}","received_events_url":"https://api.github.com/users/beyondlimits/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-21T19:52:24Z","updated_at":"2018-07-21T19:52:24Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"##### Issue type\r\n<!-- Pick one below and delete others -->\r\n - Bug report\r\n \r\n##### Minetest version\r\n```\r\nMinetest 5.0.0-dev-25cc5d1a (Linux)\r\n```\r\n\r\n##### OS / Hardware\r\n<!-- General information about your hardware and operating system -->\r\nOperating system: Ubuntu 16.04.4\r\nCPU: Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz\r\n\r\n##### Summary\r\n<!-- Describe your problem here -->\r\nA whole lot of functions/methods provided from C++ to Lua do not have proper argument checking. When such functions are called with invalid arguments, Minetest freezes in gray screen or crashes instead of shutting down game with error message. This happens even when call is done inside `pcall`.\r\n\r\n```\r\n-- Gray screen\r\nminetest.add_entity()\r\nminetest.add_item()\r\nminetest.add_node()\r\nminetest.add_node_level()\r\nminetest.add_particle(1,2)\r\nminetest.add_particlespawner(1,2)\r\nminetest.check_single_for_falling()\r\nminetest.clear_craft({})\r\nminetest.create_schematic('',{},{},'')\r\nminetest.delete_area()\r\nminetest.dig_node()\r\n-- cut here - gave up checking all of them\r\nminetest.show_formspec(name, 'test', 'list[inventory_location;list_name;0,0;8,8;]')\r\n-- cut here as well\r\n\r\n-- Crash (engine assumption failed)\r\nminetest.set_timeofday(2)\r\n\r\n-- Crash (segmentation fault)\r\nplayer:get_inventory():set_lists()\r\n```\r\n\r\n##### Steps to reproduce\r\n1. Pick a random function/method that's provided from C++ to Lua.\r\n2. Call it with unusual arguments, trying to crash Minetest.\r\n3. If it didn't crash, go to point 1."}}
{"actor":{"display_login":"beyondlimits"}}