Uploaded image for project: 'Libmongocrypt'
  1. Libmongocrypt
  2. MONGOCRYPT-481

libmongocrypt needs mcr_dll_path which isn't implemented for all platforms

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.9.0
    • Affects Version/s: 1.6.0-alpha0
    • Component/s: C library
    • Labels:
      None

      libmongocrypt wants to know the path for a loaded library, seemingly to compare if a library is already loaded (_validate_csfle_singleton). It has an implementation for Windows, macOS, and Linux (though this uses dlinfo which is also available on Solaris and *BSD, AFAIK). However, if there is no implementation, then it'll fail the build with an error. I'm building for AIX, so this is where I hit it.

      I looked into implementing this on AIX myself, but it did seem pretty tricky. dlopen returns an opaque ID that starts from zero and increments. Now, dladdr can be implemented in terms of calling a function that gets all loaded libraries (loadquery with L_GETINFO) and checking if the pointer is in their text/data ranges. However, dlinfo uses the value of dlopen, and the structure returned by loadquery that doesn't contain the IDs that libdl uses internally. I really want to avoid reaching into dynamic linker internals if I don't have to.

      An alternative might be to make it so that not having this function doesn't count as a hard error, and if not available, skip the validation logic. It'd be a lot easier than trying to implement it on all platforms, and I don't think it's that critical anyways.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            calvin@cmpct.info Calvin Buckley
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: