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

[BUG] Some clients hard-crash with this addon installed due to a "Model not found" error, with a model this addon doesnt even have #54

Closed
marchc1 opened this issue Mar 15, 2024 · 6 comments · Fixed by #53, #55 or #56
Assignees
Labels

Comments

@marchc1
Copy link

marchc1 commented Mar 15, 2024

Describe the bug
Garry's Mod clients on x86-64 seem to immediately hard-crash with this addon installed on the server. It is inconsistent (I do not get this issue, but other friends do, despite the fact they use x86-64). It complains about not being able to load a model that this addon doesnt even have, but then fails to load error.mdl immediately after.

I have an issue on the Garry's Mod issue tracker for it: Facepunch/garrysmod-issues#5798
I'll be updating that as I get more info, I don't have solid reproduction steps at the moment.

I isolated it to this addon by having one of the friends affected

  • Join with the addon installed on the server
  • Still crash
  • Join with the addon uninstalled with no other changes immediately after
  • No longer crash
@marchc1 marchc1 added the bug label Mar 15, 2024
@marchc1 marchc1 changed the title [BUG] [BUG] Some clients hard-crash with this addon installed due to a "Model not found" error, with a model this addon doesnt even have Mar 15, 2024
@marchc1
Copy link
Author

marchc1 commented Mar 16, 2024

Forgot to put this here too:

Executable: C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\bin\win64\gmod.exe

-Lua Stack Traces-
==================
  Client
    0. SetModel - [C]:-1
      1. MakeEntityNone - lua/trackassembly/trackasmlib.lua:2103
        2. GetTransformOA - lua/trackassembly/trackasmlib.lua:2199
          3. RegisterPOA - lua/trackassembly/trackasmlib.lua:2236
            4. (null) - lua/autorun/trackassembly_init.lua:1686
              5. pcall - [C]:-1
                6. Record - lua/trackassembly/trackasmlib.lua:2964
                  7. ImportDSV - lua/trackassembly/trackasmlib.lua:3507
                    8. ProcessDSV - lua/trackassembly/trackasmlib.lua:3771
                      9. (null) - lua/weapons/gmod_tool/stools/trackassembly.lua:95
                        10. include - [C]:-1
                          11. (null) - gamemodes/sandbox/entities/weapons/gmod_tool/stool.lua:154
                            12. include - [C]:-1
                              13. (null) - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:372
                                14. include - [C]:-1
                                  15. (null) - gamemodes/sandbox/entities/weapons/gmod_tool/cl_init.lua:11

  Server
    Lua Interface = NULL

  MenuSystem
	*Not in Lua call OR Lua has panicked*

@Grocel
Copy link

Grocel commented Mar 16, 2024

I suspect the the tools spawns every model it knows as an entity (class: prop_physics as from ENTITY_DEFCLASS) to calculate and cache the coordinates for attachments and bones. If true this would be a very bad design that fills up the model cache or slots in the model cache string table. Avoid using dummy entities.

It likely has other side effects too. One case I have observed that the dummy entities also appear in save games, because eNone.DoNotDuplicate = true is missing.

The code linked below, suggest it could indeed the case:
https://github.com/dvdvideo1234/TrackAssemblyTool/blob/master/lua/trackassembly/trackasmlib.lua#L2085C1-L2105C4

@marchc1
Copy link
Author

marchc1 commented Mar 16, 2024

I finally have a way to replicate this:

  • Place the contents of this ZIP into your data folder.
    trackassembly_broken.zip
  • Start the game on the x86-64 beta
  • Join a server/start a game with Track Assembly installed
  • Crash

@Grocel
Copy link

Grocel commented Mar 16, 2024

In the other issue (Facepunch/garrysmod-issues#5798) the problem has been isolated to be caused from a call like this on x86-64:
ents.CreateClientProp("models/some/invalid/model.mdl")

Maybe add a cached file.Exist based model check to the entity dummy function, or redesign the tool to not relay on dummy entities, cached model or cached attachments.

@dvdvideo1234
Copy link
Owner

@marchc1

Please try the Ghosts control dev branch:
https://github.com/dvdvideo1234/TrackAssemblyTool/tree/ghost-cnt

And tell me if it fixed the problem.

@dvdvideo1234
Copy link
Owner

Confirmed in Discord being fixed from @marchc1

3c39afa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment