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

attr_group_overheal_uber doesn't work after the update #79

Closed
higps opened this issue Jan 6, 2023 · 16 comments
Closed

attr_group_overheal_uber doesn't work after the update #79

higps opened this issue Jan 6, 2023 · 16 comments
Labels
bug Something isn't working

Comments

@higps
Copy link
Contributor

higps commented Jan 6, 2023

With the latest package as of this post, the attr_group_overheal_uber.smx does nothing when the uber is activated.

Previously it threw errors in the console, but now with the updated game data no error is thrown, it's just that nothing happens. The uber doesn't come out and the AOE heal doesn't happen with no effects being applied.

EDIT:

Initial troubleshooting checklist

  • [x ] The attribute is loaded, or this bug report is about a plugin load failure. (Check sm plugins list on the server.)
  • [x ] The attribute is the most recent revision.

Describe the bug
Removes functionality of Uber when used. But no AOE heal or effects are applied. No errors are thrown

To Reproduce
Apply the attribute to a medigun and deploy uber at 100%

Code used:
TF2CustAttr_SetString(Weapon2,"medigun charge is group overheal", "range=800.0 heal_rate=145.0 overheal_ratio=1.05 overheal_duration_mult=0.25");

This is used on a weapon that we create on the player, not the weapon the player spawns with.

Expected behavior
AOE uber should heal and provide visual effect as well as sound effect like it did previously.

Server environment (please complete the following information):

  • Operating System: Ubuntu
  • SourceMod version: 1.11.0.6923

Additional context
Add any other context about the problem here.

@higps higps added the bug Something isn't working label Jan 6, 2023
@nosoop
Copy link
Owner

nosoop commented Jan 6, 2023

Hi — please update your report with the information specified in the attribute bug report template.

@higps
Copy link
Contributor Author

higps commented Jan 10, 2023

Hi, I have updated the report with the template

@nosoop
Copy link
Owner

nosoop commented Jan 13, 2023

I'm unable to reproduce this with a current build of the plugin.

Make sure that TF2 Utils is up to date; the 2023-01-05 update did change the offset of CTFWeaponBase::GetWeaponID. which the attribute does test for to check if the weapon is a Medi Gun.

@higps
Copy link
Contributor Author

higps commented Jan 15, 2023

I've tested with the latest TF2 utils and the latest from this repository, with the new update it now causes seg fault. Related to the find entitysphere

https://crash.limetech.org/ruj6g6dqqjq6

I'm using the gamedata and version from this repo as well as the latest from the tf2utils and updated the gamedata there as well.

I am on Linux.

EDIT:

Are there any other dependencies needed?

@nosoop
Copy link
Owner

nosoop commented Jan 16, 2023

Are there any other dependencies needed?

TF2 Utils is the only third-party dependency that would require gamedata updates (the attribute framework does not). Excluding this project, of course.

The crash looks like a bad dereference on IEntityFindFilter*, located in eax. The plugin as of d043bc5 should account for this by passing a nullptr to bypass that dereference operation entirely (CServerTools::FindEntityInSphere() does this).

Can you post sm plugins info attr_group_overheal_uber as well as the value of eax from the first stack entry (0, topmost) on this page?

@higps
Copy link
Contributor Author

higps commented Jan 19, 2023

Filename: bmod/mannedmachines/mmattributes/attr_group_overheal_uber.smx
Title: [TF2CA] Medigun Uber: Group Overheal (Description!)
Author: Author!
Version: 0.0.0
URL: localhost
Status: running
Timestamp: 01/05/2023 23:57:34
Hash: 33d2437a901f2df933a3b17ba91f5768

I don't know how to get the eax value from the first stack entry, as I don't know what you mean or what that is.

If it's on the top page then it's eax: 0xffffffff

@higps
Copy link
Contributor Author

higps commented Jan 31, 2023

I also tested this with attribute adapter, and the same crash happens.

@higps
Copy link
Contributor Author

higps commented Feb 2, 2023

Despite running identical plugins and setup, my test server crashes, while on my production servers nothing happens, no crash, very bizzarre, I've tried to isolate by removing other plugins, updating sourcemod but it remains the same

@higps
Copy link
Contributor Author

higps commented Feb 2, 2023

@nosoop When I reverted the function from "CGlobalEntityList::FindEntityInSphere()" to "CGlobalEntityList::FindEntityInSphere" it worked, both in gamedata and plugin. Will changing it back to not use the () affect the other plugins that use this function?

@higps
Copy link
Contributor Author

higps commented Feb 2, 2023

Further testing shows that it now works on my test server, but not in production, but the crashes are gone

@nosoop
Copy link
Owner

nosoop commented Feb 3, 2023

When I reverted the function from "CGlobalEntityList::FindEntityInSphere()" to "CGlobalEntityList::FindEntityInSphere" it worked, both in gamedata and plugin. Will changing it back to not use the () affect the other plugins that use this function?

It never did not have the () suffix, but you'd need to change the other plugins to point to the correct name,

This sounds a lot like the underlying issue causing alliedmodders/sourcemod#1879, but since the SDKCall is being prepared immediately after loading the gamedata, it shouldn't be pulling anything else. Perhaps you're referencing the name in other gamedata files?

@higps
Copy link
Contributor Author

higps commented Feb 3, 2023

When I reverted the function from "CGlobalEntityList::FindEntityInSphere()" to "CGlobalEntityList::FindEntityInSphere" it worked, both in gamedata and plugin. Will changing it back to not use the () affect the other plugins that use this function?

It never did not have the () suffix, but you'd need to change the other plugins to point to the correct name,

This sounds a lot like the underlying issue causing alliedmodders/sourcemod#1879, but since the SDKCall is being prepared immediately after loading the gamedata, it shouldn't be pulling anything else. Perhaps you're referencing the name in other gamedata files?

When chainging ti not use the ()

It throws this error on every frame:

L 02/03/2023 - 16:43:09: [SM] Exception reported: Invalid Handle 0 (error 4)
L 02/03/2023 - 16:43:09: [SM] Blaming: balancemod-dependencies/customattributes/attr_group_overheal_uber.smx
L 02/03/2023 - 16:43:09: [SM] Call stack trace:
L 02/03/2023 - 16:43:09: [SM] [0] SDKCall
L 02/03/2023 - 16:43:09: [SM] [1] Line 277, d:\Github\SM-TFCustomAttributeStarterPack\scripting\attr_group_overheal_uber.sp::FindEntityInSphere
L 02/03/2023 - 16:43:09: [SM] [2] Line 165, d:\Github\SM-TFCustomAttributeStarterPack\scripting\attr_group_overheal_uber.sp::OnPlayerPostThinkPost

But it still works as before as far as I can tell from my testing

@nosoop
Copy link
Owner

nosoop commented Feb 10, 2023

That error indicates that it shouldn't work at all (really, it should fail to load completely, but doesn't due to missing checks similar to #31). I've rechecked and still am unable to reproduce this in my environment.

Here's a few more things to check:

  • grep through your production server's gamedata for instances of CGlobalEntityList::FindEntityInSphere() and @_ZN17CGlobalEntityList18FindEntityInSphereEP11CBaseEntityRK6Vectorf (the signature from before the update).
  • Use smx_strings.py to inspect your plugins for instances of CGlobalEntityList::FindEntityInSphere().

If eax was reported under the line 0: server_srv.so!CGlobalEntityList::FindEntityInSphere(CBaseEntity*, Vector const&, float, IEntityFindFilter*) + 0x13d, then that is what I'm looking for. That would mean the value -1 is being passed as the IEntityFindFilter*, which the plugin should not be doing as of d043bc5 — it should be passing 0.

@nosoop
Copy link
Owner

nosoop commented Feb 10, 2023

If you'd like to try a refactored version that switches out the PostThink hook for OnGameFrame, you can build this.

Could potentially be a bad DHooks interaction from another plugin; I've seen plenty of inexplicable crashes stemming from those.

@higps
Copy link
Contributor Author

higps commented Feb 22, 2023

The build you shared in the above post solved it , it now works when I had the correct gamedata with tf2utils updated.

@nosoop
Copy link
Owner

nosoop commented Feb 23, 2023

It sounds like something is blocking execution of PostThink or its post-handler, like in the case of Drifter321/DHooks2#2. You may want to confirm that is or isn't the case.

It's probably worth migrating away from PostThink hooks due to alliedmodders/sourcemod#1935 in any case.

@nosoop nosoop closed this as completed in 5f4b08d Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants