Project

General

Profile

Bug #20757

rgw: RadosGW leaks memory during Swift Static Website's error handling

Added by Radoslaw Zarzynski 5 months ago. Updated 5 months ago.

Status:
Pending Backport
Priority:
Normal
Target version:
-
Start date:
07/24/2017
Due date:
% Done:

0%

Source:
Q/A
Tags:
Backport:
kraken,jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
Needs Doc:
No

Description

<error>
  <unique>0x3373</unique>
  <tid>1</tid>
  <kind>Leak_DefinitelyLost</kind>
  <xwhat>
    <text>216 bytes in 1 blocks are definitely lost in loss record 47 of 60</text>
    <leakedbytes>216</leakedbytes>
    <leakedblocks>1</leakedblocks>
  </xwhat>
  <stack>
    <frame>
      <ip>0x4C2B0E0</ip>
      <obj>/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so</obj>
      <fn>operator new(unsigned long)</fn>
    </frame>
    <frame>
      <ip>0x3BF557</ip>
      <obj>/usr/bin/radosgw</obj>
      <fn>rgw_build_object_policies(RGWRados*, req_state*, bool)</fn>
    </frame>
    <frame>
      <ip>0x3BF7BC</ip>
      <obj>/usr/bin/radosgw</obj>
      <fn>RGWHandler::do_read_permissions(RGWOp*, bool)</fn>
    </frame>
    <frame>
      <ip>0x3D8C30</ip>
      <obj>/usr/bin/radosgw</obj>
      <fn>rgw_process_authenticated(RGWHandler_REST*, RGWOp*&amp;, RGWRequest*, req_state*, bool)</fn>
    </frame>
    <frame>
      <ip>0x3D9A35</ip>
      <obj>/usr/bin/radosgw</obj>
      <fn>process_request(RGWRados*, RGWREST*, RGWRequest*, std::string const&amp;, rgw::auth::StrategyRegistry const&amp;, RGWRestfulIO*, OpsLogSocket*)</fn>
    </frame>
    <frame>
      <ip>0x2C3C76</ip>
      <obj>/usr/bin/radosgw</obj>
      <fn>RGWCivetWebFrontend::process(mg_connection*)</fn>
    </frame>
...
</error>

RGWSwiftWebsiteHandler::serve_errordoc() calls rgw_process_authenticated(), and thus - indirectly - rgw_build_object_policies(). Unfortunately, the function is not intended to be called twice on same req_state as its object_acl and bucket_acl members are raw pointers, not unique_ptrs and the function doesn't free memory on its own.


Related issues

Copied to rgw - Backport #20816: kraken: rgw: RadosGW leaks memory during Swift Static Website's error handling Rejected
Copied to rgw - Backport #20817: jewel: rgw: RadosGW leaks memory during Swift Static Website's error handling Need More Info

History

#1 Updated by Radoslaw Zarzynski 5 months ago

  • Status changed from New to Need Review

#2 Updated by Yuri Weinstein 5 months ago

Radoslaw Zarzynski wrote:

PR: https://github.com/ceph/ceph/pull/16531.

merged

#3 Updated by Radoslaw Zarzynski 5 months ago

  • Status changed from Need Review to Pending Backport
  • Backport set to kraken,jewel

#4 Updated by Nathan Cutler 5 months ago

  • Copied to Backport #20816: kraken: rgw: RadosGW leaks memory during Swift Static Website's error handling added

#5 Updated by Nathan Cutler 5 months ago

  • Copied to Backport #20817: jewel: rgw: RadosGW leaks memory during Swift Static Website's error handling added

Also available in: Atom PDF