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

pos_marker_manage.lua:119: attempt to index a nil value #105

Open
Bastrabun opened this issue Dec 5, 2023 · 3 comments
Open

pos_marker_manage.lua:119: attempt to index a nil value #105

Bastrabun opened this issue Dec 5, 2023 · 3 comments
Labels
bug Something isn't working infoneeded Further information is requested

Comments

@Bastrabun
Copy link

Happens when I place WE points via //1 and //2:

2023-11-10 20:23:51: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'worldeditadditions_core' in callback luaentity_Activate(): ...tions/worldeditadditions_core/core/pos_marker_manage.lua:119: attempt to index a nil value
2023-11-10 20:23:51: ERROR[Main]: stack traceback:
2023-11-10 20:23:51: ERROR[Main]: ...tions/worldeditadditions_core/core/pos_marker_manage.lua:119: in function 'next_func'
2023-11-10 20:23:51: ERROR[Main]: ...Additions/worldeditadditions_core/utils/EventEmitter.lua:69: in function 'emit'
2023-11-10 20:23:51: ERROR[Main]: ...ons/worldeditadditions_core/core/entities/pos_marker.lua:48: in function 'func'
2023-11-10 20:23:51: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:101>

For my reference: 5381

@sbrl
Copy link
Owner

sbrl commented Dec 5, 2023

Hello there, @Bastrabun! I can't seem to replicate this issue myself.

Can you find the following information for me please?

  • Minetest version
  • WorldEditAdditions version
  • WorldEdit version

Could you also try:

  • Updating WorldEdit to the latest version
  • Updating WorldEditAdditions to the latest version
  • If you're using ContentDB, could you try installing WorldEdit and WorldEditAdditions via git at all please? See the git section of "Getting started" on the website: https://worldeditadditions.mooncarrot.space/#download

@sbrl sbrl added bug Something isn't working infoneeded Further information is requested labels Dec 9, 2023
@cheapie
Copy link

cheapie commented May 13, 2024

I've been seeing this on occasion on another server as well, seems to happen about once a day and usually a few minutes after the last WE usage.

2024-05-10 20:20:47: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'worldeditadditions_core' in callback luaentity_Activate(): ...tions/worldeditadditions_core/core/pos_marker_manage.lua:119: attempt to index a nil value
2024-05-10 20:20:47: ERROR[Main]: stack traceback:
2024-05-10 20:20:47: ERROR[Main]: 	...tions/worldeditadditions_core/core/pos_marker_manage.lua:119: in function 'next_func'
2024-05-10 20:20:47: ERROR[Main]: 	...Additions/worldeditadditions_core/utils/EventEmitter.lua:69: in function 'emit'
2024-05-10 20:20:47: ERROR[Main]: 	...ons/worldeditadditions_core/core/entities/pos_marker.lua:48: in function 'func'
2024-05-10 20:20:47: ERROR[Main]: 	...e/medic/mt58/bin/../builtin/profiler/instrumentation.lua:108: in function <...e/medic/mt58/bin/../builtin/profiler/instrumentation.lua:101>

This is with WE and WE additions both fully up to date (WE @ 5a00c07 and WE additions @ e89d610) as of this writing.

sbrl added a commit that referenced this issue Aug 18, 2024
@sbrl
Copy link
Owner

sbrl commented Aug 18, 2024

Hmmmmmmmm, very interesting.

So that would suggest

is the root cause. Going by this I would hazard a guess that it's actually line 118 causing the issue here:

position_entities[event.player_name][event.i]

......so that would suggest a race condition between

anchor:emit("update_entity", {
entity = self.object,
id = self.__id,
player_name = self.player_name,
i = self.display_number
})
anchor.set_number(self.object, self.display_number)
emitting the update_entity function and pos_marker_manage's listener to the same event firing.

That shouldn't be possible though, because Lua is single-threaded, and our EventEmitter implementation doesn't use async code, therefore guaranteeing it calls the listeners in order immediately.

In 977dcc6 I have added some additional checks there. I've also added some logging that will log more information if the issue I suspect here happens again. If it does happen again, please do log the output because it will help me track the issue down.

We'll get to the bottom of this one eventually, @Bastrabun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working infoneeded Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants