Thanks for the additional information @JosseVanDelm ! It looks like one of the runtime::Module being exported in your compilation flow doesn’t implement get_symbol correctly. You might take a look at some gdb extensions developed by the community to help you inspect ObjectRef a bit more.
Here’s how i would debug this, though:
-
auto pf_sym = mod.GetFunction("get_symbol");is looking up a PackedFunc inside theruntime::Modulenamedmod. In effect his invokes a C++ functionvoid GetFunction(std::string)on thatModule. -
GetFunctionis expected to return aPackedFuncwhich is placed inpf_sym. -
pf_sym()invokes the PackedFunc, passing 0 arguments (because PackedFunc args are always placed inside a C++TVMArgs argsarray, the PackedFunc call will always have the same C++ signature unless implemented using TypedPackedFunc sugar). - To properly debug this, we need to find out which subclass of
runtime::Moduleis in use here. The easiest way to do that is by inspectingModuleNode::type_key(), which you should be able to do either with logging or from GDB:p mod->type_key(). - From there, locate the
GetFunctionimplementation for thatModule. That function should contain a largeif-elseblock:if (name == "get_const_var") { return PackedFunc([](TVMArgs args, TVMRetValue* rv) { ... }); } else if (name == "get_...") { return PackedFunc([](TVMArgs args, TVMRetValue* rv) { ... }); } ... - The branch which implements
get_symbolprobably is returning a PackedFunc which itself doesn’t return a string. Fix that and I think it should unbreak you.