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

Seems the inventory table is not retrieved #40

Open
neko259 opened this issue Jan 13, 2019 · 6 comments
Open

Seems the inventory table is not retrieved #40

neko259 opened this issue Jan 13, 2019 · 6 comments
Labels

Comments

@neko259
Copy link

neko259 commented Jan 13, 2019

I've got a crash on the latest 2 commits: digtron/util.lua:193: bad argument #1 to 'pairs'
Not sure what is the cause.

@FaceDeer
Copy link
Member

A lot of people aren't sure about the cause, including me. :( It seems that minetest api calls that should be returning tables are instead returning "nil", seemingly at random. I've been working under the assumption that this is being caused by low memory conditions; see issue #8067.

I am increasingly at a loss as to what I can do in mod code to compensate for this. Perfectly innocuous function calls are failing here, all over the place. Hopefully in this case the crash didn't cause the Digtron's nodes to become corrupted? As in, when you restarted the server and tried running the Digtron again, it didn't crash again? I added some asserts last night to try guarding against bad data being written to the world's database, that's worse than simply crashing and resuming.

@FaceDeer
Copy link
Member

I've just added a guard against this specific instance of an "impossible" nil table. It'll cause the Digtron to temporarily think it doesn't have fuel, which might interrupt its cycling and require the player to set it moving again but at least won't crash or corrupt anything.

I'm playing whack-a-mole here, Digtron is a big mod with lots of other API calls where this might crop up.

@neko259
Copy link
Author

neko259 commented Jan 13, 2019

I have some additional info around this. After some update the fuel nodes in all my digtrons became broken. If I click on it it shows the formspec with no inventory at all. Removing and placing the node fixed the crash.

@FaceDeer
Copy link
Member

Same symptoms I've been getting reports of for a year now, then, and none of my efforts to guard against it or prevent it are working. If you're using the version of Digtron I submitted last night it should have crashed before it even attempted to write a fuel node that was missing its inventory data. So maybe it's the actual write-to-world step that's failing after all, and not the read-from-world step as I'd been speculating.

This is incredibly frustrating. I'm going to spend some time writing test mods to see if I can reproduce any aspect of these problems.

@FaceDeer
Copy link
Member

Yes. I have finally been able to reproduce this bug locally, or at least one of the symptoms of the various reports I've been seeing. I'm able to get Digtrons to "lose" parts of themselves. I think I may have figured out what particular aspect of my code this is breaking in, too - it's something to do with how Digtrons detect if they're adjacent to unloaded nodes. I think I may be able to fix this in-mod after all.

@numberZero
Copy link
Contributor

numberZero commented Jan 14, 2019

adjacent to unloaded blocks.

Hey, that’s not supposed to work at all. Inventories can’t be created in non-existent blocks. The problem is that MT doesn’t report that properly (it does warn, in some cases at least). See an explanation in minetest/minetest#8067.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants