The code which generates the message for the IllegalArgumentException when defining a module with an disallowed package name is not allocating enough resource area space for the message.
Specifically, this code in modules.cpp (http://hg.openjdk.java.net/jdk/jdk/file/d02f1f4ff3a6/src/hotspot/share/classfile/modules.cpp#l338):
size_t pkg_len = strlen(package_name);
char* pkg_name = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, pkg_len);
strncpy(pkg_name, package_name, pkg_len);
StringUtils::replace_no_expand(pkg_name, "/", ".");