ryzom / ryzomcore

Ryzom Core is the open-source project related to the Ryzom game. This community repository is synchronized with the Ryzom Forge repository, based on the Core branch.
https://wiki.ryzom.dev
GNU Affero General Public License v3.0
330 stars 89 forks source link

ryzom_client crashes on start with unprotected error in call to Lua API #55

Closed ryzom-pipeline closed 10 years ago

ryzom-pipeline commented 10 years ago

Original report by koanhead_fgsea (Bitbucket: koanhead_fgsea, ).


Using Ryzom on Debian Sid, installed from ryzom-isv PPA for Ubuntu Precise. Starting ryzom.sh gives this error message:

"PANIC: unprotected error in call to Lua API (attempt to index a nil value)"

ryzom-pipeline commented 10 years ago

Original comment by koanhead_fgsea (Bitbucket: koanhead_fgsea, ).


I believe this is a dependency issue in Debian. I have both liblua5.1-0 and liblua5.2-0 packages installed. nmap depends on liblua5.2-0, and ryzom-client does not work with liblua5.2 (so I have read, but I can't find the link just now- I will post it later if I can find it again.)

Current state:

me@here:/etc/apt$ aptitude why liblua5.2-0 i nmap Depends liblua5.2-0 me@here:/etc/apt$ aptitude why liblua5.1-0 i ryzom Depends liblua5.1-0 me@here:/etc/apt$ sudo apt-get remove liblua5.2-0 [sudo] password for me: Reading package lists... Done Building dependency tree
Reading state information... Done The following packages will be REMOVED: liblua5.2-0 libluabind0.9.1 librpm3 librpmbuild3 librpmio3 librpmsign1 nmap python-rpm rpm-common ryzom 0 upgraded, 0 newly installed, 10 to remove and 48 not upgraded. After this operation, 53.1 MB disk space will be freed. Do you want to continue? [Y/n] n Abort.

As you can see, removing 5.2 wants to take ryzom away as well, even though aptitude does not know about such a dependency.

So, currently Debian (and probably also Ubuntu) users can't have both nmap and ryzom. I will fiddle with apt-prefs later today and see if I can sort this out. When I've got it done I will post the fix here.

Is there any prospect of ryzom 'upgrading' to lua 5.2?

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


I suspect you were using data from Ryzom Core client or official Ryzom client. In them, .lua files are not compatible with lua 5.2 (the math.mod function doesn't exist anymore).

Kaetemi fixed Ryzom Core with Lua 5.2 and it was working fine on my PC with modified lua files (those in Ryzom Core mercurial).

ryzom-pipeline commented 10 years ago

Original comment by koanhead_fgsea (Bitbucket: koanhead_fgsea, ).


me@here:/etc/apt$ apt-cache policy ryzom ryzom: Installed: 2.1.0.2814-0ubuntu1 Candidate: 2.1.0.2814-0ubuntu1 Version table: *** 2.1.0.2814-0ubuntu1 0 500 http://ppa.launchpad.net/ryzom-isv/ppa/ubuntu/ precise/main amd64 Packages 100 /var/lib/dpkg/status

What I've installed is what came from ryzom-isv (I assume this is the 'official' client for Ubuntu, but it could be the kervala-ppa one or something else) as I've not made any changes.

So, I could pull the new files via mercurial and patch my install, but APT might zap them later. I could build the whole client and just use it, but I'd rather use (and try to help debug) the existing package. If the changes in the new files will propagate to the ryzom-isv package, then I'll close this bug. Or I guess you (Cedric) can, since you're a (the?) PPA maintainer and would know what's going on. I can live with waiting until then (or just play Ryzom on my laptop :^) My main concern is how this situation affects / will affect other users, since I have plenty of workarounds available for my own use. By the way, thanks for responding so quickly, and thanks again for providing this great game!

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


Oops sorry, in this case, you must have a Ryzom client version that is using lua 5.1 :(

That's very strange that conflict with lua 5.2 because both versions should be installed in their own directory and shouldn't conflict...

I'll try to build a new version in my PPA and perhaps should I create a luabind package compatible with lua 5.2 either.

ryzom-pipeline commented 10 years ago

Original comment by koanhead_fgsea (Bitbucket: koanhead_fgsea, ).


me@here:/var/log$ apt-cache show ryzom
Package: ryzom
Priority: extra
Section: games
Installed-Size: 27384
Maintainer: Cédric OCHS <kervala@gmail.com>
Architecture: amd64
Version: 2.1.0.2814-0ubuntu1
Depends: libc6 (>= 2.11), libcurl3 (>= 7.16.2-1), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libjpeg8 (>= 8c), liblua5.1-0, libluabind0.9.1, libopenal1, libpng12-0 (>= 1.2.13-4), libstdc++6 (>= 4.6), libvorbis0a (>= 1.1.2), libvorbisfile3 (>= 1.1.2), libx11-6, libxml2 (>= 2.7.4), libxrandr2, libxrender1, libxxf86vm1, zlib1g (>= 1:1.1.4), rsync, wget, p7zip-full, zenity
Filename: pool/main/r/ryzom/ryzom_2.1.0.2814-0ubuntu1_amd64.deb
Size: 11149984
MD5sum: 568d81541bbc81dd0e544740bbb6d8f7

and yet:

me@here:/var/log$ sudo apt-get install ryzom
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  liblua5.2-0 libluabind0.9.1
The following NEW packages will be installed:
  liblua5.2-0 libluabind0.9.1 ryzom
0 upgraded, 3 newly installed, 0 to remove and 61 not upgraded.
Need to get 11.2 MB/11.3 MB of archives.
After this operation, 28.4 MB of additional disk space will be used.

So, liblua5.2 is not listed in Depends: for ryzom package, but is pulled in when installing ryzom?! That makes no sense.

Pretty sure that's not your fault though. I might need to file a bug on APT since the package database is returning inconsistent results. I just don't know.

I agree there shouldn't be conflict with 5.1 vs 5.2. I tried removing 5.2 (no nmap for me for now) and ryzom. I didn't dare try removing 5.1 because too many packages depend on it.

I re-installed ryzom, and sure enough it pulled in liblua5.2 and sure enough it still won't run. This is installed from http://ppa.launchpad.net/ryzom-isv/ppa/ubuntu/ precise/main. I don't know if this is what you mean by your PPA (I notice there's another one with a 'ryzom-core' package at https://launchpad.net/~kervala/+archive/ppa).

I don't know if any of this is useful information, but I need to keep track of it anyhow and this seems as good a place as any ;^) I will report back if/when I find out why APT is acting weird.

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


Today I tried Ryzom under Ubuntu 13.10 (lua 5.1.5 and luabind 0.9.1) and there are my results :

Program received signal SIGSEGV, Segmentation fault.
#0  index2adr (L=0x3ccc6c0, idx=-1001000) at lapi.c:71
#1  0x00007ffff509ed89 in lua_gettable (L=0x3ccc6c0, idx=<optimized out>)
    at lapi.c:537
#2  0x00007ffff4e8a652 in luabind::detail::class_registry::get_registry (
    L=L@entry=0x3ccc6c0) at src/class_registry.cpp:134
#3  0x00007ffff4e8fc2e in luabind::open (L=0x3ccc6c0) at src/open.cpp:119
#4  0x00007ffff65c97a4 in NLGUI::CLuaState::CLuaState(bool) ()
   from /home/kervala/prog/ryzomcore/code/build/lib/libnelgui.so.0
#5  0x00007ffff6521108 in NLGUI::CLuaManager::CLuaManager() ()
   from /home/kervala/prog/ryzomcore/code/build/lib/libnelgui.so.0
#6  0x00007ffff64b3b3d in NLGUI::CInterfaceParser::initLUA() ()
   from /home/kervala/prog/ryzomcore/code/build/lib/libnelgui.so.0
#7  0x000000000095efcc in CInterfaceManager::initLUA() ()
#8  0x000000000095f7c2 in CInterfaceManager::initLogin() ()
#9  0x00000000007db2ac in login() ()
#10 0x0000000000623053 in main ()
---PANIC: unprotected error in call to Lua API (attempt to index a nil value)
Program received signal SIGSEGV, Segmentation fault.
#0  index2adr (L=0x23615f0, idx=-1001000) at lapi.c:71
#1  0x00007ffff54c4d89 in lua_gettable (L=0x23615f0, idx=<optimized out>)
    at lapi.c:537
#2  0x00007ffff52b0652 in luabind::detail::class_registry::get_registry (
    L=L@entry=0x23615f0) at src/class_registry.cpp:134
#3  0x00007ffff52b5c2e in luabind::open (L=0x23615f0) at src/open.cpp:119
#4  0x0000000000c8a57f in CLuaState::CLuaState (this=0x23da930)
    at /build/buildd/ryzom-core-0.8.2802~raring1/ryzom/client/src/interface_v3/lua_helper.cpp:219
#5  0x0000000000b1fe75 in CInterfaceParser::initLUA (this=this@entry=0x23d72e0)
    at /build/buildd/ryzom-core-0.8.2802~raring1/ryzom/client/src/interface_v3/interface_parser.cpp:4663
#6  0x0000000000c44ab4 in CInterfaceManager::initLogin (
    this=this@entry=0x23d72e0)
    at /build/buildd/ryzom-core-0.8.2802~raring1/ryzom/client/src/interface_v3/interface_manager.cpp:443
#7  0x000000000092dc27 in login ()
    at /build/buildd/ryzom-core-0.8.2802~raring1/ryzom/client/src/login.cpp:824
#8  0x00000000006dbad8 in main (argc=<optimized out>, argv=<optimized out>)
    at /build/buildd/ryzom-core-0.8.2802~raring1/ryzom/client/src/client.cpp:560

I'll try if the problem only occurs with Lua 5.1.5 and 5.2.x, I don't think it's related to big NELGUI refactoring since the bug occurs too with older revisions.

It seems like Lua 5.1.5 is not initialized correctly :(

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


I followed the stack trace and it seems like -1001000 is a wrong value for LUA_REGISTRYINDEX, it should be -10000, but -1001000 is the same value as in Lua 5.2.

So I checked and I confirm, under Ubuntu 13.10, luabind is compiled with Lua 5.2 and we should check for Lua 5.2.

At least we are sure about the problem :)

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


Fixed: #55 ryzom_client crashes on start with unprotected error in call to Lua API

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


We should now detect the correct version of Lua (5.0, 5.1 or 5.2) used by Luabind :)

ryzom-pipeline commented 10 years ago

Original comment by Ki8slak (Bitbucket: Ki8slak, ).


Hi Cédric, i don't understand your "solution", plz can you explain how to resolve "PANIC: unprotected error in call to Lua API (attempt to index a nil value)".

im on ubuntu 12.04

ryzom-pipeline commented 10 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


Hi :) Sure ! If you compiled Ryzom client yourself, don't forget to update data with rsync (to get new BNP with Lua 5.2 fixes) but if you're using a already compiled one, it should work.

ryzom-pipeline commented 10 years ago

Original comment by Ki8slak (Bitbucket: Ki8slak, ).


Thx ;) i used software center. when I was on ubuntu 13.01 it worked well

i tried reinstal but noway..

ryzom-pipeline commented 8 years ago

Original comment by Bartosz Firyn (Bitbucket: sarxos, GitHub: sarxos).


Just FYI, I have the same issue:

PANIC: unprotected error in call to Lua API (attempt to index a nil value)

I'm on Ubuntu 14.04 with both liblua5.2 and liblua5.1 present. Ryzom installed from Software Center.

ryzom-pipeline commented 8 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


I'm sorry but Canonical doesn't reply anymore to my emails asking to upload the client in Ubuntu Software Center :( So I don't think it will be updated anymore and it's not adapted for recent Ubuntu versions such as 14.04 that is using Lua 5.2.

I suggest you to uninstall it and install ryzom package from ppa : ppa:ryzom-isv/ppa (it has been updated in june)

ryzom-pipeline commented 8 years ago

Original comment by Bartosz Firyn (Bitbucket: sarxos, GitHub: sarxos).


Hi Cédric. Thank you for the suggestion - it works well.

For the other people who face the same issue. The steps to be performed are:

  1. uninstall Ryzom (remember to backup your markers and macros),
  2. remove Ryzom ppa added by Ubuntu Software Center (this is important and can be done by navigating to Software & Updates > Other Software),
  3. add new one by sudo add-apt-repository ppa:ryzom-isv/ppa and then sudo apt-get update,
  4. install Ryzom again by sudo apt-get install ryzom

The important thing to mention is the fact that after Ryzom installed in such a way is run for the first time it takes hours to download necessary bnp files so please be patient since it has to download almost 7 GB of data.

Also, the weird thing is the fact that on my other PC, where I also have Ubuntu 14.04 with both liblua5.1 and liblua5.2 installed, the Ryzom from Ubuntu Software Center works just fine.

ryzom-pipeline commented 8 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


You're welcome :)