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

Deadlock when calling RTDPerkList.Get() #107

Closed
3 tasks done
naydef opened this issue Apr 1, 2024 · 2 comments
Closed
3 tasks done

Deadlock when calling RTDPerkList.Get() #107

naydef opened this issue Apr 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@naydef
Copy link

naydef commented Apr 1, 2024

Bug description

L 04/01/2024 - 17:02:08: [SM] Exception reported: Not enough space on the stack
L 04/01/2024 - 17:02:08: [SM] Blaming: chaos_machine.smx
L 04/01/2024 - 17:02:08: [SM] Call stack trace:
L 04/01/2024 - 17:02:08: [SM] [1] Line 744, C:\TF2SERVER\steamapps\common\Team Fortress 2 Dedicated Server\tf\addons\sourcemod\scripting\NEC\chaos_machine.sp::RTDPerkList.Get
L 04/01/2024 - 17:03:39: [SM] [33] Line 587, rtd2::RTDPerkList.Get
L 04/01/2024 - 17:03:39: [SM] [34] Line 587, rtd2::RTDPerkList.Get
L 04/01/2024 - 17:03:39: [SM] [35] Line 587, rtd2::RTDPerkList.Get
L 04/01/2024 - 17:03:39: [SM] [36] Line 587, rtd2::RTDPerkList.Get
L 04/01/2024 - 17:03:39: [SM] [37] Line 587, rtd2::RTDPerkList.Get
L 04/01/2024 - 17:03:39: [SM] [38] Line 587, rtd2::RTDPerkList.Get
L 04/01/2024 - 17:03:39: [SM] [39] Line 587, rtd2::RTDPerkList.Get
...

Report checks

The stack trace below is of older version of the plugin, but I guess the issue still occurs depending on circumstances. We're using SM 1.11 some build. It seems the compiler has different behavior depending on version. Basically the methodmap RTDPerkList has a method called Get(), while at the same time deriving from ArrayList which also has a method called Get(). For some reason when the method tries to call ArrayList.Get(), it instead calls RTDPerkList.Get thus resulting in a deadlock.

I can guess the same issue will occur if we use latest RTD plugin with this SM compiler, so I guess the code should be more explicit when calling the Get method:

public RTDPerk Get(int i){
-		return view_as<RTDPerk>(this.Get(i));
+		return view_as<RTDPerk>(view_as<ArrayList>(this).Get(i));
	}

Required

  • The bug does not have an open issue.
  • I have described the bug.
  • I mentioned whether the bug is sporadic or systematic.
@naydef naydef added the bug Something isn't working label Apr 1, 2024
@Phil25
Copy link
Owner

Phil25 commented Apr 2, 2024

Thanks for letting me know, this issue has been fixed inside the plugin some time ago, but I forgot the part about the include file. I'll get on it soon-ish (this week?).

In the meantime, since it's a header file, correcting that line yourself should work fine.

@Phil25
Copy link
Owner

Phil25 commented May 1, 2024

Fixed in 2.5.5.

@Phil25 Phil25 closed this as completed May 1, 2024
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