Page 1 of 1

segfault using 64-bit arch linux

Posted: Fri Jan 27, 2012 2:40 pm
by crapture
I downloaded the newest version of t-engine (i.e. ToME and T-Engine 4 1.0.0 Beta 37 aka "Dawn of Victory") and I get a segfault when I try to run it. For some reason, the version of tome4 from the arch repos work though.

This is the output from GDB:

[CPU] Detected 8 CPUs
OpenAL device available: ALSA Software on default (default ALSA Software on default)
OpenAL device available: ALSA Software on HDA Intel (default ALSA Software on default)
OpenAL device available: OSS Software (default ALSA Software on default)
OpenAL device available: Wave File Writer (default ALSA Software on default)
ALSA lib dlmisc.c:236:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib32/alsa-lib/libasound_module_pcm_pulse.so
ALSA lib dlmisc.c:236:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib32/alsa-lib/libasound_module_pcm_pulse.so
AL lib: alsa.c:344: Could not open playback device 'default': No such device or address
AL lib: oss.c:179: Could not open /dev/dsp: No such file or directory
Available video driver: x11
Available video driver: dummy
Segmentation fault

(gdb) run
Starting program: /home/user/Downloads/tengine/t-engine4-linux32-1.0.0beta37/t-engine
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[CPU] Detected 8 CPUs
OpenAL device available: ALSA Software on default (default ALSA Software on default)
OpenAL device available: ALSA Software on HDA Intel (default ALSA Software on default)
OpenAL device available: OSS Software (default ALSA Software on default)
OpenAL device available: Wave File Writer (default ALSA Software on default)
ALSA lib dlmisc.c:236:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib32/alsa-lib/libasound_module_pcm_pulse.so
ALSA lib dlmisc.c:236:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib32/alsa-lib/libasound_module_pcm_pulse.so
AL lib: alsa.c:344: Could not open playback device 'default': No such device or address
AL lib: oss.c:179: Could not open /dev/dsp: No such file or directory
Available video driver: x11
Available video driver: dummy
[New Thread 0xf72e1b40 (LWP 2534)]
[New Thread 0xf5b6cb40 (LWP 2535)]
[New Thread 0xf536bb40 (LWP 2536)]
[New Thread 0xf4b6ab40 (LWP 2537)]
[New Thread 0xf4369b40 (LWP 2538)]
[New Thread 0xf3b68b40 (LWP 2539)]
[New Thread 0xf3367b40 (LWP 2540)]
[New Thread 0xf2b66b40 (LWP 2541)]
[New Thread 0xf2365b40 (LWP 2542)]

Program received signal SIGSEGV, Segmentation fault.
X11_DestroyWindowFramebuffer (_this=0x81a9fd8, window=0x81d3c10) at src/video/x11/SDL_x11framebuffer.c:193
193 src/video/x11/SDL_x11framebuffer.c: No such file or directory.
(gdb) bt
#0 X11_DestroyWindowFramebuffer (_this=0x81a9fd8, window=0x81d3c10) at src/video/x11/SDL_x11framebuffer.c:193
#1 0xf7f378aa in SDL_DestroyWindow (window=0x81d3c10) at src/video/SDL_video.c:1949
#2 0xf7f37f53 in SDL_CreateWindow (title=0xf7f5de3c "OpenGL test", x=-32, y=<optimized out>, w=32, h=32, flags=10) at src/video/SDL_video.c:1187
#3 0xf7f382b8 in ShouldUseTextureFramebuffer () at src/video/SDL_video.c:169
#4 SDL_VideoInit (driver_name=0x0) at src/video/SDL_video.c:509
#5 0x08050697 in main (argc=1, argv=0xffffd614) at ../src/main.c:986

Thanks in advance if you can be of any possible help.

Re: segfault using 64-bit arch linux

Posted: Fri Jan 27, 2012 6:04 pm
by tiger_eye
Try disabling framebuffers:

Create the file "$HOME/.t-engine/4.0/settings/fbo_active.cfg" and put one line in it "fbo_active = false".

Re: segfault using 64-bit arch linux

Posted: Fri Jan 27, 2012 8:57 pm
by crapture
I got the same error after applying your fix. Since that didn't work, I saw that there was a new version of sdl-hg in the repos. I installed it and it broke the repo version of tome 4 that was working. Ugh. I tried reinstalling tome 4, but it won't let me anymore, presumably because of sdl-hg. I doubt this is even the same problem anymore, so I don't know if I shold start a new thread or what. Anyways, I get the following error message when trying to install tome from the repos:

../src/core_lua.c:42:1: error: unknown type name ‘SDL_Window’
../src/core_lua.c: In function ‘lua_get_scancode_name’:
../src/core_lua.c:196:2: error: unknown type name ‘SDL_Scancode’
../src/core_lua.c:197:2: warning: passing argument 2 of ‘lua_pushstring’ makes pointer from integer without a cast [enabled by default]
../src/luajit2/src/lua.h:164:16: note: expected ‘const char *’ but argument is of type ‘int’
../src/core_lua.c: In function ‘lua_flush_key_events’:
../src/core_lua.c:203:31: error: ‘SDL_TEXTINPUT’ undeclared (first use in this function)
../src/core_lua.c:203:31: note: each undeclared identifier is reported only once for each function it appears in
../src/core_lua.c: In function ‘lua_key_set_clipboard’:
../src/core_lua.c:216:14: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
../src/core_lua.c: In function ‘lua_key_get_clipboard’:
../src/core_lua.c:225:15: warning: initialization makes pointer from integer without a cast [enabled by default]
../src/core_lua.c: In function ‘sdl_set_mouse_cursor’:
../src/core_lua.c:1800:21: warning: assignment makes pointer from integer without a cast [enabled by default]
../src/core_lua.c:1818:16: warning: assignment makes pointer from integer without a cast [enabled by default]
make[1]: *** [../obj/Debug/TEngine/core_lua.o] Error 1
make: *** [TEngine] Error 2

Re: segfault using 64-bit arch linux

Posted: Sun Jan 29, 2012 7:43 am
by atan59
I had the same problem (also in a 64-bit arch linux) and the simple fix was to install a bunch of 32 bit versions of libraries. Sadly, I didn't write down exactly which ones, I basically did a

Code: Select all

 pacman -Ss lib32
and then installed whichever seemed reasonably relevant, trying to run ToME periodically, until it worked!

Re: segfault using 64-bit arch linux

Posted: Fri Mar 02, 2012 9:03 pm
by Shadowman
I am having the same problem with the newest version. Any idea what libraries are needed?

Re: segfault using 64-bit arch linux

Posted: Fri Mar 02, 2012 11:10 pm
by madmonk
You might want to look here on the wiki

http://te4.org/wiki/howtocompile

Scroll down to the Linux section and check it out. You will have to adjust the library choice to cater for 64bit versions but I don't see that as an issue!

Re: segfault using 64-bit arch linux

Posted: Fri Mar 02, 2012 11:46 pm
by tiger_eye
I would recommend using hg6166 commit of SDL. Things become incompatible shortly after that. One it's installed, use the sdl-config that was just installed to find out what lib and c compiler options should be used in the make file (build/TEngine.make): "sdl-config --libs" and "sdl-config --cflags"

I build t-engine in 64bit in linux, and it's basically the same as building in 32bit.

Re: segfault using 64-bit arch linux

Posted: Tue Mar 20, 2012 4:55 pm
by MarcusIronfist
Sorry about the bump...

New t-engine user, long-time RPG player (including nethack, rogue, and their "children")...

Trying to compile on a 64bit Gentoo-based (called Sabayon) Linux, I get:

Code: Select all

../src/wait.c:32:1: error: unknown type name ‘SDL_Window’
I have the most recent version of SDL (1.2.15) installed... Added "-lSDL" to the "LIBS" line of TEngine.make, after adding "/src/include/SDL" into the includedirs list of the premake4.lua file...

What am I missing?

Re: segfault using 64-bit arch linux

Posted: Tue Mar 20, 2012 7:47 pm
by yufra
MarcusIronfist wrote: I have the most recent version of SDL (1.2.15) installed... Added "-lSDL" to the "LIBS" line of TEngine.make, after adding "/src/include/SDL" into the includedirs list of the premake4.lua file...

What am I missing?
You are using the most recent version of SDL 1.2, but ToME is currently compiled against the developmental branch of SDL 2.0. You need to follow the instructions here to get Mercurial branch and then run this command in the SDL directory to get the Mercurial commit that we are confident works with ToME:

Code: Select all

hg update 6166
Then compile SDL, and try compiling ToME. Good luck!

Re: segfault using 64-bit arch linux

Posted: Wed Mar 21, 2012 12:48 am
by MarcusIronfist
yufra wrote:
MarcusIronfist wrote: I have the most recent version of SDL (1.2.15) installed... Added "-lSDL" to the "LIBS" line of TEngine.make, after adding "/src/include/SDL" into the includedirs list of the premake4.lua file...

What am I missing?
You are using the most recent version of SDL 1.2, but ToME is currently compiled against the developmental branch of SDL 2.0. You need to follow the instructions here to get Mercurial branch and then run this command in the SDL directory to get the Mercurial commit that we are confident works with ToME:

Code: Select all

hg update 6166
Then compile SDL, and try compiling ToME. Good luck!
Umm, I actually did try compiling the 2.0 of SDL, but the configure script died when it couldn't find a util called "windres"... Which is why I got the Mercurial for the 1.2.15...

Interestingly enough, after doing that "hg update 6166", the "windres" doesn't cause an issue... SDL compiled fine and installed (with "make install").

After all that, I am still running into the same error from the TEngine compile... Here's a weird thing: the README file in the SDL devel folder says "Version 1.3", not "2.0"... The README file in the SDL-1.2 devel folder says "Version 1.2"...

EDIT:

Ok, turns out the newly compiled 1.2 AND 1.3 (2.0??) SDL files were installing to /usr/local/lib, not /usr/lib... Same with the includes (/usr/local/include/SDL instead of /usr/include/SDL)...

After rearranging the files, I now get a different error:

Code: Select all

../src/music.c: In function ‘loadsoundLua’:
../src/music.c:278:3: warning: passing argument 2 of ‘SDL_CreateThread’ from incompatible pointer type [enabled by default]
/usr/include/SDL/SDL_thread.h:145:1: note: expected ‘const char *’ but argument is of type ‘struct Sound *’
../src/music.c:278:3: error: too few arguments to function ‘SDL_CreateThread’
/usr/include/SDL/SDL_thread.h:145:1: note: declared here

Re: segfault using 64-bit arch linux

Posted: Wed Mar 21, 2012 7:49 am
by bugmenot
The old sdl-hg versions that I would need to build tome4 have now themselves become impossible to compile on my machine without downgrading / freezing more packages.

Re: segfault using 64-bit arch linux

Posted: Wed Mar 21, 2012 10:50 am
by MarcusIronfist
bugmenot wrote:The old sdl-hg versions that I would need to build tome4 have now themselves become impossible to compile on my machine without downgrading / freezing more packages.
Good to know I'm not alone with this problem...

I originally tried running the pre-complied 32bit version, but could never get past the box with the bouncing scrollbar which said "generating dungeon"...

Re: segfault using 64-bit arch linux

Posted: Wed Mar 21, 2012 11:33 am
by darkgod
What did the log say ??

Re: segfault using 64-bit arch linux

Posted: Thu Mar 22, 2012 1:23 am
by MarcusIronfist
darkgod wrote:What did the log say ??
What log? I did not find a log file from the 32bit version anywhere...


EDIT:

I've found the solve for the SDL_CreateThread problem.

Code: Select all

../src/music.c: In function ‘loadsoundLua’:
../src/music.c:278:3: warning: passing argument 2 of ‘SDL_CreateThread’ from incompatible pointer type [enabled by default]
/usr/include/SDL/SDL_thread.h:145:1: note: expected ‘const char *’ but argument is of type ‘struct Sound *’
../src/music.c:278:3: error: too few arguments to function ‘SDL_CreateThread’
/usr/include/SDL/SDL_thread.h:145:1: note: declared here
The solution is posted here http://forums.te4.org/viewtopic.php?f=4 ... eatethread (posted by yufra on Wed Oct 19, 2011 12:36 am).

Now I'm running into a different error:

Code: Select all

../src/main.c: In function ‘on_event’:
../src/main.c:340:9: error: ‘SDL_BUTTON_WHEELUP’ undeclared (first use in this function)
../src/main.c:340:9: note: each undeclared identifier is reported only once for each function it appears in
../src/main.c:343:9: error: ‘SDL_BUTTON_WHEELDOWN’ undeclared (first use in this function)
The "defines" for "SDL_BUTTON_WHEELUP/WHEELDOWN" are in the SDL v1.2 include file of SDL_compat.h, which DOES NOT exist in the v2.0 of SDL... And from what I was told in the SDL irc chatroom, the mousewheel has been rewritten as an event instead of button triggers...

Re: segfault using 64-bit arch linux

Posted: Sun Mar 25, 2012 2:08 pm
by MarcusIronfist
Ok, after discussing the mousewheel issue with yufra and rectifier in the chatroom, I recompiled with the 6166 update of the SDL sources.

Everything compiled without errors and a t-engine binary was successfully built, but the binary segfaults.

Output from gdb:

Code: Select all

GNU gdb (Gentoo 7.4 p1) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /home/marcus/tomedev/t-engine4/t-engine...done.
(gdb) run
Starting program: /home/marcus/tomedev/t-engine4/t-engine 
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[CPU] Detected 1 CPUs
OpenAL device available: PulseAudio Default (default PulseAudio Default)
OpenAL device available: ALSA Default (default PulseAudio Default)
OpenAL device available: No Output (default PulseAudio Default)
Available video driver: x11
Available video driver: dummy
NO SELFEXE: bootstrapping from CWD
Booting T-Engine from: /home/marcus/tomedev/t-engine4/t-engine
SelfExe gave us app directory of:	/home/marcus/tomedev/t-engine4/
LuaVM:	LuaJIT 2.0.0-beta8	x64
Creating particles thread 0
LuaVM:	LuaJIT 2.0.0-beta8	x64
[DO RESIZE] 800x600 (0)
OpenGL max texture size: 4096

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7539357 in IMG_LoadPNG_RW ()
   from /usr/local/lib/libSDL_image-1.2.so.0
(gdb) bt
#0  0x00007ffff7539357 in IMG_LoadPNG_RW ()
   from /usr/local/lib/libSDL_image-1.2.so.0
#1  0x00007fff00ff0000 in ?? ()
#2  0x00000000ff000000 in ?? ()
#3  0x0000000000000000 in ?? ()
The library for SDL_image is "stock" 1.2.12 if that makes any difference...