Project

General

Profile

Actions

Bug #57938

closed

relying on boost flatmap emplace behavior is risky

Added by Yuval Lifshitz over 3 years ago. Updated 8 months ago.

Status:
Resolved
Priority:
Low
Assignee:
-
Target version:
-
% Done:

100%

Source:
Development
Backport:
pacific quincy reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v18.0.0-2943-gf0a3f733cf1
Released In:
v19.2.0~2700
Upkeep Timestamp:
2025-07-12T22:09:05+00:00

Description

see coverity issue: http://folio07.front.sepia.ceph.com/main/ceph-main-98d41855/cov-main-html/3/2253rgw_trim_bilog.cc.html#error
in "BucketTrimWatcher" we emplace a pointer into a boost flatmap without checking whether the operation was successful.
in case of boost flatmap, the ctor is called even if the emplace fails, so the operation does not leak. however, in std::map this is not the case and memory would leak.
see: https://godbolt.org/z/6nzP4T5fb


Related issues 5 (0 open5 closed)

Copied to rgw - Backport #59025: quincy: relying on boost flatmap emplace behavior is riskyResolvedKonstantin ShalyginActions
Copied to rgw - Backport #59026: pacific: relying on boost flatmap emplace behavior is riskyResolvedKonstantin ShalyginActions
Copied to rgw - Backport #59027: pacific: relying on boost flatmap emplace behavior is riskyDuplicateActions
Copied to rgw - Backport #59028: reef: relying on boost flatmap emplace behavior is riskyResolvedActions
Copied to rgw - Backport #59029: reef: relying on boost flatmap emplace behavior is riskyDuplicateActions
Actions #1

Updated by Vedansh Bhartia about 3 years ago

I would like to take up this issue.

Actions #3

Updated by Casey Bodley about 3 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 50346
Actions #4

Updated by Casey Bodley about 3 years ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to pacific quincy reef
Actions #5

Updated by Upkeep Bot about 3 years ago

  • Copied to Backport #59025: quincy: relying on boost flatmap emplace behavior is risky added
Actions #6

Updated by Upkeep Bot about 3 years ago

  • Copied to Backport #59026: pacific: relying on boost flatmap emplace behavior is risky added
Actions #7

Updated by Upkeep Bot about 3 years ago

  • Copied to Backport #59027: pacific: relying on boost flatmap emplace behavior is risky added
Actions #8

Updated by Upkeep Bot about 3 years ago

  • Copied to Backport #59028: reef: relying on boost flatmap emplace behavior is risky added
Actions #10

Updated by Upkeep Bot about 3 years ago

  • Copied to Backport #59029: reef: relying on boost flatmap emplace behavior is risky added
Actions #11

Updated by Konstantin Shalygin over 1 year ago

  • Tracker changed from Cleanup to Bug
  • Status changed from Pending Backport to Resolved
  • % Done changed from 0 to 100
  • Source set to Development
  • Regression set to No
  • Severity set to 3 - minor
Actions #12

Updated by Upkeep Bot 8 months ago

  • Merge Commit set to f0a3f733cf154a533939098a2bce6be4a5515718
  • Fixed In set to v18.0.0-2943-gf0a3f733cf1
  • Released In set to v19.2.0~2700
  • Upkeep Timestamp set to 2025-07-12T22:09:05+00:00
Actions

Also available in: Atom PDF