Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4065680

problem with dlsym resoltion in JDk1.1.3

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 1.1.3
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description

      Date: Sun, 6 Jul 1997 18:33:37 -0700 (PDT)
      From: David Rivas <jdr@shorter>
      Subject: dlsym resolution in 1.1.3
      To: mr@shorter, lindholm@shorter, thomasb@shorter

      Didn't know who to talk to on this one, so=20
      excuse me for the distribution.

      I think the=041.1.3 symbol resolving logic, which seems
      to have been totally rewritten in 1.2, has a little
      bug that I found and need fixed.

      Symbol resolution seems to come down to the function,
      in src/solaris/java/runtime/linker_md.c:

      long
      sysDynamicLink(char *sym_p)
      {
          void *f =3D 0;
          int i;

          /*
           * we need this kludge, because the java interpreter internals need
           * to access this before the Linker class is loaded and calls
           * the static initializers
           */
          if (!linkerinitialized) {
      =09(void)sysInitializeLinker();
          }
         =20
          if ((f =3D dlsym(RTLD_NEXT, sym_p)) =3D=3D 0) {
      =09for (i =3D useddlsegments; --i >=3D 0;) {
      =09 if ((f =3D dlsym(dlsegment[i].handle, sym_p))) {
      =09=09return((long)f);
      =09 }
      =09}
          }
          return 0;
      }


      The problem is that if the first dlsym succeeds it returns 0
      instead of the symbol address.=20

      A possible fix is:

      long
      sysDynamicLink(char *sym_p)
      {
          void *f =3D 0;
          int i;

          /*
           * we need this kludge, because the java interpreter internals need
           * to access this before the Linker class is loaded and calls
           * the static initializers
           */
          if (!linkerinitialized) {
      =09(void)sysInitializeLinker();
          }

          if ((f =3D dlsym(RTLD_NEXT, sym_p)) =3D=3D 0) {
      =09for (i =3D useddlsegments; --i >=3D 0;) {
      =09 if ((f =3D dlsym(dlsegment[i].handle, sym_p))) {
      =09=09return((long)f);
      =09 }
      =09}
          }=20

          /* Return the symbol (which may be null) */
          return f;
      }


      For a variety of reasons I'm trying to get the AuidoEngine to
      work on pre 1.2 platforms, and this bug gets tickled.

      Who can review and put this (or another) fix back? I can
      put it back if that's approprate.


      david

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              apalanissunw Anand Palaniswamy (Inactive)
              Reporter:
              apalanissunw Anand Palaniswamy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: