i-rinat / freshplayerplugin

ppapi2npapi compatibility layer
MIT License
727 stars 52 forks source link

freshplayerplugin crashes over SSH session #292

Closed pureooze closed 8 years ago

pureooze commented 8 years ago

Hi,

First of all thanks for the great work on this project!

When I load a video that requires flash in firefox (youtube, etc) I notice the plugin crashes every time. I tried with chromium (46.0.2490.86-1.1) and pepper-flash (19.0.0.226-1.1) and noted that the videos load fine over SSH. I also removed freshplayerplugin (0.3.3-17.3) and tried with flash-player (11.2.202.548-1.1) which also seemed to work for firefox.

So the issue seems to be with freshplayerplugin not liking something about the SSH session. I am not sure what but I can reproduce it every time.

The command to SSH I am using is: ssh -X username@IP_ADDR

pureooze commented 8 years ago

This is the output from running firefox on the command line, I noticed some lines about nvidia but since this is running in a VM I dont see how it would be able to use my host nvidia card. I am going to guess the issue is caused by flash trying to load as if there was hardware acceleration enabled? How can I disable it? The only way I know is to first load flash on a page...

username@hostname:~> firefox [fresh] [warning] failed to parse configuration file /home/username/.config/freshwrapper.conf, trying /etc/freshwrapper.conf [fresh] [warning] failed to parse configuration file /home/username/.config/freshwrapper.conf, trying /etc/freshwrapper.conf libva info: VA-API version 0.38.0 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so libva info: va_openDriver() returns -1 Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory libGL error: failed to load driver: swrast NOT SANDBOXED [fresh] [warning] ppb_var_var_to_utf8, 'var' is not a string, (0) [fresh 15245] not implemented: PPB_OpenGLES2VertexArrayObject;1.0 [fresh 15245] not implemented: PPB_OpenGLES2DrawBuffers(Dev);1.0 Vector smash protection is enabled. [fresh 15245] [PPB] {zilch} ppb_network_monitor_update_network_list [fresh 15245] [PPB] {zilch} ppb_flash_set_instance_always_on_top instance=11, on_top=1 [fresh 15245] [PPB] {zilch} ppb_network_monitor_update_network_list [fresh] [error] [NP] caught Xlib error 8 [fresh] [error] [NP] caught Xlib error 8 [fresh] [warning] ppb_graphics3d_create, glXCreateContextAttribsARB returned NULL [fresh] [error] [NP] caught Xlib error 169 [fresh] [error] [NP] caught Xlib error 169 [fresh] [error] [NP] caught Xlib error 0 [fresh] [error] [NP] caught Xlib error 0 [fresh] [error] ppb_graphics3d_create, glXMakeCurrent failed [fresh] [error] ppb_graphics3d_create, glXMakeCurrent failed

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

!!! [Parent][MessageChannel::Call] Error: (msgtype=0x9A0014,name=PPluginInstance::Msg_NPP_HandleEvent) Channel timeout: cannot send/recv

i-rinat commented 8 years ago

Freshwrapper expects XRender extension to be available. It's used for transparency rendering, where plugin must blend Pixmap from browser with the generated picture. But XRender doesn't work through X11 forwarding. That's why it fails. I've tried to launch browser though ssh X11 forwarding, and it fails on transparent instances as expected. But plugin doesn't crash, only pictures are missing. (Here is a test page with wmode parameter set to transparent, opaque and direct).

At the moment there is no fallback code, XRender is used in 2d transparent branch and in all 3d branches. I guess fixing 3d has no sense since GL context won't be created anyway. But I'll try to add fallback code for 2d branch.

i-rinat commented 8 years ago

I've added fallback paths in 4a9430adfc52577fc5cc7683ff11f1342b8091fe. How does it work now?

pureooze commented 8 years ago

How can I test it out? Sorry, not familiar with building freshplayer

i-rinat commented 8 years ago

How can I test it out? Sorry, not familiar with building freshplayer

There are compilation instructions on title page. They assume, you have a copy of sources already downloaded and unpacked. If you are not familiar with git utility, you can download current source snapshot by clicking on "Download ZIP" button. It's on this repository title page. You also need to install development versions of libraries used. Some distributions have them already when you install a library, some have them packages separately. In latter case, name usually contains "dev" or "devel" parts. Then you call cmake with parameters (see link above for details). It will print an error is some package is missing. Then you build with make, put generated .so file into ~/.mozilla/plugins/ and it's done.

pureooze commented 8 years ago

Hi, It seems to not show the white box + text for me. I copied the plugin after it was built into the plugins but the page doesnt seem to load correctly: http://paste.opensuse.org/view/raw/7b31cc84

Also if I refresh the page it crashes firefox.

i-rinat commented 8 years ago

the page doesnt seem to load correctly

Yep, plugin crashes. Are you sure you have only one copy of freshwrapper installed? Could you get a backtrace?

Also if I refresh the page it crashes firefox.

That shouldn't happen at all. Firefox launches plugins in a separate process, named plugin-container, so that bug in a plugin doesn't affect browser itself.

pureooze commented 8 years ago

Hi, the freshplayerplugin package is not installed and I manually copied the libfreshwrapper-flashplayer.so file I built to /usr/lib64/browser-plugins (where openSUSE stores the plugins). Is there a way to do something like --version on the plugin file? The one listed in about:addons is 19.0.0.226

For the core dump, I ran ulimit and then got firefox to load the page but there does not seem to be any core dump file actually written to disk. mlocate does not find any file named core in any of the firefox/mozilla/plugin directories either.

i-rinat commented 8 years ago

For the core dump

Added debugging code into freshwrapper itself to make that part easier: 2fc34e0b5f790e9da7524bc3a5d84bd966aa8957. It now will try to launch gdb with a number of commands, that should generate backtrace and put it into a file named like /tmp/freshwrapper-backtrace-1450394568-4720.txt. (Numbers will be different from time to time. Those are a UNIX epoch time and process id).

Is there a way to do something like --version on the plugin file?

Since both freshwrapper and PepperFlash are dynamic libraries, they are not designed to be executed as ordinal executables. PepperFlash version is stored outside, in a manifest.json file. There is a version somewhere inside libpepflashplayer.so, easiest way to extract it is to run strings -a libpepflashplayer.so | grep LNX.

Freshplayerplugin recently got a runtime way to determine version. You add show_version_info = 1 line into configuration file ~/.config/freshwrapper.conf, and version will be showed in context menu, when you click right mouse button on a Flash movie. Of course it required thing to be in a working state.

i-rinat commented 8 years ago

I believe fix already made its path to prebuilt versions. Version "0.3.3-17.3" looks like a package version from Packman repository, and latter already have 0.3.5 in it.

If you are still using the wrapper, could you test over ssh again?

I think issue's already fixed, since I remember having crashes when using over ssh X11 passthrough before fix, and having no crashes after.