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

fix: avoid corruption after using test_load #1063

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hluaces
Copy link

@hluaces hluaces commented Apr 28, 2024

When using test_load on a loaded object the object list ends up corrupted. The details are obscure, but doing this reproduces the error:

  1. Load any object in memory. Check that both find_object() and children() return the single existing object
  2. Run test_load on the object. At this point find_object() will probably return 0 (sometimes it doesn't)
  3. Destroy and use load_object() again. children() will now return an array with two duplicates of the same object or, sometimes, a 0 and the existing copy of the object

In some instances i've seen different objects returned by children() than the one being passed as path (this usually happened with clones).

This PR tries to work around it. I've also reverted #843 because I believe this PR fixes the underlying cause for the issue, not just the symptom.

All credit goes to Zoilder (one of the developers on our mud) that happened to fix this a long time ago. We're just sending these fixes upstream since we're starting to update our outdated driver.

Please let me know if there's anything I should change in the PR. I've tried to add a proper test for this, but I don't know if that's the location you're expecting for it.

@hluaces hluaces changed the title hluaces/fix/test load not working fix: avoid corruption after using test_load Apr 28, 2024
@@ -0,0 +1,2 @@
void create() {
Copy link
Author

@hluaces hluaces Apr 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test does nothing on its own, but I need a different object I can load/destroy from the 1063.c file.

When using `test_load` on a loaded object the object list ends up
corrupted. The details are obscure, but if doing this reproduces the
error:

1. Load any object in memory. Check that both `find_object` and
   `children()` return the single existing object
2. Run `test_load` on the object. Check that `find_object` returns `0`
3. Destroy and create the object. `children()` will now return an array
   with two duplicates of the same object or, sometimes, a `0` and the
   existing copy of the object

In some instances i've seen different objects returned by `children()`
than the one being passed as path (this usually happened with clones).

This PR tries to work around it. I've also reverted fluffos#843 because I
believe this PR fixes the underlying cause for the issue, not just the
symptom.

All credit goes to Zoilder (one of the developers on our mud) that
happened to fix this a long time ago. We're just sending these fixes
upstream since we're starting to update our outdated driver.

Please let me know if there's anything I should fix. I've tried to add a
proper test for this, but I don't know if that's the location you're
expecting for it.
@hluaces hluaces force-pushed the hluaces/fix/test-load-not-working branch from ad8b83e to b14001c Compare April 28, 2024 20:41
@hluaces hluaces marked this pull request as ready for review April 28, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant