Closed Bug 1057804 Opened 9 years ago Closed 9 years ago

ASAN reports memory leaks when Gecko 34 merges to Aurora

Categories

(Core :: WebRTC, defect)

x86_64
Linux
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla34

People

(Reporter: RyanVM, Assigned: mccr8)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

Merge day is Tuesday, 2-September, so this is semi-urgent. It shows up in both mochitest-2 and mochitest-3 runs.

https://tbpl.mozilla.org/php/getParsedLog.php?id=46644850&tree=Try

19:21:12     INFO -  4421 INFO ==1785==ERROR: LeakSanitizer: detected memory leaks
19:21:12     INFO -  4422 INFO Direct leak of 32784 byte(s) in 1 object(s) allocated from:
19:21:12     INFO -  4423 INFO     #0 0x471cf1 in malloc /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74
19:21:12     INFO -  4424 INFO     #1 0x7f484f5ec696 in r_malloc /builds/slave/try-l64-asan-00000000000000000/build/media/mtransport/third_party/nrappkit/src/util/libekr/r_memory.c:76
19:21:12     INFO -  4425 INFO     #2 0x7f484f5ec696 in r_calloc /builds/slave/try-l64-asan-00000000000000000/build/media/mtransport/third_party/nrappkit/src/util/libekr/r_memory.c:101
19:21:12     INFO -  4426 INFO     #3 0x7f484f5ea829 in r_assoc_create /builds/slave/try-l64-asan-00000000000000000/build/media/mtransport/third_party/nrappkit/src/util/libekr/r_assoc.c:138
19:21:12     INFO -  4427 INFO     #4 0x7f484f5f37ca in nr_reg_cb_init /builds/slave/try-l64-asan-00000000000000000/build/media/mtransport/third_party/nrappkit/src/registry/registrycb.c:88
19:21:12     INFO -  4428 INFO     #5 0x7f484f5efaf0 in nr_reg_local_init /builds/slave/try-l64-asan-00000000000000000/build/media/mtransport/third_party/nrappkit/src/registry/registry_local.c:872
19:21:12     INFO -  4429 INFO -----------------------------------------------------
19:21:12     INFO -  4430 INFO Suppressions used:
19:21:12     INFO -  4431 INFO   count      bytes template
19:21:12     INFO -  4432 INFO      40        986 libc.so
19:21:12     INFO -  4433 INFO     851      27192 nsComponentManagerImpl
19:21:12     INFO -  4434 INFO      66       8976 mozJSComponentLoader::LoadModule
19:21:12     INFO -  4435 INFO       1      24672 profiler_init
19:21:12     INFO -  4436 INFO       1        384 pixman_implementation_lookup_composite
19:21:12     INFO -  4437 INFO     360      15936 libfontconfig.so
19:21:12     INFO -  4438 INFO       1      32784 NR_reg_init
19:21:12     INFO -  4439 INFO     102      14076 fsmdef_init
19:21:12     INFO -  4440 INFO     195      18592 r_log_register
19:21:12     INFO -  4441 INFO     114       5378 nr_reg_set
19:21:12     INFO -  4442 INFO       3         99 ccsnap_device_init
19:21:12     INFO -  4443 INFO     103       3403 ccsnap_line_init
19:21:12     INFO -  4444 INFO       8        120 media/webrtc/signaling/src/sipcc/core/common/init.c
19:21:12     INFO -  4445 INFO      21        672 cprPostMessage
19:21:12     INFO -  4446 INFO       1        136 mozilla::NrIceStunServer::Create
19:21:12     INFO -  4447 INFO       2         46 libdricore.so
19:21:12     INFO -  4448 INFO    1950      71158 libglib-2.0.so
19:21:12     INFO -  4449 INFO       2        144 libpulse.so
19:21:12     INFO -  4450 INFO       1         40 libpulsecommon-1.1.so
19:21:12     INFO -  4451 INFO       6        168 libresolv.so
19:21:12     INFO -  4452 INFO       1         50 libstdc++.so
19:21:12     INFO -  4453 INFO       1        512 pthread_setspecific_internal
19:21:12     INFO -  4454 INFO     216      27648 swrast_dri.so
19:21:12     INFO -  4455 INFO -----------------------------------------------------
19:21:12     INFO -  4456 INFO SUMMARY: AddressSanitizer: 32784 byte(s) leaked in 1 allocation(s).
19:21:13     INFO -  TEST-INFO | Main app process: exit 0
19:21:13  WARNING -  TEST-UNEXPECTED-FAIL | LeakSanitizer | leak at r_malloc, r_calloc, r_assoc_create, nr_reg_cb_init

If you need help reproducing, this is the patch you can apply to simulate trunk as Aurora.
https://hg.mozilla.org/try/rev/51c612faf2fb
This leak has been here for a long time, and I'm guessing the suppression for it did not work due to the incomplete stack. (frame #6 should have been NR_reg_init, which is suppressed) That said, I have a patch I'm working on that plugs this one-time leak. If we need to work around whatever ASAN bug that is truncating the stack, we can suppress nr_reg_local_init too.
Depends on: 1055852
Er, that's not the patch I was talking about. Sorry!
No longer depends on: 1055852
Depends on: 1057808
Now, I should point out that I have a large amount of stuff I'm trying to land next week, so there is some likelihood that I won't be able to finish bug 1057808 by merge day. I will prepare a patch to the suppressions file for this ticket in case that happens, since it is not actually a new leak.
Sounds like a good idea.  r=me for that.  It is odd that ASan isn't able to walk the stack as far down with an Aurora build, but it doesn't seem worth investigating.
I can fix up the suppression.
Assignee: nobody → continuation
Attachment #8480766 - Flags: review?(docfaraday)
Attachment #8480766 - Flags: feedback?(ryanvm)
Comment on attachment 8480766 [details] [diff] [review]
suppress further up the stack as well

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

lgtm
Attachment #8480766 - Flags: review?(docfaraday) → review+
https://hg.mozilla.org/mozilla-central/rev/30d43e188c20
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Comment on attachment 8480766 [details] [diff] [review]
suppress further up the stack as well

Looks good on Try, thanks :)
Attachment #8480766 - Flags: feedback?(ryanvm) → feedback+
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.