Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11879

Using Windows mongoclient.dll, statics have duplicate storage

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.5
    • None
    • Internal Client
    • None
    • Fully Compatible
    • ALL
    • Hide

      Build mongoclient.lib/.dll.
      Build simple_client_demo.cpp, link against mongoclient.lib. Run the program and you will crash in the constructor for DBClientBase.

      Show
      Build mongoclient.lib/.dll. Build simple_client_demo.cpp, link against mongoclient.lib. Run the program and you will crash in the constructor for DBClientBase.

    Description

      It appears that if you link against mongoclient.dll in your project and then execute code that uses a static variable that's declared in the header but has storage reserved in the C++ driver, it may crash. The compiler seems to be allocating storage space for the static variable in the local application even though it should only be using the storage in the DLL.

      Attachments

        Activity

          People

            mark.benvenuto@mongodb.com Mark Benvenuto
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: