Search code examples
macosflashfirefoxvmwarenpapi

Firefox NPAPI plugins broken in OSX on VMware


It seems like Firefox NPAPI plugins are broken in Mac OSX (tested on 10.6 and 10.7) VMware virtual machines. Does anyone know why, or have an idea for a workaround - e.g. detect when the user is running Firefox/OSX/VM?

Context:

  • My plugin consumes 100% CPU only if FF && OSX && VM. However, the plugin is still functional. This is always reproducible and happens across multiple VMs.
  • Adobe Reader, Adobe Flash, and a test plugin I built using Firebreath (the tutorial) were all broken as well in this environment.
  • Firefox outputs the following log message in Console: "invalid pixel format" and "invalid context". Probably related to OpenGL - see bug report.
  • Running the glxinfo command gives a similar error:

    cb-sea-miniosx64-03:~ seabld$ glxinfo
    name of display: /tmp/launch-LojaDe/:0
    Thu Jul  5 20:13:51 cb-sea-miniosx64-03.comm-build.scl1.mozilla.com glxinfo[1009 <Error>: unknown error code: invalid pixel format
    Thu Jul  5 20:13:51 cb-sea-miniosx64-03.comm-build.scl1.mozilla.com glxinfo[1009] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
    X Error of failed request: GLXBadContext
      Major opcode of failed request:  0 ()
      Serial number of failed request:  16
      Current serial number in output stream:   16
    
  • The Instruments profiler reports a lot of time spent in IOSurfaceCreate/IOSurfaceClientCreate for my plugin. The browser uses IOSurface to share rendering data with the plugin if I understand correctly.
  • A sample taken using Activity Monitor did not seem to have any useful info - except that the CPU problem is in the main thread (DispatchQueue).
  • One workaround is to run Firefox in 32-bit mode: right-click the FF application > Get Info > Open in 32-bit mode. But we can't expect users to do it.

Solution

  • Sounds as though OS X VMWare guests simply don't have fully functional 3D acceleration. If anything, this is a VMWare bug (not exposing full 3D acceleration), or possibly a Firefox bug (responding badly to a lack of 3D capabilities); it's almost certainly not your fault.

    I wouldn't spend too much time trying to work around it, especially given that every other plugin you've tried (including Flash!) seems to be affected by the exact same problem. List it as a "known issue" and move on.