Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932780 - games-strategy/freeorion-0.5.0.1 fails to compile with boost-1.85, then hangs at runtime if fixed
Summary: games-strategy/freeorion-0.5.0.1 fails to compile with boost-1.85, then hangs...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL: https://github.com/freeorion/freeorio...
Whiteboard: Workaround dep applied
Keywords:
Depends on:
Blocks: 915000 boost-1.85
  Show dependency tree
 
Reported: 2024-05-26 09:47 UTC by Torsten Kaiser
Modified: 2024-06-03 01:31 UTC (History)
4 users (show)

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


Attachments
Log from failed build (build.log,48.33 KB, text/plain)
2024-05-26 09:48 UTC, Torsten Kaiser
Details
freeorion-logs.tar.xz (freeorion-logs.tar.xz,31.84 KB, application/x-xz)
2024-05-27 12:26 UTC, Ionen Wolkens
Details
fix for wrong types in Pathfinder.cpp (typefix.patch,2.31 KB, patch)
2024-05-31 13:23 UTC, Torsten Kaiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Kaiser 2024-05-26 09:47:28 UTC
Upgrade from boost-1.84 to 1.85 triggers a rebuild of freeorion, which then fails due to changes in boost filesystem.

/var/tmp/portage/games-strategy/freeorion-0.5.0.1/work/src-tarball/util/Directories.cpp:7:10: fatal error: boost/filesystem/convenience.hpp: No such file or directory

This is a deprecated API that has been removed from that boost release.

Portage 3.0.64 (python 3.12.3-final-0, default/linux/amd64/23.0/desktop/plasma, gcc-13, glibc-2.39-r6, 6.9.0-rc7 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.9.0-rc7-x86_64-AMD_Ryzen_7_1700X_Eight-Core_Processor-with-glibc2.39
KiB Mem:    32819088 total,  22285684 free
KiB Swap:   15720380 total,  15274484 free
Timestamp of repository gentoo: Sat, 25 May 2024 06:00:00 +0000
Head commit of repository gentoo: c798a7172b235f6767a1f7e4117eb07cf53c3d08
Timestamp of repository x11: Mon, 20 May 2024 17:23:26 +0000
Head commit of repository x11: 7b1c0764739d0f00dd05fd8bda96979f4ac37234

sh bash 5.2_p26-r3
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r3::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.29.3::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.0-r1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r5::gentoo
dev-lang/python:           3.10.14_p1-r1::gentoo, 3.11.9-r1::gentoo, 3.12.3-r1::gentoo, 3.13.0_beta1_p2::gentoo
dev-lang/rust:             1.77.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.6::gentoo, 18.1.6::gentoo
sys-devel/gcc:             12.3.1_p20240502::gentoo, 13.2.1_p20240503::gentoo, 14.1.1_p20240518::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             16.0.6::gentoo, 17.0.6::gentoo, 18.1.6::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.6::gentoo, 18.1.6::gentoo
sys-kernel/linux-headers:  6.9::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 3

local
    location: /var/ebuilds
    masters: gentoo
    priority: 0
    volatile: True

x11
    location: /var/db/repos/x11
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/x11.git
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -march=znver1 -O3 -fomit-frame-pointer -fivopts -fweb -frename-registers -ftracer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.3/ext-active/ /etc/php/cgi-php8.3/ext-active/ /etc/php/cli-php8.3/ext-active/ /etc/php/fpm-php8.3/ext-active/ /etc/php/phpdbg-php8.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-pipe -march=znver1 -O3 -fomit-frame-pointer -fivopts -fweb -frename-registers -ftracer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --jobs=6 --load-average=24 --keep-going"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="de en"
MAKEOPTS="-j16 -l24"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="7zip R S3TC X a52 aac aalib ace acl acpi activities ads aften aio alisp alsa altenburgcards amarok amd64 amr amrnb amrr amrwb animgif ao apache2 aqua_theme archive async audacious audiofile aura autoipd avahi bcel bcp bdf beagle bidi bigpatch binfilter bittorrent bl blas blender-game bluetooth bonusscripts boost branding bzip2 c++ cairo calendar caps carbone_theme cblas-external cdda cdio cdparanoia cdr cet cgi chm chroot cifsupcall cisco clang client clucene cmdctrl cmdsubmenu colord compress connectionstatus consolekit contactnotes context contrib corefonts cpio cpufreq crypt cryptsetup cscope css ctype cups curl cutterlimit cutterqueue cuttime cvs cvsgraph cxx cycles dar64 dbase dbm dbus dbx dc1394 dec_av dec_av2 declarative demo designer device-mapper divx djvu dlz dmi dmx dnotify doc domainkeys dot double-precision dpmod drafts dri dts dv dvb dvbplayer dvd dvdarchive dvdchapjump dvdr dvdread dvi ecc editor egl elf elogind eme-free emoticon encode enscript equalizer eselect-ldso evdev excel exif exiv2 expat extensions extra extra-algorithms extra-cardsets extraengine extras farstream fat fbcon fdt festival ffmpeg fftw file file-icons flac fluidsynth fmod font-server fontconfig fortran fping fpx frei0r ftp fts3 fuse g3dvl gbm gcj gd gdbm gecko gegl geoip gflags gif gimp git gkrellm glade glamor gles gles1 gles2 glib glibc-omitfp glitz glsa glut gmedia gmp gnutls gopher gpac gpg gpgme gphoto2 gpm graphics graphite graphviz gs gsettings gstreamer gtk gtk3 gui gutenprint gzip haptic harfbuzz hddtemp hdri highlight history html htmlhandbook http http2 httpd hvm hwdb ical iceweasel iconv icq icu id3 id3tag ide idea ieee1394 image imagemagick imap import-filter infowidget inherit-graph inkjar innodb inotify inspector introspection ipfilter ipsec iptc ipv6 irc irrlicht ithreads jabber jack jad jadetex java java-external java6 jce jemalloc jingle jit jni john jpeg jpeg2k juju jumpplay kde kdecards kdenlive kdepim kdrive kexi kipi kmid kpathsea ktts kvm kwallet lapack latex lcms ldap legacy-systray libcaca libkms libmpeg2 libmysqlclient libnotify libsamplerate libsexy libssh2 libtirpc libvisual libwww liemikuutio lights livebuffer llvm llvm-shared-libs lm_sensors logrotate logviewer loop-playback lto lua lucene lv2 lyx lzma lzo mad magic mail mailwrapper mainmenuhooks maps masquerade math matroska maya-shaderlibrary mbox mbrola md5sum mdev mdnsresponder-compat meanwhile melt menu-plugin menubar menuorg messages metric mhash midi mikmod mime mimencode minizip mixer mjpeg mmap mmx mmxext mng mod modplug mounts-check mozdevelop mozdom mozilla mp2 mp3 mp4 mp4live mpd mpeg mpeg2 mpg123 mpi mplayer mppe-mppc mpu401 mschap msn mtp multilib multiprocess musepack music mysql mysqli mythtv nagios-dns nagios-ntp nagios-ping nagios-ssh nat native-exceptions ncurses nepomuk net netjack netmeeting network network-cron networkmanager nfs nfsidmap nfsv4 nfsv41 nls nntp normalize nova nsplugin nspr nss ntfs ntfsprogs nuv objc offensive ogg ogg123 ole opcache opencl openexr opengl openimageio openmp openssh openssl openvpn opus osmesa otr pam pango pascal pcap pcre pcre16 pcre32 pda pdf pdfimport perl php physfs pim pipewire pixmaps pkcs11 plasma player plotutils pmu png policykit portaudio posix postfix postproc postscript povray ppds pptp printsupport pth pulseaudio python qemu qml qt3support qt5 query-browser quicktime r600-llvm-compiler radio rar raw rc5 rdesktop rdp readline realmedia remix replaygain restrict-javascript rle romio rpc rss rtc rtmp rtsp samba sasl sbig scanner screen screencast script scripttools sdk sdl sdl-image sdl-sound sdl2 sdlaudio seamonkey search seccomp secure-delete semantic-desktop sensord server shared-dricore shorten shout sid signatures simplexml skins smime smp smtp sndfile sockets socks5 solver songs sortrecords sound soundex sounds sox speech speedo speex spell spice sql sqlite sqlite3 srtp sse sse2 sse3 sse4a ssl ssse3 stars startup-notification stats stemmer stlport stream strongswan_plugins_aesni strongswan_plugins_gcm strongswan_plugins_rdrand su submenu subtitles subversion suhosin suid-wrapper svc svg svgz swat sylpheed sysfs syslog system-bootstrap system-cairo system-icu system-jpeg system-jsoncpp system-libvncserver system-libvpx system-sqlite systray sysvipc szip t1lib taglib tagwriting tb4 teletext test-rust tetex tex text texteffect textures tftp tga themes theora thesaurus threads threadsafe tidy tiff timercmd timerinfo tk tls toolbar tools transcode trayicon truetype tta ttxtsubs twolame udev udisks ui unicode unlock-notify upcall upower usb usbredir userfiles utils uudeview uuencode v4l v4l2 vaapi vamp vcd vcdx vdr video videos view vim-syntax virgl visualization vlm vnc vncviewer voice volctrl vorbis vorbis-psy vpx vulkan wav wavpack wayland wayland-compositor web webdav webinterface webkit webm webp widgets wifi winbind winpopup wireshark wma wmf wmp wxwidgets x264 x265 xanim xattr xcb xcf xcomposite xephyr xetex xext xface xforms xfs xft xhtml xine xinerama xkb xml xmp xnest xorg xosd xplanet xpm xrandr xrender xscreensaver xsl xslt xspice xv xvfb xvid xvmc xvnc xwayland yahoo yv12 zeroconf zip zlib zrtp zstd zvbi" ABI_X86="32 64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="evdev" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-3" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12 python3_10" QEMU_SOFTMMU_TARGETS="x86_64 alpha arm i386 m68k mips mips64 mips64el mipsel ppc ppc64 ppcemb s390x sparc sparc64" RUBY_TARGETS="ruby33" VIDEO_CARDS="dummy v4l virgl radeon r600 radeonsi amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

games-strategy/freeorion-0.5.0.1::gentoo was built with the following:
USE="client doc -test" ABI_X86="(64)" ELIBC="(glibc)" KERNEL="(linux)" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11"
CFLAGS="-pipe -march=znver1 -O3 -fomit-frame-pointer -fivopts -fweb -frename-registers -ftracer -I/usr/include/SDL2"
CXXFLAGS="-pipe -march=znver1 -O3 -fomit-frame-pointer -fivopts -fweb -frename-registers -ftracer -I/usr/include/SDL2"
Comment 1 Torsten Kaiser 2024-05-26 09:48:23 UTC
Created attachment 894428 [details]
Log from failed build
Comment 2 Torsten Kaiser 2024-05-26 10:44:39 UTC
Upstream Bug: https://github.com/freeorion/freeorion/issues/4897
Upstream PR: https://github.com/freeorion/freeorion/pull/4899/commits

https://patch-diff.githubusercontent.com/raw/freeorion/freeorion/pull/4899.patch
-> adding this to /etc/portage/patches makes the build work.
Comment 3 Ionen Wolkens gentoo-dev 2024-05-26 13:18:34 UTC
Does the game work for you with boost-1.85?

It builds fine with the patch, but the tests fail (hang), and if I try to run it normally with Quick Start it also seemingly hang forever.

If I go back to boost-1.84.0-r3 and rebuild, all is fine (even with the patch, so it's probably not caused by the patch).
Comment 4 Ionen Wolkens gentoo-dev 2024-05-26 13:22:57 UTC
(not to say there may not be something else going on, my boost-1.84 binpkg is quite old and think it was built with gcc13 -- so if it works for you maybe could look around these avenues)
Comment 5 Torsten Kaiser 2024-05-26 14:11:38 UTC
Test start also only produced a black screen for me.
Both 'Single player' and 'Quick start'.

Loading an old savegame partly worked, at least some UI came up. But it was still broken, but probably because the save was from 2018.

Maybe it's https://github.com/freeorion/freeorion/issues/4151

That issue referenced another bug and there the same symptom "client window stays black" is mentioned: https://github.com/freeorion/freeorion/pull/4116#issuecomment-1257178010

I try to see, if I can find something useful wrt. the hang. But on the surface that seems more of an upstream issue than boost or gcc related.
Comment 6 Torsten Kaiser 2024-05-26 14:27:49 UTC
16:22:24.559874 {0x00007f864b555780} [debug] python : empires.py:225 : Trying to find 7 home systems that are at least 1 jumps apart...
16:22:24.559895 {0x00007f864b555780} [debug] python : empires.py:229 : ...use complete pool
16:22:24.559951 {0x00007f864b555780} [debug] python : empires.py:161 : Failing in find_home_systems_for_min_jump_distance because current_merit_lower_bound = 0 trims local pool to 0 systems which is less than num_home_systems 7.
16:22:24.559981 {0x00007f864b555780} [debug] python : empires.py:246 : ...only 0 systems found
16:22:24.560006 {0x00007f864b555780} [error] python : util.py:45 : Python generate_home_system_list: requested 7 homeworlds in a galaxy with 151 systems
16:22:24.560027 {0x00007f864b555780} [error] python : util.py:45 : Python create_universe: couldn't get any home systems, ABORTING!
16:22:24.562542 {0x00007f864b555780} [error] server : PythonCommon.cpp:101 : Traceback (most recent call last):
16:22:24.562564 {0x00007f864b555780} [error] server : PythonCommon.cpp:101 :   File "/usr/share/freeorion/default/python/common/listeners.py", line 42, in wrapper
    res = funct(*args)
          ^^^^^^^^^^^^
16:22:24.562569 {0x00007f864b555780} [error] server : PythonCommon.cpp:101 :   File "/usr/share/freeorion/default/python/universe_generation/universe_generator.py", line 121, in create_universe
    raise Exception(err_msg)
16:22:24.562574 {0x00007f864b555780} [error] server : PythonCommon.cpp:101 : Exception: Python create_universe: couldn't get any home systems, ABORTING!


... the game itself seems to be OK, but is unable to create useful AI start positions and aborts. ... and then the client just hangs with a black screen.

I will retry later after removing old configs...
Comment 7 Ionen Wolkens gentoo-dev 2024-05-26 14:47:58 UTC
I see.

Don't really have time to look closer at this myself right now (I don't really know/play the game, I just try to keep the ebuild working), if you find something / report upstream it'd be great (may be worth trying master too).

It's nasty but maybe I'll just put an upper bound on boost for now given build-time fixes won't mean much if it doesn't run.

CC Oleg in case interested, maybe have an idea -- not sure if runtime been tested at all with 1.85 upstream and if it was just build fixes, if it works then guess will have to experiment more from this side.
Comment 8 Larry the Git Cow gentoo-dev 2024-05-26 14:52:09 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e84fcf1c3010ecf7210ab8cf115c5c9009e89ee

commit 2e84fcf1c3010ecf7210ab8cf115c5c9009e89ee
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-05-26 14:49:49 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-05-26 14:51:25 +0000

    games-strategy/freeorion: limit to <boost-1.85 for now
    
    No need for revbump given binding operator sorts it out for us.
    
    Bug: https://bugs.gentoo.org/932780
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 games-strategy/freeorion/freeorion-0.5.0.1.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 9 Torsten Kaiser 2024-05-26 19:19:20 UTC
Logs suggest that the problem is somewhere inside universe/Pathfinder.cpp WithinJumps(). That function always seems to return an empty list and then no suitable home systems can be found during universe creation.

21:00:03.096798 {0x00007fcef1299780} [trace] server : ServerWrapper.cpp:1005 : within 3 jumps: 0 systems
21:00:03.096811 {0x00007fcef1299780} [trace] server : Pathfinder.cpp:748 : Cache MISS ii: 2
21:00:03.096822 {0x00007fcef1299780} [trace] server : Pathfinder.cpp:1178 : Cache Hit ii: 2  jumps: 3
21:00:03.096826 {0x00007fcef1299780} [trace] server : ServerWrapper.cpp:1005 : within 3 jumps: 0 systems
21:00:03.096839 {0x00007fcef1299780} [trace] server : Pathfinder.cpp:748 : Cache MISS ii: 3
21:00:03.096848 {0x00007fcef1299780} [trace] server : Pathfinder.cpp:1178 : Cache Hit ii: 3  jumps: 3
21:00:03.096852 {0x00007fcef1299780} [trace] server : ServerWrapper.cpp:1005 : within 3 jumps: 0 systems
21:00:03.096864 {0x00007fcef1299780} [trace] server : Pathfinder.cpp:748 : Cache MISS ii: 4
21:00:03.096873 {0x00007fcef1299780} [trace] server : Pathfinder.cpp:1178 : Cache Hit ii: 4  jumps: 3
21:00:03.096877 {0x00007fcef1299780} [trace] server : ServerWrapper.cpp:1005 : within 3 jumps: 0 systems

As that function does use boost (boost::breadth_first_search() in Pathfinder::PathfinderImpl::HandleCacheMiss()) that might be related to the boost upgrade. I have not found out, what goes wrong.

I will try to add more debug in the next days...
Comment 10 Oleg 2024-05-27 06:49:59 UTC
(In reply to Ionen Wolkens from comment #7)
> CC Oleg in case interested, maybe have an idea -- not sure if runtime been
> tested at all with 1.85 upstream and if it was just build fixes, if it works
> then guess will have to experiment more from this side.

No, latest boost version tested is 1.83 with Debian sid, Fedora rawhide, Manjaro and Void(musl). If use latest `release-0.5` commit do tests fail too?
Comment 11 Ionen Wolkens gentoo-dev 2024-05-27 08:10:12 UTC
(In reply to Oleg from comment #10)
> (In reply to Ionen Wolkens from comment #7)
> > CC Oleg in case interested, maybe have an idea -- not sure if runtime been
> > tested at all with 1.85 upstream and if it was just build fixes, if it works
> > then guess will have to experiment more from this side.
> 
> No, latest boost version tested is 1.83 with Debian sid, Fedora rawhide,
> Manjaro and Void(musl). If use latest `release-0.5` commit do tests fail too?
I see, thanks. Tried release-v0.5 092ea03 built against boost-1.85.0 (unpatched given builds fine as-is now), but still getting:

    Start 1: TestEnumParser
1/6 Test #1: TestEnumParser ...................   Passed    0.07 sec
    Start 2: TestPythonParser
2/6 Test #2: TestPythonParser .................   Passed    1.82 sec
    Start 3: SmokeTestGame
(hanging there)

Similarly hangs if try manually w/ Quick Start as noted in other comments, first see a black screen with high cpu usage seemingly preparing things but then usage stops completely and screen remains black.

If go back to 1.84.0, 092ea03 passes tests fine.

ftr also using python3.12, albeit given it works with 1.84 I assume it's unrelated (could try py3.10-11 if need be though). Being a ~testing system everything is somewhat recent (incl. gcc14), typical gentoo stable systems are still on boost-1.84.
Comment 12 Oleg 2024-05-27 10:49:12 UTC
I'm trying to reproduce failure in Docker, but not sure what also could be broken

```
10:43:21.053823 {0x00007f0a16e5d380} [info] server : ServerApp.cpp:101 : v0.5.0.1 [build 2024-04-10.092ea03] CMake
10:43:21.053841 {0x00007f0a16e5d380} [info] server : DependencyVersions.cpp:85 : Dependency versions from headers:
10:43:21.053856 {0x00007f0a16e5d380} [info] server : DependencyVersions.cpp:88 : Boost: 1_85
10:43:21.053864 {0x00007f0a16e5d380} [info] server : DependencyVersions.cpp:88 : Python: 3.11.9
10:43:21.053869 {0x00007f0a16e5d380} [info] server : DependencyVersions.cpp:88 : zlib: 1.3.1
```

And ctest outputs:

```
Test project /tmp/build
    Start 1: TestEnumParser
1/5 Test #1: TestEnumParser ...................   Passed    0.06 sec
    Start 2: TestPythonParser
2/5 Test #2: TestPythonParser .................   Passed    1.94 sec
    Start 3: SmokeTestGame
3/5 Test #3: SmokeTestGame ....................   Passed   18.59 sec
    Start 4: SmokeTestHostless
4/5 Test #4: SmokeTestHostless ................   Passed   45.88 sec
    Start 5: TestChecksum
5/5 Test #5: TestChecksum .....................   Passed    2.06 sec

100% tests passed, 0 tests failed out of 5
```

Do you have logs in ~/.local/share/freeorion/freeorion.log and ~/.local/share/freeorion/freeoriond.log when it hangups?
Comment 13 Ionen Wolkens gentoo-dev 2024-05-27 12:26:54 UTC
Created attachment 894513 [details]
freeorion-logs.tar.xz

(In reply to Oleg from comment #12)
> Do you have logs in ~/.local/share/freeorion/freeorion.log and
> ~/.local/share/freeorion/freeoriond.log when it hangups?
Attached the whole log directory, I do see a python traceback in freeoriond.log, don't know if related:

08:18:20.725162 {0x00007ffff3e6cc00} [error] server : PythonCommon.cpp:101 : Traceback (most recent call last):
08:18:20.725177 {0x00007ffff3e6cc00} [error] server : PythonCommon.cpp:101 :   File "/usr/share/freeorion/default/python/common/listeners.py", line 42, in wrapper
    res = funct(*args)
          ^^^^^^^^^^^^
08:18:20.725182 {0x00007ffff3e6cc00} [error] server : PythonCommon.cpp:101 :   File "/usr/share/freeorion/default/python/universe_generation/universe_generator.py", line 121, in create_universe
    raise Exception(err_msg)
08:18:20.725185 {0x00007ffff3e6cc00} [error] server : PythonCommon.cpp:101 : Exception: Python create_universe: couldn't get any home systems, ABORTING!

> DependencyVersions.cpp:88 : Python: 3.11.9
Maybe I'll go ahead and try 3.11 too, maybe something that only trigger with 3.12+1.85
Comment 14 Ionen Wolkens gentoo-dev 2024-05-27 12:53:44 UTC
(In reply to Ionen Wolkens from comment #13)
> Maybe I'll go ahead and try 3.11 too, maybe something that only trigger with
> 3.12+1.85
Nope, still happens if linked with 3.11.9's libpython -- versions looking identical to your own test case now:

08:46:56.599233 {0x00007ffff3f83c00} [info] server : ServerApp.cpp:101 : v0.5.0.1 [build 2024-04-10.092ea03] CMake
08:46:56.599242 {0x00007ffff3f83c00} [info] server : DependencyVersions.cpp:85 : Dependency versions from headers:
08:46:56.599248 {0x00007ffff3f83c00} [info] server : DependencyVersions.cpp:88 : Boost: 1_85
08:46:56.599252 {0x00007ffff3f83c00} [info] server : DependencyVersions.cpp:88 : Python: 3.11.9
08:46:56.599254 {0x00007ffff3f83c00} [info] server : DependencyVersions.cpp:88 : zlib: 1.3.1

I'll try a few other random things on the sides in case anything gentoo-specific, but don't really have many ideas. I'd try to build boost+freeorion with gcc13 (rather than 14) but I'd need to setup a new test system given can't safely downgrade libstdc++, albeit used 14 to build the working boost-1.84+freeorion so it seems like a long shot anyway.
Comment 15 Oleg 2024-05-27 13:28:48 UTC
I'm using docker image from https://github.com/gentoo/gentoo-docker-images?tab=readme-ov-file#using-the-portage-container-as-a-data-volume to experiment

I've changed python version to 3.12 but tests still are passed 

13:26:47.828764 {0x00007f092968e380} [info] server : ServerApp.cpp:101 : v0.5.0.1 [build 2024-04-10.092ea03] CMake
13:26:47.828779 {0x00007f092968e380} [info] server : DependencyVersions.cpp:85 : Dependency versions from headers:
13:26:47.828792 {0x00007f092968e380} [info] server : DependencyVersions.cpp:88 : Boost: 1_85
13:26:47.828806 {0x00007f092968e380} [info] server : DependencyVersions.cpp:88 : Python: 3.12.3
13:26:47.828813 {0x00007f092968e380} [info] server : DependencyVersions.cpp:88 : zlib: 1.3.1

I also opened issue in upstream https://github.com/freeorion/freeorion/issues/4949
Comment 16 Ionen Wolkens gentoo-dev 2024-05-27 13:52:03 UTC
Thanks.

Guess gcc14 can't be fully ruled out, maybe there is some UB that goes wrong only with it + boost 1.85. I assume the docker image is on gcc13.
Comment 17 Ionen Wolkens gentoo-dev 2024-05-27 14:38:09 UTC
(In reply to Ionen Wolkens from comment #16)
> Guess gcc14 can't be fully ruled out, maybe there is some UB that goes wrong
> only with it + boost 1.85. I assume the docker image is on gcc13.
That theory just got stronger given tests pass if use -O0 to build freeorion itself (boost is still on -O2, albeit it could still be an issue in boost headers if not freeorion).

Still haven't tried gcc-13 myself, but I do assume gcc-14 is related.

Guess if could find what specific optimization cause the issue could disable it as a less invasive workaround than a upper bound.
Comment 18 Ionen Wolkens gentoo-dev 2024-05-27 15:08:52 UTC
(In reply to Ionen Wolkens from comment #17)
> Guess if could find what specific optimization cause the issue could disable
> it as a less invasive workaround than a upper bound.
Well, tried the obvious -fno-strict-aliasing first and tests pass again.

Guess good enough for a downstream "fix" until something is figured out. Albeit I'll push that tomorrow after re-testing from a clean env to be sure I didn't just confuse something.
Comment 19 Larry the Git Cow gentoo-dev 2024-05-27 15:52:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=998fae593fd83b10e798c8fd9bbbad5b73ed7ac0

commit 998fae593fd83b10e798c8fd9bbbad5b73ed7ac0
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-05-27 15:30:44 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-05-27 15:51:46 +0000

    games-strategy/freeorion: fix build+runtime w/ boost-1.85
    
    Re-tested in a clean env and seems fine.
    
    Hoping -fno-sa won't be permanent, but it'll do better
    than an upper bound.
    
    Closes: https://bugs.gentoo.org/932780
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 .../files/freeorion-0.5.0.1-boost1.85.patch        | 57 ++++++++++++++++++++++
 ...-0.5.0.1.ebuild => freeorion-0.5.0.1-r1.ebuild} |  8 ++-
 2 files changed, 63 insertions(+), 2 deletions(-)
Comment 20 Torsten Kaiser 2024-05-27 19:51:22 UTC
It's not gcc-14. Building with gcc-13 fails the same way.
Starlanes get generated normally, then PathFinder->WithinJumps() only returns empty lists. So no home systems can get generated and the client 'hangs'.

gcc-14 and "append-flags -fno-strict-aliasing" works, I am able to start a new game.

Excerpt from the failing log:
21:14:12.271351 {0x00007f3c70114780} [trace] server : System.cpp:426 : Added starlane from system  (2552) system 1624
21:14:12.271356 {0x00007f3c70114780} [trace] server : System.cpp:426 : Added starlane from system  (2552) system 2344
21:14:12.271361 {0x00007f3c70114780} [trace] server : System.cpp:426 : Added starlane from system  (2552) system 2400
21:14:12.271367 {0x00007f3c70114780} [debug] server : UniverseGenerator.cpp:728 : Initializing System Graph
21:14:12.271498 {0x00007f3c70114780} [debug] python : universe_generator.py:113 : Starlanes generated
21:14:12.271515 {0x00007f3c70114780} [debug] python : universe_generator.py:115 : Compile list of home systems...
21:14:12.271552 {0x00007f3c70114780} [debug] python : empires.py:342 : Compile home system list: 7 systems requested
21:14:12.271569 {0x00007f3c70114780} [trace] server : ServerWrapper.cpp:1005 : within 3 jumps: 0 systems
21:14:12.271579 {0x00007f3c70114780} [trace] server : Pathfinder.cpp:748 : Cache MISS ii: 1
21:14:12.271590 {0x00007f3c70114780} [trace] server : Pathfinder.cpp:1178 : Cache Hit ii: 1  jumps: 3
21:14:12.271595 {0x00007f3c70114780} [trace] server : ServerWrapper.cpp:1005 : within 3 jumps: 0 systems
21:14:12.271603 {0x00007f3c70114780} [trace] server : Pathfinder.cpp:748 : Cache MISS ii: 2
21:14:12.271613 {0x00007f3c70114780} [trace] server : Pathfinder.cpp:1178 : Cache Hit ii: 2  jumps: 3
21:14:12.271617 {0x00007f3c70114780} [trace] server : ServerWrapper.cpp:1005 : within 3 jumps: 0 systems
Comment 21 Ionen Wolkens gentoo-dev 2024-05-28 01:46:02 UTC
(In reply to Torsten Kaiser from comment #20)
> It's not gcc-14. Building with gcc-13 fails the same way.
> Starlanes get generated normally, then PathFinder->WithinJumps() only
> returns empty lists. So no home systems can get generated and the client
> 'hangs'.
I see, in that case I am at a loss as to why Oleg was not able to reproduce.
Comment 22 Torsten Kaiser 2024-05-31 13:21:54 UTC
It seems to be caused by universe/Pathfinder.cpp.
If I only recompile this file with -fno-strict-aliasing I can quickstart a new game.

I found a bug in that file that looked promising, but even with this fixed its not not working, so the aliasing problem must be somewhere else in that file.

The bug:
https://github.com/freeorion/freeorion/commit/7fa78ab26ba3d27ac7899c038501031ed47c52ad
That changed all size_t to std::size_t
https://github.com/freeorion/freeorion/commit/7f88018ea720ce05612b1bd36b14e80ed5fd7173
That changed all short to int16_t

But:
https://github.com/freeorion/freeorion/commit/93a0968631d135c6eddc3c0d667215f4ee2312fd
Re-added a few size_t and short.

I will attach the fix for that, but even with this patch I still needed the -fno-strict-aliasing when building Pathfinder.cpp.
Comment 23 Torsten Kaiser 2024-05-31 13:23:14 UTC
Created attachment 894716 [details, diff]
fix for wrong types in Pathfinder.cpp
Comment 24 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-31 13:44:00 UTC
(In reply to Torsten Kaiser from comment #22)
> It seems to be caused by universe/Pathfinder.cpp.
> If I only recompile this file with -fno-strict-aliasing I can quickstart a
> new game.
> 

You can try bisect the file via pragmas: https://stackoverflow.com/a/2220565. It's a bit brittle but it should be fine for what you're doing here. You can try it with "-fno-strict-aliasing" but if that doesn't work, just do it with -O1/-O2/-O3 instead.
Comment 25 Torsten Kaiser 2024-05-31 16:54:55 UTC
I was just doing that. :-)

The following "patch" fixes the "no home system found" problem, but the game then still gets stuck at something else.

--- a/universe/Pathfinder.cpp   2024-05-31 16:01:26.974982757 +0200
+++ b/universe/Pathfinder.cpp   2024-05-31 18:30:09.934918205 +0200
@@ -1,4 +1,7 @@
+#pragma GCC push_options
+#pragma GCC optimize ("no-strict-aliasing")
 #include "Pathfinder.h"
+#pragma GCC pop_options
 
 #include <algorithm>
 #include <limits>

This is with dev-libs/boost-1.85.0, dev-lang/python-3.12.3-r1 and sys-devel/gcc-14.1.1_p20240518. I think the boost was still build with gcc-13, but as recompiling just freeorion with and without partly strict-aliasing shows the problems that probably does not matter.

I do use "unrecommended" CFLAGS:
CFLAGS="-pipe -march=znver1 -O3 -fomit-frame-pointer -fivopts -fweb -frename-registers -ftracer"

Next try: moving the #pragma into the Pathfinder.h, to see if that "fixes" the other hang.

I'm also not sure what this really changes. It seems that Pathfinder.h does not contain any code, only the class definition.
Comment 26 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-31 16:57:20 UTC
:)

You can try the `may_alias` attribute too on structs (presumably classes too) but it's IMO kind of fragile...
Comment 27 Torsten Kaiser 2024-05-31 20:25:20 UTC
--- e/universe/UniverseObject.h 2024-05-31 20:42:56.614860571 +0200
+++ f/universe/UniverseObject.h 2024-05-31 21:58:49.574827634 +0200
@@ -5,7 +5,10 @@
 #include <set>
 #include <string>
 #include <vector>
+#pragma GCC push_options
+#pragma GCC optimize ("no-strict-aliasing")
 #include <boost/container/flat_map.hpp>
+#pragma GCC pop_options
 #include <boost/python/detail/destroy.hpp>
 #include <boost/signals2/optional_last_value.hpp>
 #include <boost/signals2/signal.hpp>


... which makes sense that some change in boost triggered the problems / the hang.

But it's totally unclear where the real bug is. UniverseObject is the base class of "everything" and this patch will probably turn off strict aliasing for most of the flat_map's that are used everywhere. And this is still worse then the global "append-flags -fno-strict-aliasing", because this only fixes the generation of the home systems, but then the game client will still hang.
Comment 29 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-31 20:44:54 UTC
oh my god: https://github.com/boostorg/container/issues/281
Comment 30 Ionen Wolkens gentoo-dev 2024-05-31 23:25:12 UTC
welp, thanks for looking into this, figures this may be causing problems in more packages then
Comment 31 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-31 23:33:03 UTC
I'm not sure what to do yet. The pragma is fragile but I feel like leaving boost-1.85 as-is surely isn't sustainable or safe either. Reverting the bisect result (https://github.com/boostorg/container/commit/1a4a205ea6ef7b4e67a2faab7c7d745711807695) isn't great as it's both: a) a massive commit; b) not the real fix anyway.

I'll file a new bug for discussion.
Comment 32 Larry the Git Cow gentoo-dev 2024-06-01 05:32:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bcbe7a421e108bfea3b77723040f37d87741dae

commit 5bcbe7a421e108bfea3b77723040f37d87741dae
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-06-01 05:28:23 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-06-01 05:31:34 +0000

    games-strategy/freeorion: limit boost workaround to 1.85.0
    
    Been confirmed that the issue is in boost itself, so there's
    no reason to always do this. Odds are will be fixed if there
    is a -r1 too, so preemptively limit to -r0 too.
    
    Bug: https://bugs.gentoo.org/932780
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 games-strategy/freeorion/freeorion-0.5.0.1-r1.ebuild | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 33 Larry the Git Cow gentoo-dev 2024-06-03 01:31:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bbea521152678132cf0b02e3a152481523b3078

commit 4bbea521152678132cf0b02e3a152481523b3078
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-06-03 01:19:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-03 01:20:45 +0000

    dev-libs/boost: fix aliasing violation in boost::container
    
    Note that we have to crank the subslot for this. I've added a fudge .1
    which we should drop on 1.86.0.
    
    Closes: https://bugs.gentoo.org/933289
    Bug: https://github.com/freeorion/freeorion/issues/4949
    Bug: https://github.com/boostorg/container/issues/252
    Bug: https://github.com/boostorg/container/issues/281
    Bug: https://bugs.gentoo.org/932780
    Bug: https://bugs.gentoo.org/931587
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-libs/boost/boost-1.85.0-r1.ebuild              | 348 ++++++++++++++++++
 .../files/boost-1.85.0-container-aliasing.patch    | 408 +++++++++++++++++++++
 2 files changed, 756 insertions(+)