Closed Bug 1344587 Opened 4 years ago Closed 4 years ago

test_multicast_dns_device_provider.js (for Presentation API) leaks some objects

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR:

$ XPCOM_MEM_LEAK_LOG=1 ./mach xpcshell-test dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js

 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "== BloatView: ALL (cumulative) LEAK STATISTICS, default process 67498"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "     |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "     |                                      | Per-Inst   Leaked|   Total      Rem|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "   0 |TOTAL                                 |       43     7296|   32136      120|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "   6 |BackstagePass                         |      104      416|      13        4|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "  22 |CondVar                               |       40       80|      47        2|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "  24 |DNSServiceWrappedListener             |       56       56|      16        1|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "  40 |IdlePeriod                            |       24       24|      19        1|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "  51 |MulticastDNSDeviceProvider            |      192      768|      16        4|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "  52 |MulticastDNSDeviceProvider::Device    |      128      128|      26        1|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) "  53 |Mutex                                 |       32      288|     157        9|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) " 101 |XPCNativeInterface                    |       56      224|     345        4|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) " 102 |XPCNativeMember                       |       16       64|    6592        4|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) " 103 |XPCNativeSet                          |       32      128|      96        4|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) " 104 |XPCWrappedNative                      |       96      960|    1502       10|"
 0:10.00 PROCESS_OUTPUT: Thread-1 (pid:67498) " 105 |XPCWrappedNativeProto                 |       40      200|      85        5|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 107 |XPCWrappedNativeTearOff               |       32      320|    1969       10|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 149 |nsHashPropertyBagCC                   |       80       80|      12        1|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 163 |nsJSID                                |       56       56|     378        1|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 165 |nsJSPrincipals                        |       24       24|       4        1|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 203 |nsStringBuffer                        |        8       96|    7998       12|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 209 |nsTArray_base                         |        8       88|    5773       11|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 210 |nsThread                              |      352      352|      18        1|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 213 |nsTimer                               |       32      256|      45        8|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 214 |nsTimerImpl                           |      160     1280|      45        8|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 217 |nsVariant                             |       72       72|      23        1|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 230 |nsXPCWrappedJS                        |      120      840|     169        7|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 231 |nsXPCWrappedJSClass                   |       72      216|      43        3|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) " 241 |xptiInterfaceInfo                     |       40      280|     108        7|"
 0:10.01 PROCESS_OUTPUT: Thread-1 (pid:67498) "nsTraceRefcnt::DumpStatistics: 242 entries"
Assignee: nobody → ehsan
Comment on attachment 8843789 [details] [diff] [review]
Fix a leak in test_multicast_dns_device_provider.js

Review of attachment 8843789 [details] [diff] [review]:
-----------------------------------------------------------------

Is this patch enough to fix all the leakage? I tried this today and found `ignoreIncompatibleDevice` and `ignoreSelfDevice` are contributing the memleak as well.

::: dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js
@@ +476,5 @@
>        for (let test of tests) {
>          Assert.equal(device.isRequestedUrlSupported(test.requestedUrl), test.supported);
>        }
>  
> +      provider = null;

please keep the `provider.listener = null;`
Attachment #8843789 - Flags: review?(schien) → feedback+
No longer blocks: 1340710
(In reply to Shih-Chiang Chien [:schien] (UTC+8) (use ni? plz) from comment #2)
> Is this patch enough to fix all the leakage? I tried this today and found
> `ignoreIncompatibleDevice` and `ignoreSelfDevice` are contributing the
> memleak as well.

This seemed to fix this as far as bug 1340710 cared (but it turns out I don't need the fix for that bug after all.)

For bug 1341961 I suspect we would need to do more work on many more tests...
(In reply to :Ehsan Akhgari from comment #3)
> (In reply to Shih-Chiang Chien [:schien] (UTC+8) (use ni? plz) from comment
> #2)
> > Is this patch enough to fix all the leakage? I tried this today and found
> > `ignoreIncompatibleDevice` and `ignoreSelfDevice` are contributing the
> > memleak as well.
> 
> This seemed to fix this as far as bug 1340710 cared (but it turns out I
> don't need the fix for that bug after all.)

But since it seems a similar fix applies to both of those too, I will just do that when landing.
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8086f1e5317b
Fix a leak in test_multicast_dns_device_provider.js; r=schien
(In reply to :Ehsan Akhgari from comment #4)
> (In reply to :Ehsan Akhgari from comment #3)
> > (In reply to Shih-Chiang Chien [:schien] (UTC+8) (use ni? plz) from comment
> > #2)
> > > Is this patch enough to fix all the leakage? I tried this today and found
> > > `ignoreIncompatibleDevice` and `ignoreSelfDevice` are contributing the
> > > memleak as well.
> > 
> > This seemed to fix this as far as bug 1340710 cared (but it turns out I
> > don't need the fix for that bug after all.)
> 
> But since it seems a similar fix applies to both of those too, I will just
> do that when landing.

sure thanks!
https://hg.mozilla.org/mozilla-central/rev/8086f1e5317b
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.