[PR #697] [MERGED] Fixing race condition in FdEntity::GetStats #1610

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/697
Author: @pwulff
Created: 12/13/2017
Status: Merged
Merged: 12/17/2017
Merged by: @ggtakec

Base: masterHead: master


📝 Commits (2)

  • cea7d44 Fixing race condition in FdEntity::GetStats
  • ee6abea Race condition in FdManager::Rename because no mutex is used.

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 src/fdcache.cpp (+2 -1)

📄 Description

Relevant Issue (if applicable)

After few hours of intensive use I got a crash. See backtrace below. This is due to the fact that the file descriptor can change between the sanity check and the real use of it.

Details

#0 0x00000035f0c325e5 in raise () from /lib64/libc.so.6
#1 0x00000035f0c33dc5 in abort () from /lib64/libc.so.6
#2 0x00000035f0c704f7 in __libc_message () from /lib64/libc.so.6
#3 0x00000035f0c75f3e in malloc_printerr () from /lib64/libc.so.6
#4 0x00000035f0c78d8d in _int_free () from /lib64/libc.so.6
#5 0x00000035f409d565 in std::basic_string<char, std::char_traits, std::allocator >::assign(std::basic_string<char, std::char_traits, std::allocator > const&) () from /usr/lib64/libstdc++.so.6
#6 0x000000000046328f in operator= (this=0x7f2ce8035030) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/basic_string.h:555
#7 FdEntity::UpdateMtime (this=0x7f2ce8035030) at fdcache.cpp:1053
#8 0x000000000041249d in s3fs_flush (path=0x7f2cfc008420 "Removed for security reason", fi=0x7f2d0d7fdd60) at s3fs.cpp:2203
#9 0x0000003dbb00d24c in ?? () from /lib64/libfuse.so.2
#10 0x0000003dbb00d3cf in ?? () from /lib64/libfuse.so.2
#11 0x0000003dbb014de6 in ?? () from /lib64/libfuse.so.2
#12 0x0000003dbb0120ef in ?? () from /lib64/libfuse.so.2
#13 0x00000035f1007aa1 in start_thread () from /lib64/libpthread.so.0
#14 0x00000035f0ce8aad in clone () from /lib64/libc.so.6


🔄 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/697 **Author:** [@pwulff](https://github.com/pwulff) **Created:** 12/13/2017 **Status:** ✅ Merged **Merged:** 12/17/2017 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`cea7d44`](https://github.com/s3fs-fuse/s3fs-fuse/commit/cea7d44717db8e154d1d62187896bc4f0c6a3782) Fixing race condition in FdEntity::GetStats - [`ee6abea`](https://github.com/s3fs-fuse/s3fs-fuse/commit/ee6abea956f71a0085507f44453c1cdea9c708fe) Race condition in FdManager::Rename because no mutex is used. ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache.cpp` (+2 -1) </details> ### 📄 Description ### Relevant Issue (if applicable) After few hours of intensive use I got a crash. See backtrace below. This is due to the fact that the file descriptor can change between the sanity check and the real use of it. ### Details #0 0x00000035f0c325e5 in raise () from /lib64/libc.so.6 #1 0x00000035f0c33dc5 in abort () from /lib64/libc.so.6 #2 0x00000035f0c704f7 in __libc_message () from /lib64/libc.so.6 #3 0x00000035f0c75f3e in malloc_printerr () from /lib64/libc.so.6 #4 0x00000035f0c78d8d in _int_free () from /lib64/libc.so.6 #5 0x00000035f409d565 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib64/libstdc++.so.6 #6 0x000000000046328f in operator= (this=0x7f2ce8035030) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/basic_string.h:555 #7 FdEntity::UpdateMtime (this=0x7f2ce8035030) at fdcache.cpp:1053 #8 0x000000000041249d in s3fs_flush (path=0x7f2cfc008420 "**Removed for security reason**", fi=0x7f2d0d7fdd60) at s3fs.cpp:2203 #9 0x0000003dbb00d24c in ?? () from /lib64/libfuse.so.2 #10 0x0000003dbb00d3cf in ?? () from /lib64/libfuse.so.2 #11 0x0000003dbb014de6 in ?? () from /lib64/libfuse.so.2 #12 0x0000003dbb0120ef in ?? () from /lib64/libfuse.so.2 #13 0x00000035f1007aa1 in start_thread () from /lib64/libpthread.so.0 #14 0x00000035f0ce8aad in clone () from /lib64/libc.so.6 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:01:18 +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#1610
No description provided.