PDA

View Full Version : Angband SegFault under FreeBSD


AronaDaal
January 2, 2008, 15:19
Hello,

I just installed Angband under FreeBSD (7 Beta 4) and I get an SegFault, when I try to start the game. See the gdb-output:

[aronadaal@daemonland /usr/home/aronadaal]$ gdb angband
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) run
Starting program: /usr/local/bin/angband
[New LWP 100127]
[New Thread 0x28601100 (LWP 100127)]

Program received signal SIGSYS, Bad system call.
[Switching to Thread 0x28601100 (LWP 100127)]
0x2830b9db in ksem_init () from /lib/libc.so.7
(gdb) backtrace
#0 0x2830b9db in ksem_init () from /lib/libc.so.7
#1 0x28301399 in sem_init () from /lib/libc.so.7
#2 0x28419f90 in SDL_CreateSemaphore () from /usr/local/lib/libSDL.so.11
#3 0x286250b8 in ?? ()
#4 0x00000000 in ?? ()
#5 0x00000000 in ?? ()
#6 0x28626780 in ?? ()
#7 0x00000206 in ?? ()
#8 0x28422db0 in __JCR_LIST__ () from /usr/local/lib/libSDL.so.11
#9 0x28622130 in ?? ()
#10 0x283d35d7 in SDL_CreateThread () from /usr/local/lib/libSDL.so.11
#11 0x00000000 in ?? ()
#12 0x00000000 in ?? ()
#13 0x00000318 in ?? ()
#14 0x28422db0 in __JCR_LIST__ () from /usr/local/lib/libSDL.so.11
#15 0x286267c4 in ?? ()
#16 0x282a3bdc in mixer () from /usr/local/lib/libSDL_mixer.so.2
#17 0x00000018 in ?? ()
#18 0x283c9eb7 in SDL_OpenAudio () from /usr/local/lib/libSDL.so.11
#19 0x281043f4 in ?? () from /libexec/ld-elf.so.1
#20 0xbfbfd544 in ?? ()
#21 0x280e1838 in dladdr () from /libexec/ld-elf.so.1
Previous frame inner to this frame (corrupt stack?)
(gdb)

If I try to install the game via "pkg_add -r" (precompiled sources), I can't save my games...
Can anyone please help me?

CU AronaDaal

pav
January 2, 2008, 15:29
D'oh, what's it doing in SDL damnit. Can you try to edit /usr/ports/games/angband/Makefile, adding --disable-sdl to line 22 and reinstall the port, if that would help?

As for cannot save the game, I guess it's because packages don't retain ownership of directories. Silly mistake of mine. I will look into that.

AronaDaal
January 2, 2008, 16:35
hmm... that doesn't solve my problem!

I modified the Makefile like this:

(...)
USE_GMAKE= yes
ALL_TARGET= #
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-setgid=games \
--disable-sdl
.if !defined(WITHOUT_X11)
USE_XORG= sm x11
CONFIGURE_ARGS+= --with-x
.else
CONFIGURE_ARGS+= --with-x=no
.endif
(...)

pav
January 2, 2008, 16:42
Can I see a new backtrace from gdb, please?

AronaDaal
January 2, 2008, 16:47
it seems that the switch does'nt work

[aronadaal@daemonland /usr/home/aronadaal]$ gdb angband
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) run
Starting program: /usr/local/bin/angband
[New LWP 100103]
[New Thread 0x28601100 (LWP 100103)]

Program received signal SIGSYS, Bad system call.
[Switching to Thread 0x28601100 (LWP 100103)]
0x2830b9db in ksem_init () from /lib/libc.so.7
(gdb) backtrace
#0 0x2830b9db in ksem_init () from /lib/libc.so.7
#1 0x28301399 in sem_init () from /lib/libc.so.7
#2 0x28419f90 in SDL_CreateSemaphore () from /usr/local/lib/libSDL.so.11
#3 0x286250b8 in ?? ()
#4 0x00000000 in ?? ()
#5 0x00000000 in ?? ()
#6 0x28626780 in ?? ()
#7 0x00000206 in ?? ()
#8 0x28422db0 in __JCR_LIST__ () from /usr/local/lib/libSDL.so.11
#9 0x28622130 in ?? ()
#10 0x283d35d7 in SDL_CreateThread () from /usr/local/lib/libSDL.so.11
#11 0x00000000 in ?? ()
#12 0x00000000 in ?? ()
#13 0x00000318 in ?? ()
#14 0x28422db0 in __JCR_LIST__ () from /usr/local/lib/libSDL.so.11
#15 0x286267c4 in ?? ()
#16 0x282a3bdc in mixer () from /usr/local/lib/libSDL_mixer.so.2
#17 0x00000018 in ?? ()
#18 0x283c9eb7 in SDL_OpenAudio () from /usr/local/lib/libSDL.so.11
#19 0x281043f4 in ?? () from /libexec/ld-elf.so.1
#20 0xbfbfd544 in ?? ()
#21 0x280e1838 in dladdr () from /libexec/ld-elf.so.1
Previous frame inner to this frame (corrupt stack?)
(gdb)

pav
January 2, 2008, 16:55
Can you try adding --disable-sdl-mixer to that line, too?

AronaDaal
January 2, 2008, 17:06
yeah! It works now, but I still cannot save my game... :(

pav
January 2, 2008, 17:22
Even if you rm -rf /usr/local/share/angband after you deinstall the package?

AronaDaal
January 2, 2008, 17:27
after deinstall the folder /usr/local/share/angband doen't exist anymore.

pav
January 2, 2008, 17:29
Good. Just making sure you're installing from port "make install", not adding the package?

AronaDaal
January 2, 2008, 18:32
yes! Always installing with "make install clean" and removing with pkd_delete angbandXYZ

pav
January 2, 2008, 18:37
Odd, works for me. Can you give me ls -l /usr/local/share/angband ?

Also, are you compiling and installing as root, or as a regular user and entering root password before the installation?

AronaDaal
January 2, 2008, 18:45
[aronadaal@daemonland /usr/home/aronadaal]$ ls -l /usr/local/share/angband
total 22
drwxrwxr-x 2 root games 512 Jan 2 17:26 apex
d---rwx--- 2 root games 512 Jan 2 17:26 bone
drwxrwxr-x 2 root games 512 Jan 2 17:26 data
drwxr-xr-x 2 root wheel 512 Jan 2 17:26 edit
drwxr-xr-x 2 root wheel 512 Jan 2 17:26 file
drwxr-xr-x 2 root wheel 512 Jan 2 17:26 help
drwxr-xr-x 2 root wheel 512 Jan 2 17:26 info
drwxr-xr-x 2 root wheel 1024 Jan 2 17:26 pref
d---rwx--- 2 root games 512 Jan 2 17:26 save
drwxr-xr-x 2 root wheel 512 Jan 2 17:26 user
drwxr-xr-x 5 root wheel 512 Jan 2 17:26 xtra
[aronadaal@daemonland /usr/home/aronadaal]$


no i'm logged in as root via "su"

pav
January 2, 2008, 19:13
Ok I think I see the problem - are you in the `games' group or not? You need to be :)

AronaDaal
January 2, 2008, 20:57
ah! That's it! But I think the normal way is, to put all savegame files in ~/.angband

or not?

pav
January 2, 2008, 21:12
Not necessarily - there are two canonical ways to install Angband. FreeBSD package is doing the traditional, system-wide installation, which allows multiple users on a machine to share high scores and bone files.

Granted, not much multi-user systems today to play Angband on...

AronaDaal
January 2, 2008, 21:28
I think you should add this little information to Makefile.
Do you already have an idea, whats the matter with the libsdl?

pav
January 2, 2008, 21:39
No idea - I will just disable it in the port.