Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Issue 487363003: [NaCl SDK] nacl_io: Fix leak when recv'ing from udp socket. (Closed)

Created:
6 years, 4 months ago by binji
Modified:
6 years, 4 months ago
Reviewers:
noelallen1, yzshen1
CC:
chromium-reviews, binji+watch_chromium.org, Sam Clegg
Project:
chromium
Visibility:
Public.

Description

[NaCl SDK] nacl_io: Fix leak when recv'ing from udp socket. Packet::Copy AddRefs the address resource returned from PPB_UDPSocket::RecvFrom. But the convention is that when returning a new resource, the resource will already have a refcount of 1. So the resource has an leaked reference and will never be destroyed. This memory leak cannot be detected from untrusted code (I overrode mmap/mmunmap, but was unable to find it), but can be seen from the Chrome task manager. See user report here: https://groups.google.com/d/msg/native-client-discuss/fEc6v7_wjkI/lnFNO09yw9kJ BUG=none R=noelallen@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=290691

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -0 lines) Patch
M native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc View 1 chunk +1 line, -0 lines 3 comments Download

Messages

Total messages: 5 (0 generated)
binji
6 years, 4 months ago (2014-08-19 18:22:18 UTC) #1
yzshen1
https://codereview.chromium.org/487363003/diff/1/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc File native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc (right): https://codereview.chromium.org/487363003/diff/1/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc#newcode137 native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc:137: filesystem()->ppapi()->ReleaseResource(addr_); drive-by: Maybe we could consider "safer" ref-counting. - ...
6 years, 4 months ago (2014-08-19 18:37:29 UTC) #2
noelallen1
LGTM In theory you could release it in the virtual destructor, but this has the ...
6 years, 4 months ago (2014-08-19 20:46:59 UTC) #3
yzshen1
(No need to wait for my LG.) https://codereview.chromium.org/487363003/diff/1/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc File native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc (right): https://codereview.chromium.org/487363003/diff/1/native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc#newcode137 native_client_sdk/src/libraries/nacl_io/socket/udp_node.cc:137: filesystem()->ppapi()->ReleaseResource(addr_); On ...
6 years, 4 months ago (2014-08-19 20:53:16 UTC) #4
binji
6 years, 4 months ago (2014-08-19 23:29:49 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 manually as 290691 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698