自升级到冰淇淋三明治以来,SIGSEGV深入MediaPlayer

时间:2012-07-10 20:34:24

标签: android media-player android-4.0-ice-cream-sandwich chromium

我开发了一款在Android预冰淇淋三明治上运行良好的音乐应用程序。但是自从我升级到4.0.3后,我开始接触MediaPlayer的随机问题,这是我以前从未遇到的问题。例如,这是我在实例处于播放完成状态时通过调用mediaPlayer.reset得到的:

07-10 15:27:51.842: D/NuCachedSource2(13537): [setBreak]mForceBreak = 2  
07-10 15:27:51.842: I/ChromiumHTTPDataSourceSupport(13537): initiateDisconnect start  
07-10 15:27:51.852: A/libc(13537): Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1)  
07-10 15:27:52.362: I/DEBUG(13536): debuggerd: 2012-07-10 15:27:52  
07-10 15:27:52.362: I/DEBUG(13536): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  
07-10 15:27:52.362: I/DEBUG(13536): Build fingerprint: 'tmous/htc_ruby/ruby:4.0.3/IML74K/373265.3:user/release-keys'  
07-10 15:27:52.362: I/DEBUG(13536): pid: 13537, tid: 13537  >>> /system/bin/mediaserver <<<  
07-10 15:27:52.362: I/DEBUG(13536): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000010  
[...]  
07-10 15:27:52.402: I/DEBUG(13536):  scr 60000010  
07-10 15:27:52.542: I/DEBUG(13536):          #00  pc 00000010    
07-10 15:27:52.542: I/DEBUG(13536):          #01  pc 0010f70e  /system/lib/libchromium_net.so (_ZNK3net11BoundNetLog8AddEntryENS_6NetLog9EventTypeENS1_10EventPhaseERK13scoped_refptrINS1_15EventParametersEE)  
07-10 15:27:52.542: I/DEBUG(13536):          #02  pc 0010f71a  /system/lib/libchromium_net.so (_ZNK3net11BoundNetLog8EndEventENS_6NetLog9EventTypeERK13scoped_refptrINS1_15EventParametersEE)  
07-10 15:27:52.542: I/DEBUG(13536):          #03  pc 001a4458  /system/lib/libchromium_net.so (_ZN3net10URLRequest11set_contextEPNS_17URLRequestContextE)  
07-10 15:27:52.552: I/DEBUG(13536):          #04  pc 0012467e  /system/lib/libstagefright.so (_ZN7android10SfDelegate18initiateDisconnectEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #05  pc 00121ca6  /system/lib/libstagefright.so (_ZN7android22ChromiumHTTPDataSource12disconnect_lEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #06  pc 00121d04  /system/lib/libstagefright.so (_ZN7android22ChromiumHTTPDataSource10disconnectEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #07  pc 00121776  /system/lib/libstagefright.so (_ZN7android22ChromiumHTTPDataSource12breakNetworkEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #08  pc 00083b38  /system/lib/libstagefright.so (_ZN7android13AwesomePlayer12breakNetworkENS_18FORCE_BREAK_STATUSE)  
07-10 15:27:52.552: I/DEBUG(13536):          #09  pc 00086c9e  /system/lib/libstagefright.so (_ZN7android13AwesomePlayer5resetEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #10  pc 00027e5e  /system/lib/libmediaplayerservice.so (_ZN7android17StagefrightPlayer5resetEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #11  pc 0002304a  /system/lib/libmediaplayerservice.so (_ZN7android18MediaPlayerService6Client5resetEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #12  pc 00041734  /system/lib/libmedia.so (_ZN7android13BnMediaPlayer10onTransactEjRKNS_6ParcelEPS1_j)  

在那之后不久:

07-10 15:27:55.645: W/AudioSystem(236): AudioFlinger server died!  
07-10 15:27:55.645: W/AudioSystem(236): AudioPolicyService server died!  
07-10 15:27:55.645: W/AudioSystem(13123): AudioFlinger server died!  
07-10 15:27:55.645: W/IMediaDeathNotifier(13123): media server died  
07-10 15:27:55.645: E/MediaPlayer(13123): error (100, 0)  
07-10 15:27:55.645: E/MediaPlayer(13123): error (100, 0)  
07-10 15:27:55.645: I/ServiceManager(116): service 'media.audio_flinger' died  
07-10 15:27:55.645: I/ServiceManager(116): service 'media.player' died  
07-10 15:27:55.645: I/ServiceManager(116): service 'media.camera' died  
07-10 15:27:55.645: I/ServiceManager(116): service 'media.audio_policy' died  
07-10 15:27:55.645: I/DEBUG(13536): debuggerd committing suicide to free the zombie!  
07-10 15:27:55.665: I/DEBUG(13617): debuggerd: May  2 2012 21:31:04 

是否有人提示在此级别可能导致分段错误的原因?

感谢。

编辑:经过进一步的调查,我发现了一些简单的步骤来重现运行Android 4.0.3的HTC Ruby(HTC Amaze 4G)上的分段错误:

使用2个MediaPlayer实例:

  1. 使用第一个实例开始播放某些远程音频文件;
  2. 当第一个实例仍在播放时,使用第二个实例开始播放另一个远程音频文件;
  3. 当第一个实例完成播放时,请对其进行重置。这很好。
  4. 当第二个实例完成播放时,请在其上调用reset()。出乎意料的是,这会在Chromium中导致SIGSEGV,从而导致将Media Server Died错误分派给所有实例。

1 个答案:

答案 0 :(得分:0)

看那里的logcat,

07-10 15:27:52.542: I/DEBUG(13536):          #00  pc 00000010    
07-10 15:27:52.542: I/DEBUG(13536):          #01  pc 0010f70e  /system/lib/libchromium_net.so (_ZNK3net11BoundNetLog8AddEntryENS_6NetLog9EventTypeENS1_10EventPhaseERK13scoped_refptrINS1_15EventParametersEE)  
07-10 15:27:52.542: I/DEBUG(13536):          #02  pc 0010f71a  /system/lib/libchromium_net.so (_ZNK3net11BoundNetLog8EndEventENS_6NetLog9EventTypeERK13scoped_refptrINS1_15EventParametersEE)  
07-10 15:27:52.542: I/DEBUG(13536):          #03  pc 001a4458  /system/lib/libchromium_net.so (_ZN3net10URLRequest11set_contextEPNS_17URLRequestContextE)  
07-10 15:27:52.552: I/DEBUG(13536):          #04  pc 0012467e  /system/lib/libstagefright.so (_ZN7android10SfDelegate18initiateDisconnectEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #05  pc 00121ca6  /system/lib/libstagefright.so (_ZN7android22ChromiumHTTPDataSource12disconnect_lEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #06  pc 00121d04  /system/lib/libstagefright.so (_ZN7android22ChromiumHTTPDataSource10disconnectEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #07  pc 00121776  /system/lib/libstagefright.so (_ZN7android22ChromiumHTTPDataSource12breakNetworkEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #08  pc 00083b38  /system/lib/libstagefright.so (_ZN7android13AwesomePlayer12breakNetworkENS_18FORCE_BREAK_STATUSE)  
07-10 15:27:52.552: I/DEBUG(13536):          #09  pc 00086c9e  /system/lib/libstagefright.so (_ZN7android13AwesomePlayer5resetEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #10  pc 00027e5e  /system/lib/libmediaplayerservice.so (_ZN7android17StagefrightPlayer5resetEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #11  pc 0002304a  /system/lib/libmediaplayerservice.so (_ZN7android18MediaPlayerService6Client5resetEv)  
07-10 15:27:52.552: I/DEBUG(13536):          #12  pc 00041734  /system/lib/libmedia.so (_ZN7android13BnMediaPlayer10onTransactEjRKNS_6ParcelEPS1_j)  

那些行指向跟踪的源,它的libchromium在某处发生错误,是的,所用符号的名称看起来很模糊,但它是在构建时链接的错误的C ++名称 - ROM的时间。

您从下往上阅读跟踪。这就是线索,通常是#00/pc....#01/pc....的最顶端,如上图所示,是失败的原因。

可能值得与您的制造商联系,看看是否有可用的更新或查看他们的HTC论坛,看看是否已经解决了?