Greetings,

In a comment to his change fixing issue 109146
<http://www.openoffice.org/issues/show_bug.cgi?id=109146>,
Stephan Bergmann commented

    (but I must confess I have no idea how to trigger the code in
    a running OOo, to verify that the assertion no longer wrongly
    fires)


As it happens, my combination of compiler and configuration
options and I know no what else result in literal character
strings being stored at addresses according to where the string
is first encountered in the file.  Within DEV300_m71, I imported
inettype.cxx after S.B.'s subsequent change ( the relevant code
reads ...

    #if defined DBG_UTIL
        for (sal_Size i = 0; i < nSize - 1; ++i)
            DBG_ASSERT(
                rtl_str_compare(
                    pMap[i].m_pTypeName, pMap[i + 1].m_pTypeName) < 0,
                "seekEntry(): Bad map");
    #endif

), and the assertion did not fire.  I verified the descending
addresses of m_pTypeName with a breakpoint at inettype.cxx:810,
and saw ...

    (gdb) p pMap[61]
    $1 = {m_pTypeName = 0xb754d6bd "tiff", m_eTypeID = CONTENT_TYPE_IMAGE_TIFF, 
      m_pExtension = 0xb754d6bc ""}
    (gdb) p pMap[62]
    $2 = {m_pTypeName = 0xb754d54f "txt", m_eTypeID = CONTENT_TYPE_TEXT_PLAIN, 
      m_pExtension = 0xb754d6bc ""}


Just for good measure, the following code does (rightly!) make
the assertion fire.

    int tje_20100316() {
      //
      // Make assertion in seekEntry fire for bad sequence in the
      // array to be searched.
      //
    
      MediaTypeEntry const mteBad[] =
        {
                { "txt", CONTENT_TYPE_TEXT_PLAIN, "" },
                { "tiff", CONTENT_TYPE_IMAGE_TIFF, "" },
        };
      UniString            extn = UniString::CreateFromAscii( "txt" );
      MediaTypeEntry const *pEntry =
        seekEntry( extn, mteBad, sizeof( mteBad ) / sizeof( mteBad[ 0 ] ) );
    
      return 0;
    
    
    } // tje_20100316


If any of this information is worth recording in the issue, I can 
do that.

Hope this helps.
Terry.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to