← Back to team overview

mudlet-makers team mailing list archive

[Bug 1537906] Re: installModule() crashes if Module Manager not open

 

The function concerned is:

int TLuaInterpreter::installModule( lua_State * L)
{
    string modName;
    if ( ! lua_isstring( L, 1 ) )
    {
        lua_pushstring( L, "installModule: wrong first argument (should be a path to module)");
        lua_error( L );
        return 1;
    }
    else
        modName = lua_tostring( L, 1);
    Host * pHost = TLuaInterpreter::luaInterpreterMap[L];
    QString module = QDir::fromNativeSeparators(modName.c_str());
    if( pHost )
        if ( pHost->installPackage( module, 3 ) && mudlet::self()->moduleTableVisible() )
            mudlet::self()->layoutModules();
    return 0;
}

The conversion from the supplied argument has not been Utf8-ified (yet)
but that is not important, neither is is the conversion from native file
separators IMHO.  I think the test for
`mudlet::self()->moduleTableVisible()` SHOULD BE BEFORE
`pHost->installPackage( module, 3 )` - the evaluation order is wrong!

BTW what about the case where there is more than one profile active and
the module manager window is open FOR THE OTHER PROFILE?  I think we may
have issues with that sort of thing where there is a resource that is
shared between all the profiles but each profile thinks it can use the
common resource without checking that it is the "active" profile...

-- 
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
https://bugs.launchpad.net/bugs/1537906

Title:
  installModule() crashes if Module Manager not open

Status in Mudlet:
  New

Bug description:
  I'm getting this crash using latest release_30 branch
  (5dcf32ab3a7f780e2a439e8d5abb35e932350c82) code when trying to run the
  following only when the module manager window is not open:

  lua installModule([[/home/vadi/Games/Mudlet/svof/svo
  (burncounter).xml]])

  Thread 1 (Thread 0x7ffff7f9d7c0 (LWP 12723)):
  #0  0x000000000046ac24 in QWidget::testAttribute (this=0xf60324, attribute=Qt::WA_WState_Visible) at /usr/include/qt5/QtWidgets/qwidget.h:859
  No locals.
  #1  0x000000000046abfb in QWidget::isVisible (this=0xf60324) at /usr/include/qt5/QtWidgets/qwidget.h:821
  No locals.
  #2  0x00000000005a0351 in mudlet::moduleTableVisible (this=0xec9ca0) at mudlet.cpp:416
  No locals.
  #3  0x000000000065f2df in TLuaInterpreter::installModule (L=0x1d2c250) at TLuaInterpreter.cpp:11037
          modName = {static npos = <optimised out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x2f34db8 "/home/vadi/Games/Mudlet/svof/svo (burncounter).xml"}}
          pHost = 0x1ce4b60
          module = {static null = {<No data fields>}, d = 0x2f18c40}
  #4  0x00007ffff797af78 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
  No symbol table info available.

  If I open the module manager window, the command runs fine.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mudlet/+bug/1537906/+subscriptions


References