Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Example compatability issue #5

Closed
Hexcede opened this issue Jun 7, 2022 · 0 comments
Closed

Example compatability issue #5

Hexcede opened this issue Jun 7, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Hexcede
Copy link
Owner

Hexcede commented Jun 7, 2022

This is an example of how you might word or structure a code compatability issue. You don't have to do it exactly this way but it's helpful. This was a real bug encountered in-dev before the release of v1.1.220607.

Describe the bug
This code causes H6x to hang Roblox.

To Reproduce
When the code runs, sandbox:GenerateActivityReport causes a hang.

This code demonstrates the issue as best as possible and is as small as possible:

local sandbox = H6x.Sandbox.new()
sandbox:ExecuteFunction(function()
	abc = function(a, b)
		return b, a
	end
	b, a = abc({ABC = abc}, 2)
	a.ABC(4, 5)
	a:ABC(8)
end)
sandbox:GenerateActivityReport("h6x") -- Caused by this (commenting this line makes the code work)

Expected behavior
The code runs correctly without hanging.

This code demonstrates the expected behaviour when ran outside of the sandbox (leave unchanged if N/A):

CODE HERE

Version information (please complete the following information):

  • H6x version: v1.1.220607
  • Beta features enabled: All beta features

Additional context
After investigating the issue and debugging it myself, the hang is caused by a table.find call inside of sandbox:GenerateActivityReport(). table.find does regular == comparison, which causes a new log entry to be created before sandbox:GenerateActivityReport() is finished, resulting in the pairs loop on log history to never complete.

@Hexcede Hexcede added the bug Something isn't working label Jun 7, 2022
@Hexcede Hexcede self-assigned this Jun 7, 2022
@Hexcede Hexcede pinned this issue Jun 7, 2022
@Hexcede Hexcede closed this as completed Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant