Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - main.lua: main.lua:18: attempt to call method 'load' (a nil value) #5

Closed
masterzu opened this issue Jan 13, 2011 · 6 comments
Closed

Comments

@masterzu
Copy link

An error occurs when I try to launch the game

$ ./src/jvgs
Error - main.lua: main.lua:18: attempt to call method 'load' (a nil value)

Context:
Linux / ubuntu 8.04 sous amd64;
SDL 1.2-4
cmake : 2.6.2
swig : 1.3.33
lua: 5.1

I try the download version 0.5 and the git version (JVGS-4f74aec of the 11 jan 2011) with the same result.

@jaspervdj
Copy link
Owner

What happens if you comment out that line?

@masterzu
Copy link
Author

It's work :) ..... just un moment :(

When I begin de tutorial zone and jump the first isles sequence, it crash with the message:
Segmentation fault

Is there a option to be more verbose ?

@jaspervdj
Copy link
Owner

I'm not sure what caused the bug, and I'm not sure why load doesn't work either. Could you try running it using gdb? Use gdb ./src/jvgs to bring up the gdb prompt. Enter run to run the game. When the game crashes, you should be able to enter bt (for backtrace). This backtrace allows me to see where exactly the game crashes.

@masterzu
Copy link
Author

Thanks for you help jasper :)

The command gdb ./src/jvgs, during the run, just freeze my computer :( (because of the fullscreen I suppose)

With the gdb --args ./src/jvgs main.lua --width 800 --height 600, when I do run, bt it give me :

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f5bbf88a730 (LWP 8390)]
0x00000000007775e0 in ?? ()
(gdb) bt
\#0  0x00000000007775e0 in ?? ()
\#1  0x00000000004aa400 in jvgs::effect::EffectManager::update (this=0x747d20, ms=5)
    at /home/patrick/perso/jvgs/jaspervdj-JVGS4f74aec/src/effect/EffectManager.cpp:43
\#2  0x00000000004c86c4 in jvgs::game::LevelManager::run (this=0x748040)
    at /home/patrick/perso/jvgs/jaspervdj-JVGS4f74aec/src/game/LevelManager.cpp:84
\#3  0x000000000046862d in _wrap_LevelManager_run (L=0x74a2a0) at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/bind/jvgslua.cpp:14332
\#4  0x00007f5bbf642231 in ?? () from /usr/lib/liblua5.1.so.0
\#5  0x00007f5bbf64c473 in ?? () from /usr/lib/liblua5.1.so.0
\#6  0x00007f5bbf64269e in ?? () from /usr/lib/liblua5.1.so.0
\#7  0x00007f5bbf641de7 in ?? () from /usr/lib/liblua5.1.so.0
\#8  0x00007f5bbf641e65 in ?? () from /usr/lib/liblua5.1.so.0
\#9  0x00007f5bbf63df05 in lua_pcall () from /usr/lib/liblua5.1.so.0
\#10 0x0000000000456ec6 in jvgs::bind::ScriptManager::runScript (this=0x746a20, fileName=@0x7fff64ba73b0)
at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/bind/ScriptManager.cpp:44
#11 0x0000000000456c91 in main (argc=6, argv=0x7fff64ba74b8) at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/main.cpp:28

PS: I add the character \ before all # because Markdown syntax change it to link :) and I don't know how to disabled this

@jaspervdj
Copy link
Owner

Hmm, I think I know why this is caused. For some reason the generated SWIG wrapper does not "disown" the effects, which it should.

Could you try replacing src/bind/jvgslua.cpp by this file and compiling again (using make)?

@masterzu
Copy link
Author

It crash again.

the gdb bt command say:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f28fd7f4730 (LWP 15828)]
0x0000000500000001 in ?? ()
(gdb) bt
#0 0x0000000500000001 in ?? ()
#1 0x00000000004aa400 in jvgs::effect::EffectManager::update (this=0x747d20, ms=11)
at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/effect/EffectManager.cpp:43
#2 0x00000000004c86c4 in jvgs::game::LevelManager::run (this=0x748040)
at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/game/LevelManager.cpp:84
#3 0x000000000046862d in _wrap_LevelManager_run (L=0x74a2a0) at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/bind/jvgslua.cpp:14332
#4 0x00007f28fd5ac231 in ?? () from /usr/lib/liblua5.1.so.0
#5 0x00007f28fd5b6473 in ?? () from /usr/lib/liblua5.1.so.0
#6 0x00007f28fd5ac69e in ?? () from /usr/lib/liblua5.1.so.0
#7 0x00007f28fd5abde7 in ?? () from /usr/lib/liblua5.1.so.0
#8 0x00007f28fd5abe65 in ?? () from /usr/lib/liblua5.1.so.0
#9 0x00007f28fd5a7f05 in lua_pcall () from /usr/lib/liblua5.1.so.0
#10 0x0000000000456ec6 in jvgs::bind::ScriptManager::runScript (this=0x746a20, fileName=@0x7fffd158f600)
at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/bind/ScriptManager.cpp:44
#11 0x0000000000456c91 in main (argc=6, argv=0x7fffd158f708) at /home/patrick/perso/jvgs/jaspervdj-JVGS-4f74aec/src/main.cpp:28

PS: the versions of the old and new file are very different : 1.3.3 to 2.0.1 !!!!

My swig version may be too old, isn't it ?

for ubuntu, only the last version (natty) have the swig 2.0 version available.Dont I need the install from source the latest (2.0.1) version ?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants