Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 307153 - games-strategy/freeciv-2.2.0 USE flags (IPv6, sdl-sound)
Summary: games-strategy/freeciv-2.2.0 USE flags (IPv6, sdl-sound)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-28 06:44 UTC by Boney McCracker
Modified: 2010-03-06 02:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Working Freeciv 2.2.0 (freeciv-2.2.0.png,465.02 KB, image/png)
2010-02-28 11:14 UTC, Steffen 'j0inty' Stollfuß
Details
strace (freeciv-gtk2.strace,1.07 MB, text/plain)
2010-03-01 22:44 UTC, Boney McCracker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boney McCracker 2010-02-28 06:44:17 UTC
This needs confirmation.  Sorry that I'm not able to offer much information on this (not set up for traces, and there's not even an error message).

From a working instance of freeciv-2.1.11, after upgrading to freeciv 2.2.0, and the application completely locks up when trying to start a game.

Reproducible: Always

Steps to Reproduce:
1. Upgrade to 2.2.0
2. Launch freeciv-gtk2
3. Click "New Game"
4. Flail around ineffectually, and eventually `kill $(pgrep freeciv)`

Actual Results:  
Application locks up.  X remains functional, but game interface becomes entirely non-functional.  Changing workspace and returning, only the game background is visible (not the buttons, graphics, etc.).  Kill -15 terminates it.

Expected Results:  
New game should start normally.

I originally had USE="-alsa sdl" (which was necessary to get sound on my machine and working fine with 2.1.11).  I removed those flags and emerged it without USE flags, but observed the same behavior.

Starting freeciv-gtk2 from the command line produces no error message upon failure, but ctrl+c does kill it successfully.  No relevant error messages in any logs.

As noted, I'm not set up to get useful traces.  I have masked it.  I wonder if anyone else has had this problem.

====================== emerge info ==============================

typhoon portage # emerge --info
Portage 2.1.7.17 (default/linux/x86/10.0, gcc-4.4.3, glibc-2.11-r1, 2.6.33-gentoo i686)
=================================================================
System uname: Linux-2.6.33-gentoo-i686-Intel-R-_Pentium-R-_4_CPU_1300MHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 27 Feb 2010 17:15:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p2
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4-r1, 3.1.1-r1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20-r1
sys-devel/gcc:       4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.32
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.gtlib.gatech.edu/pub/gentoo http://gentoo.osuosl.org/ http://open-systems.ufl.edu/mirrors/gentoo "
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1,--hash-style=gnu"
LINGUAS="en_US en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X alsa berkdb bzip2 cairo caps cli cracklib crypt cups cxx dbus dri exif ffmpeg gdbm gif gpm gtk hal iconv java jpeg lcms mmx modules mp3 mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre perl png python readline reflection session spl sse sse2 ssl svg sysfs theora threads tiff truetype unicode vorbis win32codecs x86 xcb xorg xulrunner zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LINGUAS="en_US en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Steffen 'j0inty' Stollfuß 2010-02-28 11:14:34 UTC
Created attachment 221523 [details]
Working Freeciv 2.2.0

Hi,

I used the freeciv-2.1.11 ebuild, too and I can't reproduce this error. My game is started as expected and working very well. I started a new game as you describe and myde this screenshot to show you that it works.

regards
j0inty
Comment 2 Boney McCracker 2010-02-28 18:45:13 UTC
Thanks for the feedback.

I uninstalled it, fully updated my system, rebuilt world, reinstalled it, and it still fails.  Tried various USE flag changes to no avail.

While preparing to specify minimal CFLAGS for the package in /etc/portage/env, I remembered that I already had freeciv-specific CFLAGS, adding "-fno-inline-small-functions" to my normal CFLAGS noted earlier.

This was to overcome some kind of bug in 2.1.11 that is (or at least was) documented in Bugzilla).

I'll try removing that and see what happens.
Comment 3 Boney McCracker 2010-02-28 20:11:43 UTC
Okay, after more investigation I know the following:

CFLAGS have nothing to do with it.

The client isn't freezing; it is waiting for the server to start.  If I wait long enough (about 1 minute), the following scrolls off the bottom of the screen:

Starting server...
Couldn't connect to the server.
We probably couldn't start one from here.
You'll have to start one manually.  Sorry...

Starting the server manually works.  However, the "New Game" button *should* launch the server.  I have changed the bug title to reflect this as the primary problem.
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2010-03-01 04:43:20 UTC
Best guess is that it's probably libsdl-1.2.14.  Try downgrading your libsdl and see if it helps.
Comment 5 Boney McCracker 2010-03-01 05:04:14 UTC
(In reply to comment #4)
> Best guess is that it's probably libsdl-1.2.14.  Try downgrading your libsdl
> and see if it helps.

I don't think that's it.  You see, I also observed this same behavior when I emerged it without USE="sdl", in which I don't think it's using sdl for anything (without USE="sdl", I don't think libsdl is a dependency).

It's easy enough to work around (by starting the server manually before starting the game, and then stopping the server manually when stopping the game), but one shouldn't have to do that.
Comment 6 Mr. Bones. (RETIRED) gentoo-dev 2010-03-01 07:14:41 UTC
Right, if you're talking about freeciv-gtk2 then it's not a problem with libsdl.

Maybe try running it under strace:

strace -o out `which freeciv-gtk2`

and attach the out file.
Comment 7 lumbrius 2010-03-01 13:37:18 UTC
Same bug there
Comment 8 Boney McCracker 2010-03-01 22:44:29 UTC
Created attachment 221705 [details]
strace

I have attached an strace.

I don't really know what I'm looking at, but from watching the live output as it was running, I think things were going normally up until about line 10875, after I clicked "New Game". That line begins begins a block of out output that is repeated over and over again during what I had previously described as the game "freezing".

"socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address family not supported by protocol)
nanosleep({0, 100000000}, NULL)         = 0
waitpid(764, NULL, WNOHANG)             = 0
time(NULL)                              = 1267482367
time(NULL)                              = 1267482367
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=1061, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7756000
read(5, "# /etc/hosts: Local Host Databas"..., 4096) = 1061
close(5)                                = 0
munmap(0xb7756000, 4096)                = 0"

I should point out that: IPv6 is completely disabled on this machine, intentionally. Afterward, the client outputs the crap about not being able to start the server and that you'll have to start one manually.
Comment 9 Mr. Bones. (RETIRED) gentoo-dev 2010-03-02 20:44:06 UTC
what's your /etc/hosts look like?
Comment 10 Boney McCracker 2010-03-02 21:09:58 UTC
(In reply to comment #9)
> what's your /etc/hosts look like?
> 

Bingo!  On this machine, I seem to have neglected to delete or comment-out the IPv6 localhost alias in /etc/hosts.

Thank you.  That should have occurred to me.

My issue is resolved.  Not a bug.  Sorry for wasting your time.
Comment 11 Mr. Bones. (RETIRED) gentoo-dev 2010-03-02 21:22:34 UTC
ok, glad it's working for you.
Comment 12 lumbrius 2010-03-04 15:30:20 UTC
I can't still launch game.
My /etc/hosts there:

# IPv4 and IPv6 localhost aliases

127.0.0.1       localhost vesta
::1             localhost vesta

192.168.10.107 vesta
192.168.10.21 iunona
Comment 13 Boney McCracker 2010-03-04 20:34:39 UTC
(In reply to comment #12)

What worked for me was commenting out the IPv6 localhost alias, like this:

---------------------------------
127.0.0.1       localhost vesta
#::1             localhost vesta

192.168.10.107 vesta
192.168.10.21 iunona
---------------------------------

REOPENED FOR CONSIDERATION OF THE FOLLOWING:

I don't understand why the application would be using that as a decision criterion for whether it should try to use IPv6, but to me, that seems to be its behavior.

Instead, I would expect it to examine the actual network interfaces for the presence of IPv6 addresses.

The freeciv-server and freeciv-client man pages say, "IPv6 aware servers [clients] have additional parameter: [ -A|--announce protocol ]", and "Possible values for protocol are: IPv4, IPv6, none".

That implies there is such a thing as a "NON-IPv6 aware" server or client.  So I would expect to find compile-time configuration switches for this.

Examining the source tarball, it is in fact, configurable at compile-time, but it appears to default to having IPv6 enabled.  That's not Gentoo-like.

Looking at the source config files:
-------------------------------------------file "config" ---
optional features:
...
       --enable-ipv6=yes/no/test
                          use IPv6 (WIP) [test]
...
------------------------------------------------------------

And it does *appear* to have the facility to check to see if the system is IPv6-aware:
-------------------------------------------file "config" ----
# Check whether --enable-ipv6 was given.
if test "${enable_ipv6+set}" = set; then :
  enableval=$enable_ipv6; case "${enableval}" in
  yes|no|test) ipv6=${enableval} ;;
  *)   as_fn_error "bad value ${enableval} for --enable-ipv6" "$LINENO" 5 ;;
esac
else
  ipv6=test
fi

if test x$ipv6 != xno ; then
  ipv6_possible=true
  for ac_func in gethostbyname2 inet_pton inet_ntop getnameinfo
do :
  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
eval as_val=\$$as_ac_var
   if test "x$as_val" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

else
  ipv6_possible=false
fi
done

  if test x$ipv6_possible = xtrue ; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_INET6" >&5
$as_echo_n "checking for AF_INET6... " >&6; }
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
----------------------------------------------------------

So it would seem that we can probably avoid the need for an IPv6 USE flag by setting this to "test" by default.  However, it looks to me like this is probably defaulting to being enabled (rather than "test"), or the test isn't working.


A separate issue related to USE flags:

-----------from "config" ------------
CLIENT_GUI_SDL_FALSE
CLIENT_GUI_SDL_TRUE
AUDIO_SDL_FALSE
AUDIO_SDL_TRUE
-------------------------------------

The use of the sdl sound plugin and the building of the sdl-based client seem to be two separate-configurable options.  I believe the sdl sound plugin is currently the ONLY way to get sound, so we should probably consider have sdl sound enabled by default, with the sdl USE flag serving only to determine whether the sdl *client* is built (or else have two distinct use flags, such as "sdl-sound" and "sdl-client").  Although the SDL client only adds sdl-image as a dependency, it introduces a lot more work into the build.
Comment 14 Mr. Bones. (RETIRED) gentoo-dev 2010-03-05 20:24:24 UTC
resync and try it again.  I think having the ipv6 flag is fine since it makes the choice more explicit for the users.
Comment 15 Boney McCracker 2010-03-06 02:15:45 UTC
(In reply to comment #14)

Excellent.  I'm amazed you were able to make those changes so rapidly.

It works great.  To confirm I observe what you probably intended:

It now provides the sdl sound plugin (via USE="sound" enabled by default) independently of the sdl-based client (optionally enabled via USE="sdl"). It also avoids attempting IPv6 communications (via optionally enabled USE="ipv6"), even if the user has erroneous IPv6 entries in their hosts file.

Nice work, and thanks again.