[PR #1092] [MERGED] fix coredump caused by fd_manager_lock locking #1806

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1092
Author: @liuyongqing
Created: 7/13/2019
Status: Merged
Merged: 7/14/2019
Merged by: @ggtakec

Base: masterHead: master


📝 Commits (1)

  • 4e351c5 fix coredump caused by fd_manager_lock locking

📊 Changes

1 file changed (+44 additions, -45 deletions)

View changed files

📝 src/fdcache.cpp (+44 -45)

📄 Description

https://github.com/s3fs-fuse/s3fs-fuse/issues/1091

Details

FdManager::Open function should hold FdManager::fd_manager_lock until the function execute finished.

In the current master version of s3fs,FdManager::Open hold FdManager::fd_manager_lock in a pair of bracket, and call FdEntity::Open without FdManager::fd_manager_lock lock, this will cause coredump in multithreading, details are as follows:

  1. thread A call FdManager::Open and create a FdEntity
  2. thread B call FdManager::Open and get the FdEntity and trying to call ent->Open without hold FdManager::fd_manager_lock
  3. thread A call FdManager::Close and delete the FdEntity
  4. thread B continue function FdEntity::Open execute and crashed happened due to "double free or corruption (out)"

🔄 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/1092 **Author:** [@liuyongqing](https://github.com/liuyongqing) **Created:** 7/13/2019 **Status:** ✅ Merged **Merged:** 7/14/2019 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`4e351c5`](https://github.com/s3fs-fuse/s3fs-fuse/commit/4e351c59e3cdc49565ed51067c98bc10cb2497a9) fix coredump caused by fd_manager_lock locking ### 📊 Changes **1 file changed** (+44 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache.cpp` (+44 -45) </details> ### 📄 Description ### issue link https://github.com/s3fs-fuse/s3fs-fuse/issues/1091 ### Details FdManager::Open function should hold FdManager::fd_manager_lock until the function execute finished. In the current master version of s3fs,FdManager::Open hold FdManager::fd_manager_lock in a pair of bracket, and call FdEntity::Open without FdManager::fd_manager_lock lock, this will cause coredump in multithreading, details are as follows: 1. thread A call FdManager::Open and create a FdEntity 2. thread B call FdManager::Open and get the FdEntity and trying to call ent->Open without hold FdManager::fd_manager_lock 3. thread A call FdManager::Close and delete the FdEntity 4. thread B continue function FdEntity::Open execute and crashed happened due to "double free or corruption (out)" --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:02:15 +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#1806
No description provided.