[PR #1948] [CLOSED] fix for segfault while reseting handle for retrying #2268

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1948
Author: @nkkashyap
Created: 5/23/2022
Status: Closed

Base: masterHead: nkashyap


📝 Commits (1)

  • ebe4e72 fix for segfault while resting handle for retrying

📊 Changes

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

View changed files

📝 src/curl_util.cpp (+1 -0)

📄 Description

Signed-off-by: Neeraj Kumar Kashyap nkashyap@in.ibm.com

Relevant Issue (if applicable)

s3fs is terminating with Segmentation fault
The issue is occurring with s3fs release v1.91

Details

Please describe the details of PullRequest.
In one situation, with ibm_iam_auth option s3fs tries to re-connect private.iam.cloud.ibm.com and getting NSS error -5938 (PR_END_OF_FILE_ERROR). To handle this, s3fs resets the handle by calling RemakeHandle which in-turn calls curl_slist_remove to remove the key Authorization and finally hitting with SIGSEGV.

Found bundle for host private.iam.cloud.ibm.com: 0x7f0f6e1cd410
Connection 22 seems to be dead!
Closing connection 22 
About to connect() to private.iam.cloud.ibm.com port 443 (#23)
    Trying 166.9.251.2... 
    
Connected to private.iam.cloud.ibm.com (166.9.251.2) port 443 (#23)
NSS error -5938 (PR_END_OF_FILE_ERROR)
Encountered end of file
Closing connection 23 
curl.cpp:RequestPerform(2450): ### CURLE_SSL_CONNECT_ERROR  
kernel: s3fs[54514]: segfault at 8 ip 0000000000457e61 sp 00007f0f827f1e50 error 4 in s3fs[400000+bb000]

The code change in this PR provides the fix for the issue by terminating the for loop in curl_slist_remove once the key is removed from requestHeaders.


🔄 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/1948 **Author:** [@nkkashyap](https://github.com/nkkashyap) **Created:** 5/23/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `nkashyap` --- ### 📝 Commits (1) - [`ebe4e72`](https://github.com/s3fs-fuse/s3fs-fuse/commit/ebe4e72c7a2c66123a72a7ca1a21186fdf8fa850) fix for segfault while resting handle for retrying ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/curl_util.cpp` (+1 -0) </details> ### 📄 Description Signed-off-by: Neeraj Kumar Kashyap <nkashyap@in.ibm.com> ### Relevant Issue (if applicable) s3fs is terminating with Segmentation fault The issue is occurring with s3fs release v1.91 ### Details _Please describe the details of PullRequest._ In one situation, with `ibm_iam_auth` option `s3fs` tries to re-connect `private.iam.cloud.ibm.com` and getting `NSS error -5938 (PR_END_OF_FILE_ERROR)`. To handle this, `s3fs` resets the handle by calling `RemakeHandle` which in-turn calls `curl_slist_remove` to remove the key `Authorization` and finally hitting with `SIGSEGV`. ``` Found bundle for host private.iam.cloud.ibm.com: 0x7f0f6e1cd410 Connection 22 seems to be dead! Closing connection 22 About to connect() to private.iam.cloud.ibm.com port 443 (#23) Trying 166.9.251.2... Connected to private.iam.cloud.ibm.com (166.9.251.2) port 443 (#23) NSS error -5938 (PR_END_OF_FILE_ERROR) Encountered end of file Closing connection 23 curl.cpp:RequestPerform(2450): ### CURLE_SSL_CONNECT_ERROR kernel: s3fs[54514]: segfault at 8 ip 0000000000457e61 sp 00007f0f827f1e50 error 4 in s3fs[400000+bb000] ``` The code change in this PR provides the fix for the issue by terminating the `for loop` in `curl_slist_remove` once the key is removed from `requestHeaders`. --- <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:39 +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#2268
No description provided.