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

Reading from a 2 dimensional array in multiple threads results in values that are not in the array #98171

Open
D0V4HKIIN opened this issue Oct 14, 2024 · 7 comments

Comments

@D0V4HKIIN
Copy link
Contributor

Tested versions

  • Reproducible in: 4.3.stable

System information

Godot v4.3.stable (77dcf97) - Gentoo 2.15 - Wayland - Vulkan (Forward+) - integrated AMD Radeon Graphics (RADV RENOIR) - AMD Ryzen 5 5600U with Radeon Graphics (12 Threads)

Issue description

When reading a 2 dimensional array with multiple threads, some values read are not values that are in the original array.

Steps to reproduce

  1. Create 2 dimensional of at least size 2 (i.e. [[], []])
  2. Create multiple threads
  3. Print values in 2d array
  4. Notice values being printed that are not in the original array.

Minimal reproduction project (MRP)

MRP.zip

@AThousandShips
Copy link
Member

AThousandShips commented Oct 14, 2024

You are looping forever, and it won't print anything in my testing, when fixing the code by removing the infinite loop, then it just prints nothing as intended

When looping a single time or a fixed number of times nothing is printed and everything works as expected

@D0V4HKIIN
Copy link
Contributor Author

Hmm I am not getting this behavior at all. I will come back with a screen recording when I have time.

@AThousandShips
Copy link
Member

Haven't tested in 4.3 but the MRP you provided doesn't do what you are describing, did you actually test with the MRP?

@D0V4HKIIN
Copy link
Contributor Author

Here is the output that I am getting. Also the output changes from time to time (guess depending on what is in memory).

2024-10-14.21-45-40.mp4

@AThousandShips
Copy link
Member

Please show your errors, and please try without the infinite loop

@D0V4HKIIN
Copy link
Contributor Author

Ran the MRP again

Output
image

Errors: 388 times the same error (and once it complaining about icon.svg missing)
image

Debugger:
image

@D0V4HKIIN
Copy link
Contributor Author

Without the infinite loop it doesn't complain and doesn't print anything.

The goal of the infinite loop is to trigger what I believe is some race condition.

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

No branches or pull requests

2 participants