i-rinat / freshplayerplugin

ppapi2npapi compatibility layer
MIT License
727 stars 52 forks source link

Page freeze on closing in Opera #294

Closed eryngion closed 6 years ago

eryngion commented 8 years ago

Sometimes in Opera a page with Youtube video freezes on close and I see high CPU usage by the freshplayer process. After killing of the plugin process the page successfully closes. In the debug output I see a lot of repeating blocks like this:

[fresh  4061] [NPP] {full} NPP_SetWindow npp=0x14a2458, window={.window=(nil), .x=0, .y=0, .width=1127, .height=634, .clipRect={.top=0, .left=0, .bottom=0, .right=0}, .ws_info=0x149eb08, .type=2}
[fresh  4066]    calling callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow
[fresh  4066] [PPB] {full} ppb_core_add_ref_resource resource=2414
[fresh  4066] [PPB] {full} ppb_view_get_rect resource=2414
[fresh  4066] [PPB] {full} ppb_flash_fullscreen_is_fullscreen instance=11
[fresh  4066] [PPB] {full} ppb_view_get_device_scale resource=2414
[fresh  4066] [PPB] {full} ppb_view_get_css_scale resource=2414
[fresh  4066] [PPB] {full} ppb_view_get_clip_rect resource=2414
[fresh  4066] [PPB] {full} ppb_core_release_resource resource=2414
[fresh  4066]    returning from callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow
[fresh  4061] [NPP] {full} NPP_SetWindow npp=0x14a2458, window={.window=(nil), .x=0, .y=0, .width=1127, .height=634, .clipRect={.top=0, .left=0, .bottom=0, .right=0}, .ws_info=0x149eb08, .type=2}
[fresh  4066]    calling callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow
[fresh  4066] [PPB] {full} ppb_core_add_ref_resource resource=2415
[fresh  4066] [PPB] {full} ppb_view_get_rect resource=2415
[fresh  4066] [PPB] {full} ppb_flash_fullscreen_is_fullscreen instance=11
[fresh  4066] [PPB] {full} ppb_view_get_device_scale resource=2415
[fresh  4066] [PPB] {full} ppb_view_get_css_scale resource=2415
[fresh  4066] [PPB] {full} ppb_view_get_clip_rect resource=2415
[fresh  4066] [PPB] {full} ppb_core_release_resource resource=2415
[fresh  4066]    returning from callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow
[fresh  4066]    calling callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow
[fresh  4066] [PPB] {full} ppb_core_add_ref_resource resource=2416
[fresh  4066] [PPB] {full} ppb_view_get_rect resource=2416
[fresh  4066] [PPB] {full} ppb_flash_fullscreen_is_fullscreen instance=11
[fresh  4066] [PPB] {full} ppb_view_get_device_scale resource=2416
[fresh  4066] [PPB] {full} ppb_view_get_css_scale resource=2416
[fresh  4066] [PPB] {full} ppb_view_get_clip_rect resource=2416
[fresh  4066] [PPB] {full} ppb_core_release_resource resource=2416
[fresh  4066]    returning from callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow
[fresh  4061] [NPP] {full} NPP_SetWindow npp=0x14a2458, window={.window=(nil), .x=0, .y=0, .width=1127, .height=634, .clipRect={.top=0, .left=0, .bottom=0, .right=0}, .ws_info=0x149eb08, .type=2}
[fresh  4066]    calling callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow
[fresh  4066] [PPB] {full} ppb_core_add_ref_resource resource=2417
[fresh  4066] [PPB] {full} ppb_view_get_rect resource=2417
[fresh  4066] [PPB] {full} ppb_flash_fullscreen_is_fullscreen instance=11
[fresh  4066] [PPB] {full} ppb_view_get_device_scale resource=2417
[fresh  4066] [PPB] {full} ppb_view_get_css_scale resource=2417
[fresh  4066] [PPB] {full} ppb_view_get_clip_rect resource=2417
[fresh  4066] [PPB] {full} ppb_core_release_resource resource=2417
[fresh  4066]    returning from callback={.func=0x7f7c983296d9, .user_data=0xb, .flags=0}, result=0, origin=NPP_SetWindow

And in the code it looks like NPP_SetWindow does not take into account null in window handler, however it should by the specification https://developer.mozilla.org/en-US/Add-ons/Plugins/Reference/NPP_SetWindow. Could it be the reason for my problem or am I missing something?

i-rinat commented 8 years ago

Could it be the reason

Could be. From code I'd expect it to throw a bunch of X error reports to a console if window->window becomes (nil), but who knows. Is there any way to make browser pass (nil) there?

i-rinat commented 8 years ago

I'm able to get window->window == NULL only in windowless mode (wmode=opaque or wmode=transparent in Flash terms). In that mode value of window->window is not used at all.

i-rinat commented 8 years ago

Also did you try to use gdb to find out what Opera's plugin container process is doing?

Next time it freezes, try to run

gdb --pid $(pidof operapluginwrapper-native)

And then

set logging on
set pagination off
thread apply all bt
bt

in gdb prompt. First command will enable saving output to file named gdb.txt, in a current directory.

i-rinat commented 6 years ago

Two years passed. And since I can't reproduce the issue nor had a chance to get a backtrace, there is no sense in keeping the issue open. Feel free to reopen or create another (the latter option preferred).