JNI global reference leak for media.remote.RemoteMediaPlayerBridge
Reported by
goandd...@gmail.com,
Mar 30 2017
|
||||||||||
Issue descriptionExample URL: https://jsfiddle.net/g4dhv38o/ Steps to reproduce the problem: 1. use chrome to play the web page 2. play the video for about 51xxx times 3. chrome apk exits with JNI error What is the expected behavior? chrome can play it correctly What went wrong? Chrome APK exits with attached log Did this work before? N/A Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? Yes Chrome version: 56.0.2815.1 Channel: stable OS Version: android 4.4, android 5, and android 6 Flash Version: Contents of chrome://gpu: I change the android global reference table size from 51200 to 1024 to speedup the reproducing. And it seems like RemoteMediaPlayerBridge leaks the object as video playing. I check RemoteMediaPlayerBridge JNI file and found the global reference objects were not released after video finished.
,
Apr 24 2017
remove from untriaged bucket. give to matt to start. wolenetz@, please feel free to assign appropriately.
,
Apr 24 2017
I think it's for me or Thomas to take a look :) cc:torne who's the JNI reference expert.
,
Apr 24 2017
Thanks for taking this one, avayvod@/tguilbert@
,
Apr 24 2017
,
Apr 25 2017
The only global ref in remote_media_player_bridge is the one holding a reference to the Java peer, and it's a normal ScopedJavaGlobalRef member, so if those are leaking then it's probably just a side effect of the C++ object itself leaking?
,
Apr 26 2017
Thomas, could it be some HLS related change then that leaks MediaPlayerBridge?
,
Apr 26 2017
The report lists M56, but the log seems to come from M52. In both cases, it is unlikely HLS related changes introduced this bug. The MediaPlayerRenderer was only turned on by default in M57 (although, in M56, the code was present but off).
,
Apr 26 2017
Will take a look then!
,
Apr 26 2017
I found that the remote_media_player_bridge.cc would create global JNI objects by java_bridge_.Reset(). And the objects are never released by java_bridge.Reset(). when video finished, remote_media_player_manager only call the bridge's onPlayerDestroyed() and java_bridge.Reset is not called
,
Apr 26 2017
The whole point of ScopedJavaGlobalRef is that it releases the reference when destroyed - there's no need to explicitly call Reset() as when the native side object is destroyed the reference will be released. So, if the Java MediaPlayerBridge objects are leaking, that means that probably the C++ object itself still exists, and so the Java object still existing is not the cause of the problem but just a symptom.
,
Oct 18 2017
Assigning all my bugs to Mounir for him to triage and close/reassign later.
,
Oct 30 2017
,
Apr 7 2018
There seems to be no activity and I can't find any recent reference to a similar crash. Please let me know if that's still an issue. |
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by dalecur...@chromium.org
, Mar 30 2017