The culprit functions here are kdb_get_library_name() and its caller krb5_db_setup_lib_handle(). kdb_get_library_name() returns a string pointer or NULL, and if it fails (which should usually only happen on a failure to get the default realm), krb5_db_setup_lib_handle() returns KRB5_KDB_DBTYPE_NOTFOUND with no extended message.