NP_GetMIMEDescription returns NULL in x86_64 instrumented Citrix ICA client npwrapper.npica.so

Bug #856993 reported by JVD
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nspluginwrapper (Ubuntu)
New
Undecided
Unassigned

Bug Description

The Citrix ICA client firefox plugin 32-bit i386 npica.so fails to be instrumented correctly by nspluginwrapper - the generated npwrapper.npica.so's
const char* NP_GetMIMEDescription() function returns NULL, while the original i386 npica.so's version does not:

$ cat chkNPWnpica.c
#include <sys/types.h>
#include <unistd.h>
#include <dlfcn.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv, char **envp)
{
  void *dlh = dlopen("/usr/OOO/ICAClient/npica.so", RTLD_GLOBAL | RTLD_NOW );
  if(dlh == 0)
    {
      printf("dlopen failed: %d\n",errno);
      exit(1);
    }
  const char* (*npGetPluginVersion)() =
    (const char* (*)()) dlsym(dlh, "NP_GetPluginVersion");
  if( npGetPluginVersion == 0 )
    {
      printf("No plugin version\n");
    }

  const char* (*npGetMIMEDescription)() =
    (const char* (*)()) dlsym(dlh, "NP_GetMIMEDescription");

  if( npGetMIMEDescription == 0 )
      printf("No MIME description\n");
  else
    printf("Got NP_GetMIMEDescription: %p\n", npGetMIMEDescription);

  const char* mime_descr = npGetMIMEDescription();

  printf("Got MIME description: %s\n",mime_descr);

  void *npGetValue = dlsym(dlh, "NP_GetValue");

  if( npGetValue == 0 )
      printf("No NP_GetValue");
  else
    printf("Got NP_GetValue: %p\n", npGetValue);

  return 0;
}
$ gcc -o chkNPWnpica chkNPWnpica.c -ldl && ./chkNPWnpica
No plugin version
Got NP_GetMIMEDescription: 0x7feeb9640180
Got MIME description: (null)
Got NP_GetValue: 0x7feeb963ffa0
$ cat chknpica.c
#include <sys/types.h>
#include <unistd.h>
#include <dlfcn.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv, char **envp)
{
  void *dlh = dlopen("/usr/OOO/ICAClient/npica.so", RTLD_GLOBAL | RTLD_NOW );
  if(dlh == 0)
    {
      printf("dlopen failed: %d\n",errno);
      exit(1);
    }
  const char* (*npGetPluginVersion)() =
    (const char* (*)()) dlsym(dlh, "NP_GetPluginVersion");
  if( npGetPluginVersion == 0 )
    {
      printf("No plugin version\n");
    }

  const char* (*npGetMIMEDescription)() =
    (const char* (*)()) dlsym(dlh, "NP_GetMIMEDescription");

  if( npGetMIMEDescription == 0 )
      printf("No MIME description\n");
  else
    printf("Got NP_GetMIMEDescription: %p\n", npGetMIMEDescription);

  const char* mime_descr = npGetMIMEDescription();

  printf("Got MIME description: %s\n",mime_descr);

  void *npGetValue = dlsym(dlh, "NP_GetValue");

  if( npGetValue == 0 )
      printf("No NP_GetValue");
  else
    printf("Got NP_GetValue: %p\n", npGetValue);

  return 0;
}

$ gcc -m32 -o chknpica chknpica.c -ldl && ./chknpica
No plugin version
Got NP_GetMIMEDescription: 0xf77a8590
Got MIME description: application/x-ica:ica:Handles ICA connections
Got NP_GetValue: 0xf77a8420

Any known fix for this ? I urgently need to be able to use Citrix ICA in order to login to my corporate VPN .

I've built nspluginwrapper 1.2.2 from trunk and ran :
$ nspluginwrapper -i /usr/OOO/ICAClient/npica.so
to produce /usr/lib64/mozilla/plugins/npwrapper.npica.so .

Revision history for this message
JVD (jason-vas-dias) wrote :
Revision history for this message
David Benjamin (davidben) wrote :

(I'm the current nspluginwrapper upstream maintainer. Came across this report via Google Alerts.)

If you're running nspluginwrapper 1.2.2, I strongly recommend using a more stable release. Versions before the 1.4.x series have many many known bugs and race conditions. That said, I don't think I fixed anything relating to NP_GetMIMEDescription, so 1.2.x should be the same here. (Not sure where you're getting that 1.2.2 is trunk. The project home page is http://nspluginwrapper.org/ )

I don't seem to be able to reproduce your results, either with 1.4.4 or 1.2.2. I modified your test program to use argv[1] instead of a hard-coded string and got:

$ gcc test.c -o test64 -ldl
$ gcc test.c -o test32 -m32 -ldl
$ ./test32 ./npica.so
No plugin version
Got NP_GetMIMEDescription: 0xf77a2590
Got MIME description: application/x-ica:ica:Handles ICA connections
Got NP_GetValue: 0xf77a2420
$ ./test64 ./npwrapper.npica.so
No plugin version
Got NP_GetMIMEDescription: 0x7f411cee0a80
Got MIME description: application/x-ica:ica:Handles ICA connections
Got NP_GetValue: 0x7f411cee0370
$ ./test64 ./npwrapper.npica-1.2.2.so
No plugin version
Got NP_GetMIMEDescription: 0x7fc2fc16c040
Got MIME description: application/x-ica:ica:Handles ICA connections
Got NP_GetValue: 0x7fc2fc16be60

I notice that your program in the first script uses "/usr/OOO/ICAClient/npica.so". Did you possibly rename npwrapper.npica.so between the two runs? The generated wrapper plugin doesn't actually contain the original plugin and just uses the path you installed it with. It's possible you're getting all the NULLs because it can't find the original 32-bit plugin anymore.

(Huh, I was not aware of NP_GetPluginVersion. I'll modify nspluginwrapper to wrap it sometime. Although it doesn't seem to be used by any plugin I can find.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.