Facepunch / garrysmod-issues

Garry's Mod issue tracker
147 stars 56 forks source link

GetLuaTable != Table #2047

Closed ghost closed 8 years ago

ghost commented 9 years ago

Occasionally when joining any servers (vanilla included), Garry's Mod crashes displaying a dialog with the title "Engine error" and the contents of it being "GetLuaTable != Table". Happens shortly after clicking "connect". This issue persists with all addons disabled as well.

Screenshot: http://puu.sh/i7hNx/8af5645d85.png

thegrb93 commented 9 years ago

Never seen this. Dev branch? OS?

TheFreeman193 commented 9 years ago

I've seen this issue before, but a long time ago. IIRC, verifying your game cache generally fixed it.

ghost commented 9 years ago

Happened in dev branch and non-dev branch. Running Windows 8.1 Intel i7 Quad-Core, Sandy Bridge 8GB DDR3 AMD Radeon HD 6770M Series, 512mb

robotboy655 commented 9 years ago

Have you tried the obvious - verifying the game? I have never seen this error before.

ghost commented 9 years ago

Yes, I have tried that.

ghost commented 9 years ago

It happens rarely, but it nonetheless happens on occasion.

robotboy655 commented 9 years ago

Looking at the code, it is most likely that something on your server or client overrides Entity:GetTable() to be not a table. Go figure it out.

ghost commented 9 years ago

?? But I've encountered this crash on many different servers (as well as some vanilla local games). Some of these servers had addons, some didn't, but it happens with addons disabled. I have verified the game and reinstalled in the past.

robotboy655 commented 9 years ago

I have NEVER had seen this error happen to me, or even saw it anywhere else until now. It is 90% that it is caused by custom Lua, as it always is with people reporting crazy issues. ( Including you AFAIK. No offense, but I am getting sick of it )

KR4N1X commented 9 years ago

Happens to about 20% of my players on TTT when I force map to the same current map. Is a shitty bug but not worth spending the time trying to find out why.

ghost commented 9 years ago

There you go, bug confirmed. So quick to dismiss.

willox commented 9 years ago

I had it happen to somebody connected to my extremely-vanilla Sandbox listen server yesterday. I don't think it's any specific addon if we're all getting the issue.

mcd1992 commented 9 years ago

It happens to me almost every day on my dev server. Client & Server on same machine, Windows 7 64 and dev branch of gmod. It happens to me after using auto-refresh a lot (just changing files and letting them reload) and then doing a changelevel to the same map. It happens to only my windows client, the linux client can handle the changelevel just fine.

Before the crash the client has an error about setmetatable. I'll try to drop a Lua stacktrace and crash dump next time it happens here.

robotboy655 commented 9 years ago

Crash dump is worthless for the most part. I know where it crashes. The problem is why does the Entity:GetTable() becomes not a table.

In dev branch, can you post the exact error message? I added "Type: " to it.

mcd1992 commented 9 years ago
[mcd1992|3|STEAM_0:1:15542171] Lua Error:

[ERROR] stack overflow
  1. GetTable - [C]:-1
   2. __index - lua/includes/extensions/entity.lua:23
    3. __index - lua/includes/extensions/entity.lua:25
     4. __index - lua/includes/extensions/entity.lua:25
      5. __index - lua/includes/extensions/entity.lua:25
       6. __index - lua/includes/extensions/entity.lua:25
        7. __index - lua/includes/extensions/entity.lua:25
         8. __index - lua/includes/extensions/entity.lua:25
          9. __index - lua/includes/extensions/entity.lua:25
           10. __index - lua/includes/extensions/entity.lua:25
            11. __index - lua/includes/extensions/entity.lua:25
             12. __index - lua/includes/extensions/entity.lua:25
              13. __index - lua/includes/extensions/entity.lua:25
               14. __index - lua/includes/extensions/entity.lua:25
                15. __index - lua/includes/extensions/entity.lua:25
                 16. __index - lua/includes/extensions/entity.lua:25

Engine Error: GetLuaTable != TABLE! Type is: 3

Also after the client crashes once the issue goes away until more auto-refreshes.

willox commented 9 years ago

You you use the save system or duplicator at all?

mcd1992 commented 9 years ago

Nope this was an empty server, never loaded a save or pasted a dupe.

robotboy655 commented 9 years ago

Apparently the tables becomes a number? Let me know if the number changes to anything else.

willox commented 9 years ago

Anything (especially 3rd party modules) that change console variables installed?

mcd1992 commented 9 years ago

No custom modules on server, client has the menustate lua viewer modules / code installed and that's all. This issue has happened prior to the installation of that though.

ghost commented 9 years ago

This does happen on vanilla servers with vanilla clients for me, and it seems it happens to others too. No custom modules, as both are vanilla.

mcd1992 commented 9 years ago

@imp0se has it happened to you while using auto-refresh? As in have you edited lua files while the server is running? The triggers I seem to have it narrowed down to is using autorefresh and having the server up for a long time, then doing a changelevel.

ghost commented 9 years ago

I wouldn't know if it happens during autorefresh, but I know it does mostly happen to me after a changelevel/reconnect or just a reconnect.

mcd1992 commented 9 years ago

How long would you say your / the server has been up for when it happens to clients. And does it only happen to you after you've played on the server for a while or has it happened when you first join a server?

ghost commented 9 years ago

When it happens can vary. Sometimes it happens on first join, sometimes it happens if I played on it for a while. The server could've been up for a while, but this happens on other servers too. Can't be sure, it's very random.

mcd1992 commented 9 years ago

Hrm, well that at least tells me its not auto-refresh.

mcd1992 commented 9 years ago

Just got a new engine error after a changelevel.

"Pushing stack pos that doesn't exist!"

No other info.

robotboy655 commented 9 years ago

So, stack corruption?

I will have to check all new functions for any problems then.

mcd1992 commented 9 years ago

If I had to guess. Still not sure where it could be happening though.

mcd1992 commented 9 years ago

For future reference I'm not using the new NWVars anywhere and never using traceline's target table parameter. Which I believe were the two culprits last time for metatable corruption.

robotboy655 commented 9 years ago

I wouldn't say you are not using NWVars, they are used quite often in vanilla.

mcd1992 commented 9 years ago

Another new crash reason, "attempt to index a number value" https://dl.dropboxusercontent.com/u/6124906/Temp/hl2_150720_crash_2015_7_21T23_4_40C0.mdmp

Then another crash that had no Engine Error. https://dl.dropboxusercontent.com/u/6124906/Temp/hl2_150720_crash_2015_7_21T22_54_48C0.mdmp

Both of these occurred after a changelevel.

DBotThePony commented 9 years ago

2015-08-11_09-11 Ha ha ha...

Lua error on shutdown/changemap will cause this

ghost commented 9 years ago

So is this now just a big changelevel crash report thing?

Jcw87 commented 9 years ago

I would like to add my 2 cents to this. Occasionally, when auto-refresh loads one of my scripts, a for loop similar to the following would get a very odd error

for i = 1, count do
    local somevalue = sometable[i+othervalue]
    -- stuff
end

the error looks something like this:

attempt to perform arithmetic on 'i' (a table value)

So, I think auto-refresh is fucking with LuaJIT in a big way. I used to get weird errors in for loops that weren't provoked by auto-refresh, but gmod's LuaJIT was updated since then, and I think that stopped.

P4sca1 commented 8 years ago

Any news on this? I recently got this issue while playing TTT.

ghost commented 8 years ago

Engine Error, Lua panic! Something went horribly wrong! "stack overflow"

This issue occurred on changelevel. Crash dump included: https://db.tt/fsVLjPtZ

JetBoom commented 8 years ago

https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/includes/extensions/entity.lua#L25

Shouldn't it be pretty obvious why it's doing this? It's using tab[] which calls index. index doesn't stop being called just because you're already inside __index. It should be using rawget.