Closed Bug 1353877 Opened 8 years ago Closed 8 years ago

String leak in VRServiceTest::AttachVRDisplay

Categories

(Core :: WebVR, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Some test in whatever Mochitest plain is in dom/vr/test/ is hitting this LeakSanitizer leak: ==1840==ERROR: LeakSanitizer: detected memory leaks Direct leak of 28 byte(s) in 2 object(s) allocated from: #0 0x4bb79c in malloc /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64:3 #1 0x4ec75d in moz_xmalloc /home/worker/workspace/build/src/memory/mozalloc/mozalloc.cpp:83:17 #2 0x7fd5b07ea1dd in ToNewUTF8String(nsAString const&, unsigned int*) /home/worker/workspace/build/src/xpcom/string/nsReadableUtils.cpp:439:19 #3 0x7fd5b664e3de in mozilla::dom::VRServiceTest::AttachVRDisplay(nsAString const&, mozilla::ErrorResult&) /home/worker/workspace/build/src/dom/vr/VRService #4 0x7fd5b41d92df in attachVRDisplay /home/worker/workspace/build/src/obj-firefox/dom/bindings/VRServiceTestBinding.cpp:1209:45 #5 0x7fd5b41d92df in mozilla::dom::VRServiceTestBinding::attachVRDisplay_promiseWrapper(JSContext*, JS::Handle<JSObject*>, mozilla::dom::VRServiceTest*, JSJitMethodCallArgs const&) /home/worker/workspace/build/src/obj-firefox/dom/bindings/VRServiceTestBinding.cpp:1228 It is not making the tree orange because the LeakSanitizer test harness parser was broken, maybe on 3/13.
It looks like VRServiceTest was landed in bug 1323328, which landed before bug 1344346, so maybe something else broken LSan.
Blocks: 1323328
Stack frame #3 should be: mozilla::dom::VRServiceTest::AttachVRDisplay(nsAString const&, mozilla::ErrorResult&) /home/amccreight/mc/dom/vr/VRServiceTest.cpp:325:44 I have a patch that seems to work. I think this is just incorrect string conversion.
Assignee: nobody → continuation
Comment on attachment 8855070 [details] Bug 1353877 - Don't leak intermediate string in VRServiceTest::AttachVRDisplay. https://reviewboard.mozilla.org/r/126978/#review129786 ::: dom/vr/VRServiceTest.cpp:345 (Diff revision 1) > if (NS_WARN_IF(aRv.Failed())) { > return nullptr; > } > > gfx::VRManagerChild* vm = gfx::VRManagerChild::Get(); > vm->CreateVRServiceTestController(nsCString(ToNewUTF8String(aID)), p); If it would have the string memory leak problem at AttachVRDisplay(), please help me fix it at AttachVRController() as well. Thanks.
(In reply to Daosheng Mu[:daoshengmu] from comment #4) > If it would have the string memory leak problem at AttachVRDisplay(), please > help me fix it at AttachVRController() as well. Thanks. Thanks. I meant to check for other instances of this but I forgot. I've now fixed that.
Nathan, maybe you could take a look at it soonish if Kip can't get to it? This is just an XPCOM string change. It is one of two things blocking re-enabling LSan again. Thanks.
Flags: needinfo?(nfroyd)
Comment on attachment 8855070 [details] Bug 1353877 - Don't leak intermediate string in VRServiceTest::AttachVRDisplay. https://reviewboard.mozilla.org/r/126978/#review129980
Attachment #8855070 - Flags: review+
(In reply to Andrew McCreight [:mccr8] from comment #7) > Nathan, maybe you could take a look at it soonish if Kip can't get to it? > This is just an XPCOM string change. It is one of two things blocking > re-enabling LSan again. Thanks. r=me. Thanks for tracking this down.
Flags: needinfo?(nfroyd)
Attachment #8855070 - Flags: review?(kgilbert)
Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d78479dbdd45 Don't leak intermediate string in VRServiceTest::AttachVRDisplay. r=froydnj
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: