in master: failing tests / no matching locale

Lionel Elie Mamane lionel at mamane.lu
Wed Jul 22 09:50:35 PDT 2015


Hi,

A great many tests fail in master for me (in my dev tree). I looked
into one of them and it is:

in desktop/source/deployment/registry/package/dp_package.cxx, line 1494:

                LanguageTag descrTag(iter->second.m_sValue);

/usr/include/c++/5/debug/safe_iterator.h:317:error: attempt to
dereference 
    a past-the-end iterator.

Objects involved in the operation:
iterator "this" @ 0x0x7fff558f9b40 {
type =
N11__gnu_debug14_Safe_iteratorINSt8__detail14_Node_iteratorISt4pairIKN3rtl7OStringE24INetContentTypeParameterELb0ELb1EEENSt7__debug13unordered_mapIS5_S7_NS4_11OStringHashE29OString_equalsIgnoreAsciiCaseSaIS8_EEEEE
(mutable iterator);
  state = past-the-end;
  references sequence with type
  `NSt7__debug13unordered_mapIN3rtl7OStringE24INetContentTypeParameterNS1_11OStringHashE29OString_equalsIgnoreAsciiCaseSaISt4pairIKS2_S3_EEEE'
  @ 0x0x7fff558f9c90
}


iter is defined, since

commit 21834f14c97071c5bcf13ef02bf940dc1922663f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jul 15 23:17:20 2015 +0200

    tools: replace boost::ptr_vector with std::unordered_map

    Change-Id: I530c5f95dda9aa80654e3a2a20a2e236221e7305


as

        auto const iter = params.find("platform");


but there does not seem any protection against a "not found"
situation. This seems to be locale-related. I compile with:

--with-lang=fr de nl en-GB

and I run under:

LANG=fr_LU.utf8
LANGUAGE=
LC_MESSAGES=en_GB.UTF-8
LC_ALL=



This hunk looks suspicious to me:


@@ -1483,14 +1483,15 @@ void BackendImpl::PackageImpl::scanBundle(
             subType.equalsIgnoreAsciiCase(
	     "vnd.sun.star.package-bundle-description"))
         {
             // check locale:
-            param = params.find("locale");
-            if (param == 0) {
+            auto const iterLocale = params.find("locale");
+            if (iterLocale == params.end())
+            {
                 if (descrFile.isEmpty())
                     descrFile = url;
             }
             else {
                 // match best locale:
-                LanguageTag descrTag( param->m_sValue);
+                LanguageTag descrTag(iter->second.m_sValue);
                 if (officeLocale.getLanguage() ==
		 descrTag.getLanguage())
                 {
                     size_t nPenalty = nPenaltyMax;


Whereas before the call to
  param = params.find("locale");
would overwrite the value previously given to "param", now since there
are two separate variables, in the "else" branch it is the result of
  params.find("platform")
that is used.

-- 
Lionel


More information about the LibreOffice mailing list