Project

General

Profile

Actions

Cleanup #57938

open

relying on boost flatmap emplace behavior is risky

Added by Yuval Lifshitz over 1 year ago. Updated about 1 year ago.

Status:
Pending Backport
Priority:
Low
Assignee:
-
Target version:
-
% Done:

0%

Tags:
low-hanging-fruit backport_processed
Backport:
pacific quincy reef
Reviewed:
Affected Versions:
Pull request ID:

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 (1 open4 closed)

Copied to rgw - Backport #59025: quincy: relying on boost flatmap emplace behavior is riskyIn ProgressKonstantin 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 1 year ago

I would like to take up this issue.

Actions #3

Updated by Casey Bodley about 1 year ago

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

Updated by Casey Bodley about 1 year ago

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

Updated by Backport Bot about 1 year ago

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

Updated by Backport Bot about 1 year ago

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

Updated by Backport Bot about 1 year ago

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

Updated by Backport Bot about 1 year ago

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

Updated by Backport Bot about 1 year ago

  • Tags changed from low-hanging-fruit to low-hanging-fruit backport_processed
Actions #10

Updated by Backport Bot about 1 year ago

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

Also available in: Atom PDF