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

Issue 8872065: Pepper: Var keeps invalid var_id if VarTracker release it and there is another reference (Closed)

Created:
9 years ago by Takashi Toyoshima
Modified:
9 years ago
CC:
chromium-reviews, darin-cc_chromium.org
Visibility:
Public.

Description

Reland; Pepper: Var keeps invalid var_id if VarTracker release it and there is another reference When VarTracker remove PP_Var from VarMap, it release its Var object if needed, but never reset var_id stored in Var object. Then, if Var's reference count is not 1, Var continue to exist with invalid var_id until the last reference is released. BUG=87310 TEST=ui_tests, browser_tests, nacl_integration Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114384 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114594

Patch Set 1 #

Total comments: 4

Patch Set 2 : fix pp_var issue and add leak check #

Total comments: 1

Patch Set 3 : another approach to reset var_id on erase #

Total comments: 1

Patch Set 4 : remove void #

Patch Set 5 : rebase #

Patch Set 6 : doesn't use AssignVarID to reset var_id_ #

Patch Set 7 : remove redundant comma #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -0 lines) Patch
M ppapi/shared_impl/var.h View 1 2 3 4 5 6 3 chunks +6 lines, -0 lines 0 comments Download
M ppapi/shared_impl/var_tracker.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Takashi Toyoshima
I'm sorry but I found a bug on StringVar reference counting while I implement straightforward ...
9 years ago (2011-12-09 13:34:35 UTC) #1
dmichael (off chromium)
http://codereview.chromium.org/8872065/diff/1/ppapi/tests/test_websocket.cc File ppapi/tests/test_websocket.cc (right): http://codereview.chromium.org/8872065/diff/1/ppapi/tests/test_websocket.cc#newcode159 ppapi/tests/test_websocket.cc:159: ReleaseVar(url); I agree the ReleaseVar should be here. Are ...
9 years ago (2011-12-09 21:26:05 UTC) #2
Takashi Toyoshima
Only comments now. I investigate it next week. Thanks http://codereview.chromium.org/8872065/diff/1/ppapi/tests/test_websocket.cc File ppapi/tests/test_websocket.cc (right): http://codereview.chromium.org/8872065/diff/1/ppapi/tests/test_websocket.cc#newcode159 ppapi/tests/test_websocket.cc:159: ...
9 years ago (2011-12-10 01:25:52 UTC) #3
Takashi Toyoshima
Without ReturnVar()'s reference increment, VarTracker's NOTREACHED is fired by invalid reference decrement. StringVar and VarTracker ...
9 years ago (2011-12-12 07:48:53 UTC) #4
Takashi Toyoshima
This second CL fixed GetPPVar()'s bug on the second PP_Var instance. But, still StringToPPVar()'s leak ...
9 years ago (2011-12-12 10:17:49 UTC) #5
Takashi Toyoshima
Ah, I see. VarTracker::AddVar handle Var's ownership. So existing code works as I said it ...
9 years ago (2011-12-12 10:29:48 UTC) #6
dmichael (off chromium)
http://codereview.chromium.org/8872065/diff/6001/ppapi/shared_impl/var.cc File ppapi/shared_impl/var.cc (right): http://codereview.chromium.org/8872065/diff/6001/ppapi/shared_impl/var.cc#newcode107 ppapi/shared_impl/var.cc:107: GetOrCreateVarID(); I think we shouldn't have this ref-count here. ...
9 years ago (2011-12-12 18:28:49 UTC) #7
brettw
On Mon, Dec 12, 2011 at 10:28 AM, <dmichael@chromium.org> wrote: > > http://codereview.chromium.org/8872065/diff/6001/ppapi/shared_impl/var.cc > File ...
9 years ago (2011-12-12 18:53:40 UTC) #8
dmichael (off chromium)
On 2011/12/12 18:53:40, brettw wrote: > On Mon, Dec 12, 2011 at 10:28 AM, <mailto:dmichael@chromium.org> ...
9 years ago (2011-12-12 23:15:12 UTC) #9
Takashi Toyoshima
Now, I finally understand this resource management. OK, my change was wrong as you said. ...
9 years ago (2011-12-13 08:47:08 UTC) #10
Takashi Toyoshima
I post patch set 3 which just reset var_id on erase. I split live object ...
9 years ago (2011-12-13 09:13:20 UTC) #11
brettw
lgtm
9 years ago (2011-12-13 15:10:31 UTC) #12
brettw
Actually, can you add a unit test for this? There's no var_tracker_unittest yet, but you ...
9 years ago (2011-12-13 15:11:48 UTC) #13
dmichael (off chromium)
I like this approach better than what I suggested, thanks. I agree a test would ...
9 years ago (2011-12-13 15:34:32 UTC) #14
Takashi Toyoshima
Thanks, Sure, I'll add tests for VarTracker tomorrow. Can I split the tests into another ...
9 years ago (2011-12-13 15:45:10 UTC) #15
dmichael (off chromium)
lgtm I think it's fine to put the test in another CL.
9 years ago (2011-12-13 16:05:02 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/8872065/13004
9 years ago (2011-12-14 03:46:06 UTC) #17
commit-bot: I haz the power
Try job failure for 8872065-13004 (retry) on mac_rel for step "browser_tests" (clobber build). It's a ...
9 years ago (2011-12-14 05:19:22 UTC) #18
tommi (sloooow) - chröme
fyi - this cl was reverted as the tree was very badly broken this morning. ...
9 years ago (2011-12-14 11:23:53 UTC) #19
tommi (sloooow) - chröme
On 2011/12/14 11:23:53, tommi wrote: > fyi - this cl was reverted as the tree ...
9 years ago (2011-12-14 11:27:02 UTC) #20
Takashi Toyoshima
I thought the failure was not related to this change, because it's not the tests ...
9 years ago (2011-12-14 11:56:10 UTC) #21
Takashi Toyoshima
tommi, I notice that this change cause a DCHECK failure. I'm so sorry to miss ...
9 years ago (2011-12-14 12:39:27 UTC) #22
tommi1
yes, no problem. We'll open the tree in a few minutes, but you can ping ...
9 years ago (2011-12-14 12:44:58 UTC) #23
Takashi Toyoshima
Hi Brett, Antoine. Today, I failed to land this change because it causes DCHECK false ...
9 years ago (2011-12-14 18:39:31 UTC) #24
brettw
lgtm
9 years ago (2011-12-14 22:18:31 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/8872065/12005
9 years ago (2011-12-15 00:54:10 UTC) #26
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
9 years ago (2011-12-15 02:11:37 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/8872065/12005
9 years ago (2011-12-15 02:20:37 UTC) #28
commit-bot: I haz the power
9 years ago (2011-12-15 05:04:07 UTC) #29
Change committed as 114594

Powered by Google App Engine
This is Rietveld 408576698