#225 Immediate Crashing on Fedora 20 with up to date dependencies

USDX trunk
closed
nobody
1
2014-06-12
2014-03-17
hfukada
No

I was having trouble getting ultrastardx to compile with more up to date libraries such as libpng16/14/12, libprojectM2 and lua5.2. I finally got it to compile, however ultrastar immediately crashes. I assume having to do with the ELuaException.

ERROR: pcre not loaded. utf-8 autodetection will not work.
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
An unhandled exception occurred at $000000000046F608 :
ELuaException : attempt to index a nil value
$000000000046F608
$00007F30A273704A

Discussion


  • Anonymous
    2014-03-17

    Some ideas:
    1) libpcre seems missing
    2) portaudio does not find a jack server
    3) The crash seems to come from lua. 5.2 may have a strange configuration, since there is no default any longer. 5.1 is a safer version.

    MiSchi

     
  • Hmm yes, I think the problem should be with lua 5.2, the jack server missing warning does not prevents the game from running.

    I have a fedora setup here too, and could reproduce the error (with lua 5.2.2), I will take a look if I can find why this is happening.

     
  • The crucial point to detect lua is the pkgconfig file for lua. This file (lua.pc or similar) should be somewhere in /usr/local/lib/pkgconfig. If you can't find it for version 5.2, take version 5.1 or pass the corresponding information to ./configure.

     
  • Hi,

    The detection seems to be working correctly by the configure file, take a look at the messages:

    checking for lua5.2... no
    checking for lua5.1... no
    checking for lua >= 5.1... yes
    checking version of lua... [5.2.2]

    If I understood correctly the two first checks are for *buntu's, and the other one for linux/macosx

    As a workaround, you can remove (or even better, rename) the plugin folder because the crash is during the plugin load. (but then, the party mode will be disabled).

    Maybe it's something in the actual code, and not in the translation (I tried with the lua52.pas from http://lua-users.org/wiki/LuaInFreePascal instead of the ULua.pas and got the same behavior, although I can't be sure since I changed some types to make it compile).

    Will keep searching.

     
  • Changing the PrepareState procedure in ULuaCore.pas to this:

    procedure TLuaCore.PrepareState(L: Plua_State);
    begin
    // load basic lib functionality
    //lua_checkstack(L, 3);
    lual_openLibs(L);
    lua_pop(L, 1);

    // get package.loaders table
    lua_getGlobal (L, PChar('package'));
    lua_getfield(L,-1,PChar('searchers'));

    {**** Move C-Library and all-in-one module loader backwards,
    slot 3 is free now }
    // get package.loaders[4] function
    lua_pushinteger(L, 5); // push new index
    lua_pushinteger(L, 4); // push old index
    lua_gettable (L, -3);

    // and move it to package.loaders[5]
    lua_settable (L, -3);

    // get package.loaders[3] function
    lua_pushinteger(L, 4); // push new index
    lua_pushinteger(L, 3); // push old index
    lua_gettable (L, -3);

    // and move it to package.loaders[4]
    lua_settable (L, -3);

    {**** now we add the core module to package.loaders[3] }
    lua_pushinteger(L, 3); // push new loaders index
    lua_pushcfunction(L, TLuaCore_ModuleLoader);

    // and move it to package.loaders[3]
    lua_settable (L, -3);

    // pop both package and package.loaders tables from stack
    lua_pop(L, 2);

    {**** replace the standard require with our custom require function }
    // first move standard require function to _require
    lua_getglobal(L, PChar('require'));

    lua_setglobal(L, PChar('_require'));

    // then save custom require function to require
    lua_pushcfunction(L, TLua_CustomRequire);

    lua_setglobal(L, PChar('require'));

    {**** now we create the usdx table }
    // at first functions from ULuaUsdx
    luaL_register(L, 'Usdx', @ULuaUsdx_Lib_f[0]);
    end;

    Make the game run again, but it still can't load the plugins, it fails in the "Usdx.Party.Register(Mode)" line of the lua scripts, again with the "attempt to index field 'Party' (a nil value)". I still did not found what the Party problem is (too much alcohol? hehe).

     
    Last edit: Brian Chalega da Silva 2014-04-13
  • Hi, I think I got it now, but I still don't understand this well yet.

    I modified two functions, they are in this paste:
    http://pastebin.com/M9EkKibz

    Now it runs and load the plugins, but I still had no time to make a proper patch (don't know if that code would work in 5.1, I think some ifdefs will be needed here and there).

    Also would be nice to check the balance of the stack, I guess some functions are pushing more than popping (but I think that although a bad practice, this should not cause problems since the stack is cleaned after every plugin load).

    One can even change the "lua_pop(L,1)" to "lua_pop(L,10)" in TLuaCore_LoadModule for example, and it stills runs, so I guess there's much more than what is needed there.

    About the LoadModule function, it's also weird that at least from what I understood, the function is not in the top of the stack as it was before, but even so it did not caused any problem as far as I saw.

     
  • Sorry for the long delay, I attached a patch that seems to be working with both 5.1 and 5.2 (but testing would be very appreciated! :)

    I saw that there seems to be a memory leak in some plugins (also with lua 5.1), but it don't seem to be related with this bug here, so I will take a look at this later.

     
  • hfukada
    hfukada
    2014-05-11

    I will take a look at this when I get back to my fedora computer. I'll post again if this does not work.

     


Anonymous


Cancel   Add attachments