Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg-python: handle NULL ob in ldmud_object_create. #69

Closed
wants to merge 2 commits into from

Conversation

cpu
Copy link
Contributor

@cpu cpu commented Jan 11, 2022

Description

See Mantis bug 902

tests: add startup.py ldmud.Object invocation. - d8f1ef6

It's possible to create a reference to an LPC object from Python using ldmud.Object("...") during startup.py initialization. Crucially this happens before the master object is fully initialized. With LDMud 3.6.4 this early object reference works as expected. With LDMud 3.6.5 it provokes a segfault.

This commit introduces a unit test that can provoke the segfault with 3.6.5 and ensure a subsequent fix doesn't regress.

pkg-python: handle NULL ob in ldmud_object_create. - 3d75c35

If ldmud_object_create is given object_t *ob == NULL it should immediately return NULL instead of calling ref_object(ob, ...), causing a segfault.

This resolves Mantis bug 902.

It's possible to create a reference to an LPC object from Python using
`ldmud.Object("...")` during `startup.py` initialization. Crucially this
happens before the master object is fully initialized. With LDMud 3.6.4
this early object reference works as expected. With LDMud 3.6.5 it
provokes a segfault.

This commit introduces a unit test that can provoke the segfault with
3.6.5 and ensure a subsequent fix doesn't regress.
If `ldmud_object_create` is given `object_t *ob == NULL` it should
immediately return `NULL` instead of calling `ref_object(ob, ...)`,
causing a segfault.
@cpu
Copy link
Contributor Author

cpu commented Jan 11, 2022

Gnomi root-caused this better than I did and landed a fix in amotzkau@d6a7888 🎉

@cpu cpu closed this Jan 11, 2022
@cpu cpu deleted the cpu-3.6.5-pyinit-segfault-fix branch April 25, 2023 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant