Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-542

message catalog assert/crash after opening multiple

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.2, 4.1.3, 4.1.4
    • Fix Version/s: 4.2.0
    • Component/s: 22. Localization
    • Labels:
      None
    • Environment:

      Windows

      Description

      The below code asserts/crashes reliably on windows, but runs to completion on at least one other platform. Note that I copied the rwstdmessages.dll from the examples directory to simplify the testcase.

      C:\build\stdcxx\build\msvc-8.0\15d\tests>type t.cpp
      #include <iostream>
      #include <locale>
      #include <cassert>

      // note same problem occurs even if catalog files are
      // different.
      #ifdef _WIN32

      1. define CATALOG0 "rwstdmessages.dll"
      2. define CATALOG1 "rwstdmessages.dll"
        #else
      3. define CATALOG0 "./rwstdmessages.cat"
      4. define CATALOG1 "./rwstdmessages.cat"
        #endif

      int main (int argc, char *argv[])
      {
      typedef std::messages<char> messagesT;

      const std::locale loc;

      const messagesT& msgs =
      std::use_facet<messagesT>(loc);

      const messagesT::catalog cat0 =
      msgs.open (CATALOG0, loc);

      assert(! (cat0 < 0)); // ensure open succeeded

      const messagesT::catalog cat1 =
      msgs.open (CATALOG1, loc);

      assert(! (cat1 < 0)); // ensure open succeeded

      msgs.close (cat1); // crash/assert here
      msgs.close (cat0);

      return 0;
      }
      C:\build\stdcxx\build\msvc-8.0\15d\tests>t
      C:\build\stdcxx\include\rw/iterbase.h:436: class __rw::rw_cat *&thiscall __rw::rw_debug_iter<class std::vector<class __rw::rw_cat *,class std::allocator<class __rw::rw_cat *> >,class __rw::rw_cat * *,class __rw::_rw_cat * *>::operator *(void) const: Assertion '_C_is_dereferenceable ()'
      failed.

      This application has requested the Runtime to terminate it in an unusual way.
      Please contact the application's support team for more information.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                farid Farid Zaripov
                Reporter:
                vitek Travis Vitek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: