In source4/auth/gensec/pygensec.c:py_gensec_start_client, we have this: if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", discard_const_p(char *, kwnames), &py_settings)) where py_settings is optional and therefore should be initialized to NULL. The latter issue causes a crash in settings_from_object during the "if (!PyDict_Check(object))" check because "object", alias "pysettings", is an invalid pointer.