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

Something causing dataraces? #378

Open
UbuntuJackson opened this issue Aug 4, 2024 · 4 comments
Open

Something causing dataraces? #378

UbuntuJackson opened this issue Aug 4, 2024 · 4 comments

Comments

@UbuntuJackson
Copy link

UbuntuJackson commented Aug 4, 2024

Hello I ran the examplel PGE program that Javid provides (olcExampleProgram.cpp) with a thread sanitizer and got the warnings shown in the screenshot below. I'm not sure if these warnings are substantial. Any thoughts? I'm compiling with cmake .. -DCMAKE_CXX_FLAGS="-ggdb -fsanitize=thread". Using CMake btw.
image

@UbuntuJackson
Copy link
Author

*edited the original post

@Moros1138
Copy link
Collaborator

The First warning

Read of size 1 at Ox7b7c00021le11 by thread T5:
#0 strcmp ../../../../src/libsanitizer/sanitizer common/sanitizer common interceptors.inc:457 (libtsan.so.6+6x672c1)
#1 <null> <null> (radeonsi_dri.so+0x968dc0)
#2 olc::Decal::Update() /home/uj/Desktop/pge/olcPixelGameEngine.h:1718 (UF0+0xb1b7)
#3 olc::Decal: :Decal(olc::Sprite*, bool, bool) /home/uj/Desktop/pge/olcPixelGameEngine.h:1704 (UFO+0xaef8)
#4 std:: MakeUniq<olc::Decal>:: single object std::make unique<olc::Decal, olc::Sprite*, bool&, bool&>(olc::Sprite*&&, bool&, bool&) /usr/include/c++/11/bits/unique ptr.h:962 (UFO+0x2c6a0)

at #1 in the trace is a reference to, and i speculate here, but it looks like an AMD Radeon driver.

The second Warning

Read of size 8 at 0x7b7c00021500 by thread T5:
#0 memcpy ../../../../src/libsanitizer/sanitizer common/sanitizer common interceptors.inc:827 (libtsan.so.6+0x6243e)
#1 memcpy ../../../../src/libsanitizer/sanitizer common/sanitizer common interceptors.inc:819 (libtsan.so.6+6x6243e)
#2 <null> <null> (radeonsi_dri.so+0x9698db)
#3 olc::Decal::Update() /home/uj/Desktop/pge/olcPixelGameEngine.h:1718 (UF0+0xb1b7)
#4 olc::Decal: :Decal(olc::Sprite*, bool, bool) /home/uj/Desktop/pge/olcPixelGameEngine.h:1704 (UFO+0xaef8)

at #2 in the trace is a reference to, again i speculate, what looks like an AMD Radeon driver.

in both warnings, the driver is listed in the trace before any of the PGE functions. i can't say with certainty, but this makes me think that the problem isn't PGE, but the AMD driver. I'll wait for someone else who knows more to weigh in, but that's my take on it.

@UbuntuJackson
Copy link
Author

The First warning

Read of size 1 at Ox7b7c00021le11 by thread T5:
#0 strcmp ../../../../src/libsanitizer/sanitizer common/sanitizer common interceptors.inc:457 (libtsan.so.6+6x672c1)
#1 <null> <null> (radeonsi_dri.so+0x968dc0)
#2 olc::Decal::Update() /home/uj/Desktop/pge/olcPixelGameEngine.h:1718 (UF0+0xb1b7)
#3 olc::Decal: :Decal(olc::Sprite*, bool, bool) /home/uj/Desktop/pge/olcPixelGameEngine.h:1704 (UFO+0xaef8)
#4 std:: MakeUniq<olc::Decal>:: single object std::make unique<olc::Decal, olc::Sprite*, bool&, bool&>(olc::Sprite*&&, bool&, bool&) /usr/include/c++/11/bits/unique ptr.h:962 (UFO+0x2c6a0)

at #1 in the trace is a reference to, and i speculate here, but it looks like an AMD Radeon driver.

The second Warning

Read of size 8 at 0x7b7c00021500 by thread T5:
#0 memcpy ../../../../src/libsanitizer/sanitizer common/sanitizer common interceptors.inc:827 (libtsan.so.6+0x6243e)
#1 memcpy ../../../../src/libsanitizer/sanitizer common/sanitizer common interceptors.inc:819 (libtsan.so.6+6x6243e)
#2 <null> <null> (radeonsi_dri.so+0x9698db)
#3 olc::Decal::Update() /home/uj/Desktop/pge/olcPixelGameEngine.h:1718 (UF0+0xb1b7)
#4 olc::Decal: :Decal(olc::Sprite*, bool, bool) /home/uj/Desktop/pge/olcPixelGameEngine.h:1704 (UFO+0xaef8)

at #2 in the trace is a reference to, again i speculate, what looks like an AMD Radeon driver.

in both warnings, the driver is listed in the trace before any of the PGE functions. i can't say with certainty, but this makes me think that the problem isn't PGE, but the AMD driver. I'll wait for someone else who knows more to weigh in, but that's my take on it.

Hello! Thank you for your response. I am indeed using a radeon AMD driver. There are actually a lot more warnings, these are just the first two.

@Moros1138
Copy link
Collaborator

Moros1138 commented Aug 4, 2024

Hey, you're welcome!

i've never personally done thread sanitizing, but when i used valgrind for memory checks, i had a screen full of memory related problems just from my video driver and the prevailing wisdom at the time, don't know if it has changed, was to ignore them. It was so common that there were specific nvidia "ignore" configurations for valgrind. I wonder if this is a similar situation.

EDIT:

I wonder what happens when you take graphics and the platform out of the equation by adding this to your compiler flags

-DOLC_PLATFORM_HEADLESS -DOLC_GFX_HEADLESS

Full build command

clang++ -O0 -ggdb -fsanitize=thread olcExampleProgram.cpp -o olcExampleProgram -lpthread -lstdc++fs -lpng -DOLC_PLATFORM_HEADLESS -DOLC_GFX_HEADLESS

and it didn't have any messages at all!, obviously without graphics or a platform it's not gonna create a window or renderer.

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

No branches or pull requests

2 participants