[PR #2008] [MERGED] Fixed data race in ThreadPoolMan #2300

Closed
opened 2026-03-04 02:04:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2008
Author: @ggtakec
Created: 7/28/2022
Status: Merged
Merged: 7/29/2022
Merged by: @gaul

Base: masterHead: fix_threadman


📝 Commits (1)

  • ab770fb Fixed data race in ThreadPoolMan

📊 Changes

2 files changed (+45 additions, -13 deletions)

View changed files

📝 src/threadpoolman.cpp (+38 -12)
📝 src/threadpoolman.h (+7 -1)

📄 Description

Relevant Issue (if applicable)

n/a

Details

I got the following report with -fsanitize=thread in run_tests_using_sanitizers.sh, so It was fixed.

WARNING: ThreadSanitizer: data race (pid=17275)
  Write of size 1 at 0x7b2400000090 by main thread:
    #0 ThreadPoolMan::StopThreads() /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:176:13 (s3fs+0x58a3e2)
    #1 ThreadPoolMan::~ThreadPoolMan() /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:156:5 (s3fs+0x58a26f)
    #2 ThreadPoolMan::Destroy() /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:52:9 (s3fs+0x589902)
    #3 main /home/ggtakec/work/s3fs-fuse/src/s3fs.cpp:4802:5 (s3fs+0x4bc632)

  Previous read of size 1 at 0x7b2400000090 by thread T5:
    #0 ThreadPoolMan::Worker(void*) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:79:24 (s3fs+0x589bc8)

  Location is heap block of size 144 at 0x7b2400000090 allocated by main thread:
    #0 operator new(unsigned long) <null> (s3fs+0x4b6fbb)
    #1 ThreadPoolMan::Initialize(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:45:32 (s3fs+0x589850)
    #2 main /home/ggtakec/work/s3fs-fuse/src/s3fs.cpp:4734:9 (s3fs+0x4bc091)

  Thread T5 (tid=17281, running) created by main thread at:
    #0 pthread_create <null> (s3fs+0x42a0ab)
    #1 ThreadPoolMan::StartThreads(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:225:27 (s3fs+0x58a197)
    #2 ThreadPoolMan::ThreadPoolMan(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:148:9 (s3fs+0x58a037)
    #3 ThreadPoolMan::Initialize(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:45:36 (s3fs+0x58985f)
    #4 main /home/ggtakec/work/s3fs-fuse/src/s3fs.cpp:4734:9 (s3fs+0x4bc091)

SUMMARY: ThreadSanitizer: data race /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:176:13 in ThreadPoolMan::StopThreads()

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/2008 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 7/28/2022 **Status:** ✅ Merged **Merged:** 7/29/2022 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_threadman` --- ### 📝 Commits (1) - [`ab770fb`](https://github.com/s3fs-fuse/s3fs-fuse/commit/ab770fb92b96eea86b5cb899704bdcb53e81d898) Fixed data race in ThreadPoolMan ### 📊 Changes **2 files changed** (+45 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/threadpoolman.cpp` (+38 -12) 📝 `src/threadpoolman.h` (+7 -1) </details> ### 📄 Description ### Relevant Issue (if applicable) n/a ### Details I got the following report with `-fsanitize=thread` in `run_tests_using_sanitizers.sh`, so It was fixed. ``` WARNING: ThreadSanitizer: data race (pid=17275) Write of size 1 at 0x7b2400000090 by main thread: #0 ThreadPoolMan::StopThreads() /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:176:13 (s3fs+0x58a3e2) #1 ThreadPoolMan::~ThreadPoolMan() /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:156:5 (s3fs+0x58a26f) #2 ThreadPoolMan::Destroy() /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:52:9 (s3fs+0x589902) #3 main /home/ggtakec/work/s3fs-fuse/src/s3fs.cpp:4802:5 (s3fs+0x4bc632) Previous read of size 1 at 0x7b2400000090 by thread T5: #0 ThreadPoolMan::Worker(void*) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:79:24 (s3fs+0x589bc8) Location is heap block of size 144 at 0x7b2400000090 allocated by main thread: #0 operator new(unsigned long) <null> (s3fs+0x4b6fbb) #1 ThreadPoolMan::Initialize(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:45:32 (s3fs+0x589850) #2 main /home/ggtakec/work/s3fs-fuse/src/s3fs.cpp:4734:9 (s3fs+0x4bc091) Thread T5 (tid=17281, running) created by main thread at: #0 pthread_create <null> (s3fs+0x42a0ab) #1 ThreadPoolMan::StartThreads(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:225:27 (s3fs+0x58a197) #2 ThreadPoolMan::ThreadPoolMan(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:148:9 (s3fs+0x58a037) #3 ThreadPoolMan::Initialize(int) /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:45:36 (s3fs+0x58985f) #4 main /home/ggtakec/work/s3fs-fuse/src/s3fs.cpp:4734:9 (s3fs+0x4bc091) SUMMARY: ThreadSanitizer: data race /home/ggtakec/work/s3fs-fuse/src/threadpoolman.cpp:176:13 in ThreadPoolMan::StopThreads() ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:04:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#2300
No description provided.