Hi! Thanks for the patch! See 5 comments below.
Done.1. Instead of duplicating commit title, it is usually better to describe here a reason why the bug existed.
Sorry.2. Please, put branch and issue links after '---'.---
diff --git a/src/box/box.cc b/src/box/box.cc index 8892d0f0e..6494a0f44 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -2053,6 +2053,9 @@ box_init(void) */ session_init(); + if (module_init() != 0) + diag_raise(); + if (tuple_init(lua_hash) != 0) diag_raise(); @@ -2080,8 +2083,6 @@ box_cfg_xc(void) gc_init(); engine_init(); - if (module_init() != 0) - diag_raise(); schema_init(); replication_init(); port_init();4. Instead of checking for modules != NULL in each public func.h function, it is better to move module_init() call from box_cfg_xc() to box_init(). Then main() will create modules hash.
5. Not-tap tests are always run with already called box.cfg(), so these lines here will work regardless of your patch. Please, move it to a tap test, in app-tap directory. Now I do not see there any existing and suitable file for this test, so you should create a new one. For example, app-tap/func.test.lua.