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

Client hangs after connecting to server on FreeBSD #1971

Closed
danfe opened this issue Apr 13, 2023 · 43 comments · Fixed by #2109
Closed

Client hangs after connecting to server on FreeBSD #1971

danfe opened this issue Apr 13, 2023 · 43 comments · Fixed by #2109
Labels

Comments

@danfe
Copy link

danfe commented Apr 13, 2023

This issue is about the bug reported earlier, to make it easier to track here on GitHub.

It happens with version 1.1.1 and apparently independent of the Boost version (originally reported for boost-libs 1.72.0, seeing it now with boost-libs 1.81.0).

Backtraces from gdb(1) attached to both processes while it hangs:

(gdb@vcmiclient) bt
#0  0x0000000802e12b6c in ?? () from /lib/libthr.so.3
#1  0x0000000802e22f00 in ?? () from /lib/libthr.so.3
#2  0x0000000802e146cf in ?? () from /lib/libthr.so.3
#3  0x00000008007e9f5b in ?? () from /usr/local/lib/libboost_thread.so.1.81.0
#4  0x00000008007e8292 in boost::thread::join_noexcept() ()
   from /usr/local/lib/libboost_thread.so.1.81.0
#5  0x0000000800efc3ca in boost::thread::join (this=0x814ab3f18)
    at /usr/local/include/boost/thread/detail/thread.hpp:762
#6  CConnection::~CConnection (this=0x814f2cc18, vtt=<optimized out>)
    at /tmp/usr/ports/games/vcmi/work/vcmi-1.1.1/lib/serializer/Connection.cpp:238
#7  0x0000000800efc7f5 in CConnection::~CConnection (this=0x814f2cc18)
    at /tmp/usr/ports/games/vcmi/work/vcmi-1.1.1/lib/serializer/Connection.cpp:236
#8  0x00000000005f1621 in std::__1::__shared_count::__release_shared (
    this=0x814f2cc00) at /usr/include/c++/v1/__memory/shared_ptr.h:177
#9  std::__1::__shared_weak_count::__release_shared (this=0x814f2cc00)
    at /usr/include/c++/v1/__memory/shared_ptr.h:219
#10 std::__1::shared_ptr<CConnection>::~shared_ptr (this=<optimized out>)
    at /usr/include/c++/v1/__memory/shared_ptr.h:959
#11 std::__1::shared_ptr<CConnection>::reset (this=0x811107708)
    at /usr/include/c++/v1/__memory/shared_ptr.h:1054
#12 CServerHandler::resetStateForLobby (this=0x811107600, 
    mode=StartInfo::CAMPAIGN, names=0x0)
    at /tmp/usr/ports/games/vcmi/work/vcmi-1.1.1/client/CServerHandler.cpp:134
#13 0x00000000004b967b in CMainMenu::openCampaignLobby (campaign=...)
    at /tmp/usr/ports/games/vcmi/work/vcmi-1.1.1/client/mainmenu/CMainMenu.cpp:343
#14 CMainMenu::openCampaignLobby (campaignFileName=...)
    at /tmp/usr/ports/games/vcmi/work/vcmi-1.1.1/client/mainmenu/CMainMenu.cpp:338
[...]
(gdb@vcmiserver) bt
#0  0x0000000800d7cb6c in ?? () from /lib/libthr.so.3
#1  0x0000000800d8cf00 in ?? () from /lib/libthr.so.3
#2  0x0000000800d7e6cf in ?? () from /lib/libthr.so.3
#3  0x00000000002ebf8e in boost::posix::pthread_cond_timedwait (c=<optimized out>, m=<optimized out>, 
    t=<optimized out>) at /usr/local/include/boost/thread/pthread/pthread_helpers.hpp:123
#4  boost::condition_variable::do_wait_until (this=this@entry=0x7fffffffe1a0, m=..., timeout=...)
    at /usr/local/include/boost/thread/pthread/condition_variable.hpp:122
#5  0x00000000002b4f6e in boost::condition_variable::timed_wait<boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000l>, bool (*)()> (this=0x7fffffffe1a0, m=..., wait_duration=..., 
    pred=<optimized out>) at /usr/local/include/boost/thread/pthread/condition_variable_fwd.hpp:229
#6  boost::this_thread::sleep<boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000l> > (rel_time=...) at /usr/local/include/boost/thread/pthread/thread_data.hpp:280
#7  0x0000000000325540 in CVCMIServer::run (this=this@entry=0x7fffffffe2d0)
    at /tmp/usr/ports/games/vcmi/work/vcmi-1.1.1/server/CVCMIServer.cpp:192
#8  0x000000000032cd33 in main (argc=<optimized out>, argv=0x7fffffffe618)
    at /tmp/usr/ports/games/vcmi/work/vcmi-1.1.1/server/CVCMIServer.cpp:1092

Building and running the server on Ubuntu 20.04 and running the client on FreeBSD as vcmiclient -i -d allows it to connect and it does not hang, but nothing happens when I'm trying to start a new campaign game. The server sees the connection though:

Listening for connections at port 3030
We got a new connection! :)
Established connection with VCMI 1.1.1 (client). UUID: 23a240dd-dd2d-4bf8-88e0-a2b67c376dd2
Connection with client 1 established. UUID: 1d825f32-7a2f-4937-a3bd-4f9370303cc8
Client 1 player: Player
system says: Player (pid  cid 1) joins the game

What I am missing to start the campaign with separate client and server instances?

@danfe danfe added the bug label Apr 13, 2023
@danfe danfe mentioned this issue Apr 13, 2023
17 tasks
@IvanSavenko
Copy link
Member

Backtraces from gdb(1) attached to both processes while it hangs:

Looks like client hangs because it wait for another thread to join... Can you post backtraces for all threads of client?
thread apply all bt should do it I believe.

@danfe
Copy link
Author

danfe commented Apr 14, 2023

Can you post backtraces for all threads of client?

set logging on
thread apply all bt full

vcmi-bt-full.txt

@danfe
Copy link
Author

danfe commented Apr 16, 2023

Interesting, I've just built version 1.2.0 (already in the ports) and it apparently works fine with campaign and single scenarios as well. Later I'll try to find the commit which might have fixed it.

@Alexander-Wilms, assuming you're on FreeBSD and was building locally, could you update the ports tree, install the game from /usr/ports/games/vcmi, and try again?

@frostmorn
Copy link

Port 3030 will be used Listening for connections at port 3030 [New Thread 0x7ffff45ff6c0 (LWP 215208)] We got a new connection! :) Established connection with VCMI 1.3.0.df291463d0c9bd2c24b72a68de369bb0c65671db (client). UUID: 05aa020f-bdd6-4854-9f1b-5175b4975de5 [New Thread 0x7ffff3dfe6c0 (LWP 215244)] /usr/include/c++/12.2.1/bits/shared_ptr_base.h:1349: std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::element_type& std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::operator*() const [with _Tp = CGameHandler; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic; bool <anonymous> = false; bool <anonymous> = false; element_type = CGameHandler]: Assertion '_M_get() != nullptr' failed.
Possibly same issue on Arch Linux with version 1.3.0,
boost v 1.81.0-3

@rilian-la-te
Copy link
Contributor

Did not see any issue like this on Arch Linux. Will try today.

@frostmorn
Copy link

frostmorn commented Apr 16, 2023

Tried to rebuild vcmi 1.3 with boost 1.72 and 1.79, first one failed due to preprocessing errors, second failed on a linkage stage. Same happened with vcmi 1.2.

For boost 1.81.0-3 and vcmi 1.3 behavior is just similar, client hangs on a screen above producing no message for user like(can't connect to vcmiserver, found error with connection or some kinda).
vcmiserver at this time just crash the way I mentioned before.

@Puxap-3opre
Copy link

Puxap-3opre commented Apr 18, 2023

I have the same error as @Alexander-Wilms. Also when trying to start a Campaign, the Connection popup appears for a second then disappears and I'm back on the Campaigns screen. Tried both vcmi (1.2.0-1) and vcmi-git (1.3 a.k.a. 1.2.0.213.gdf291463d-1) on AUR (Arch-Linux, in my case Manjaro), after having installed fuzzylogic-git and qt6-tools.

Establishing connection...
Found endpoints:
	0:127.0.0.1:3030
Trying connection to 127.0.0.1:3030(0)
Established connection with VCMI 1.2.0.ec4b05d4dec534882cd7835b2438b4cf80f018d0 (server). UUID: 7ecec151-2c5f-4930-be58-9bd530f34cf8
/usr/include/c++/12.2.1/bits/shared_ptr_base.h:1349: std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::element_type& std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::operator*() const [with _Tp = CGameHandler; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic; bool <anonymous> = false; bool <anonymous> = false; element_type = CGameHandler]: Assertion '_M_get() != nullptr' failed.
Lost connection to server, ending listening thread!
read_some: End of file [asio.misc:2]
Error: server failed to close correctly or crashed!

@juml
Copy link

juml commented Apr 18, 2023

likely same as flathub/eu.vcmi.VCMI#122

@IvanSavenko
Copy link
Member

Flatpak and FreeBSD bugs might be different.

FreeBSD - can you check whether vcmiserver crashes on start? Client should print Error: server failed to close correctly or crashed! when this happens.

This just a guess and I doubt that things would be that easy, but you can try adding

	if (socket)
		socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);

immediately at the start of CConnection::~CConnection() (file lib/serializer/Connection.cpp, line 226)

Flatpak - can you try to find server crash backtrace?
Crash seems to be happening almost immediately on start, so to get gdb attached in time you might want to:

  1. add sleep(20) (or any other duration) immediately after main() in server/CVCMIServer.cpp, line 1065
  2. start client and once server connection popup message is up attach to vcmiserver with gdb

@danfe
Copy link
Author

danfe commented Apr 19, 2023

FreeBSD -- can you check whether vcmiserver crashes on start?

Like I said earlier, I no longer observe this bug since updating to version 1.2.0 (I yet need to find out which commit had fixed it since v1.1.1). But for the record: the server did not crash when this bug was occurring, otherwise I wouldn't be able to attach gdb(1) to it.

@IvanSavenko
Copy link
Member

terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::create_directories: Read-only file system [system:30]: "./Saves", "./Saves"

For this to happen:

  • $XDG_DATA_HOME must not be set
  • $HOME must not be set

Not sure if this is normal / expected or issue comes from invalid environment.
Is this flatpak issue or something we should change?

@IvanSavenko
Copy link
Member

Interesting that this only happens for vcmiserver, vcmiclient runs the same code fine.

Probably related to child processes - somehow 'vcmiserver' process created by 'vcmiclient' have not passed down its environment variables

@gapys-krzysztof
Copy link

gapys-krzysztof commented Apr 22, 2023

I think I can confirm that this is the cause on my end. Installed game through AUR vcmi-git (1.2.0.306.g1fde8b588-1) and experienced this issue, meanwhile manually building it in a local (not read only) folder from the develop branch (1.3.0.1fde8b588bbb12efc2a979fe4506a91753caca38) causes it to run properly.

(not sure why the version mismatch, both seem to point at the same commit?)

I think I found the issue:

terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
  what():  boost::filesystem::create_directories: Read-only file system [system:30]: "./Saves", "./Saves"

@dydzio0614
Copy link
Member

btw @Alexander-Wilms I encourage you to join VCMI slack or VCMI discord if you are interested in more cooperated long term contribution

@IvanSavenko
Copy link
Member

@Alexander-Wilms Not entirely sure how flatpak works but it is somewhat similar to how vcmiserver starts. Which is something like
system("vcmiserver --port=3030");
Which OS will later execute as
/bin/sh -c "vcmiserver --port=3030"
effectively running vcmiserver insider a second shell

@ghost
Copy link

ghost commented Apr 23, 2023

Established connection with VCMI 1.2.0.ec4b05d4dec534882cd7835b2438b4cf80f018d0 (server). UUID: 7ecec151-2c5f-4930-be58-9bd530f34cf8
/usr/include/c++/12.2.1/bits/shared_ptr_base.h:1349: std::__shared_ptr_access<_Tp, _Lp, , >::element_type& std::__shared_ptr_access<_Tp, _Lp, , >::operator*() const [with _Tp = CGameHandler; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic; bool = false; bool = false; element_type = CGameHandler]: Assertion '_M_get() != nullptr' failed.
Lost connection to server, ending listening thread!
read_some: End of file [asio.misc:2]
Error: server failed to close correctly or crashed!

Same behaviour on my Arch Linux installation.
I tried to disable shared pointers, but has no success.

@Puxap-3opre
Copy link

RE: @gapys-krzysztof @Arseniusz
I confirm that it works if I build it according to the instructions here in a user's home subfolder, rather than from AUR vcmi-git in /usr/lib/vcmi. Maybe vcmi-git would work too if you modify PKGBUILD directory setting.

@ghost
Copy link

ghost commented Apr 26, 2023

RE: @gapys-krzysztof @Arseniusz I confirm that it works if I build it according to the instructions here in a user's home subfolder, rather than from AUR vcmi-git in /usr/lib/vcmi. Maybe vcmi-git would work too if you modify PKGBUILD directory setting.

For me compiling from sources also works. So looks like at least on Arch Linux problen in Aur packages.

@Gigas002
Copy link
Contributor

Gigas002 commented Apr 29, 2023

Can confirm it is still occurs with 1.2.0/1.2.1 version of AUR package, though it wasn't a thing on 1.1.1 and lower versions.

@Gigas002
Copy link
Contributor

Gigas002 commented Apr 29, 2023

So, I've ran through several tests, using git bisect, but I haven't found out the commit that caused that issue yet. I'm not sure I'll be able to continue the tests tomorrow, so if anyone wants to catch up on it, here's a point I got to:

Good -- e4f4eb3
Bad -- 64ddd75

Run it as:

git clone https://github.com/vcmi/vcmi && cd vcmi
git bisect start
git bisect good e4f4eb3c1b7f8411d2e0f5b05aff5de6b5335fc5
git bisect bad 64ddd75cdc363a185d4cc9be464fb45923427955

Then clone vcmi-git package from aur and add commit variable into its PKGBUILD like so: source=("$pkgname::git+https://github.com/vcmi/vcmi.git#commit=${_commit}") rhen trigger build:

makepkg --printsrcinfo > .SRCINFO
makepkg -si

P.S.
Skip the d0f57fe, it's unbuildable

@Gigas002
Copy link
Contributor

It seems like the 9f55666 introduced this issue, at least for AUR packages. The 8855829 before this is good, and 4f4f2db after is bad

@IvanSavenko
Copy link
Member

Considering that "AUR package is broken but manual build works"
What are the differences between two?

  • are you using same CMake options as PKGBUILD in AUR does?
  • are you performing an install into /usr/* or running vcmi from build location?

@Gigas002
Copy link
Contributor

For tests I cloned vcmi-git package, the only change was to set the desired commit from git bisect, so it's the same, as for usual package installation (same CMake options, running from /usr/*)

@ghost
Copy link

ghost commented Apr 30, 2023

Considering that "AUR package is broken but manual build works" What are the differences between two?

* are you using same CMake options as PKGBUILD in AUR does?

* are you performing an install into /usr/* or running vcmi from build location?

Yes I am. Exatly same instructions as in PKGBUILD

mkdir -p build && cd build cmake -B. -H.. \ -DCMAKE_INSTALL_PREFIX='/usr' \ -DCMAKE_INSTALL_RPATH='/usr/lib/vcmi' \ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE \ -DCMAKE_SKIP_RPATH='FALSE' \ -DENABLE_TEST=OFF \ -DFORCE_BUNDLED_FL=OFF \ -DCMAKE_BUILD_TYPE='RelWithDebInfo' \ -DCMAKE_POLICY_DEFAULT_CMP0074=NEW make

And then make install

@kambala-decapitator
Copy link
Collaborator

btw -H.. doesn't make any sense, I believe that should've been -S..

@IvanSavenko
Copy link
Member

Thanks for research. Will try to investigate that commit.

To confirm, this is the error message that you get after bad commit?
#1971 (comment)

@kambala-decapitator
Copy link
Collaborator

kambala-decapitator commented Apr 30, 2023

I wanted to test on arch as well (Endeavor OS), but facing that FL doesn't want to build when running yay -S vcmi, do you know how to work this around?

==> Making package: vcmi 1.2.1-1 (Вс 30 апр 2023 19:53:29)
==> Checking runtime dependencies...
==> Missing dependencies:
  -> fuzzylite
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.
 -> error making: vcmi-exit status 8
==> Making package: fuzzylite 6.0-3 (Вс 30 апр 2023 19:53:32)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found fuzzylite-6.0.tar.gz
==> Validating source files with sha256sums...
    fuzzylite-6.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting fuzzylite-6.0.tar.gz with bsdtar
==> Sources are ready.
==> Making package: fuzzylite 6.0-3 (Вс 30 апр 2023 19:53:37)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
-- The CXX compiler identification is GNU 12.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

=====================================
fuzzylite v6.0

FL_CPP98=OFF
FL_USE_FLOAT=OFF
FL_BACKTRACE=ON
FL_LIBS=
FL_INSTALL_BINDIR=bin
FL_INSTALL_LIBDIR=lib
FL_BUILD_TESTS=OFF

CMAKE_BUILD_TYPE=None
CMAKE_CXX_COMPILER_ID=GNU
CMAKE_CXX_COMPILER_VERSION=12.2.1
CMAKE_CXX_FLAGS=-pedantic -Wall -Wextra -Werror -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS
CMAKE_OSX_DEPLOYMENT_TARGET=
COMPILE_DEFINITIONS:
-- Defined: FL_BUILD_PATH="/home/kambala/.cache/yay/fuzzylite/src/fuzzylite-6.0/fuzzylite"
-- Defined: FL_BACKTRACE
=====================================

-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/kambala/.cache/yay/fuzzylite/src/build
make: Entering directory '/home/kambala/.cache/yay/fuzzylite/src/build'
[  1%] Building CXX object CMakeFiles/fl-obj.dir/src/Benchmark.cpp.o
[  2%] Building CXX object CMakeFiles/fl-obj.dir/src/Complexity.cpp.o
[  3%] Building CXX object CMakeFiles/fl-obj.dir/src/Console.cpp.o
[  4%] Building CXX object CMakeFiles/fl-obj.dir/src/activation/First.cpp.o
[  5%] Building CXX object CMakeFiles/fl-obj.dir/src/activation/General.cpp.o
[  6%] Building CXX object CMakeFiles/fl-obj.dir/src/activation/Highest.cpp.o
[  7%] Building CXX object CMakeFiles/fl-obj.dir/src/activation/Last.cpp.o
[  8%] Building CXX object CMakeFiles/fl-obj.dir/src/activation/Lowest.cpp.o
[  9%] Building CXX object CMakeFiles/fl-obj.dir/src/activation/Proportional.cpp.o
[ 10%] Building CXX object CMakeFiles/fl-obj.dir/src/activation/Threshold.cpp.o
[ 11%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/Bisector.cpp.o
[ 12%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/Centroid.cpp.o
[ 13%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/IntegralDefuzzifier.cpp.o
[ 14%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/LargestOfMaximum.cpp.o
[ 15%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/MeanOfMaximum.cpp.o
[ 16%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/SmallestOfMaximum.cpp.o
[ 17%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/WeightedAverage.cpp.o
[ 18%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/WeightedAverageCustom.cpp.o
[ 19%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/WeightedDefuzzifier.cpp.o
[ 19%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/WeightedSum.cpp.o
[ 20%] Building CXX object CMakeFiles/fl-obj.dir/src/defuzzifier/WeightedSumCustom.cpp.o
[ 21%] Building CXX object CMakeFiles/fl-obj.dir/src/Engine.cpp.o
[ 22%] Building CXX object CMakeFiles/fl-obj.dir/src/Exception.cpp.o
[ 23%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/ActivationFactory.cpp.o
[ 24%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/DefuzzifierFactory.cpp.o
[ 25%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/FactoryManager.cpp.o
[ 26%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/FunctionFactory.cpp.o
[ 27%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/HedgeFactory.cpp.o
[ 28%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/SNormFactory.cpp.o
[ 29%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/TermFactory.cpp.o
[ 30%] Building CXX object CMakeFiles/fl-obj.dir/src/factory/TNormFactory.cpp.o
[ 31%] Building CXX object CMakeFiles/fl-obj.dir/src/fuzzylite.cpp.o
[ 32%] Building CXX object CMakeFiles/fl-obj.dir/src/hedge/Any.cpp.o
[ 33%] Building CXX object CMakeFiles/fl-obj.dir/src/hedge/Extremely.cpp.o
[ 34%] Building CXX object CMakeFiles/fl-obj.dir/src/hedge/HedgeFunction.cpp.o
[ 35%] Building CXX object CMakeFiles/fl-obj.dir/src/hedge/Not.cpp.o
[ 36%] Building CXX object CMakeFiles/fl-obj.dir/src/hedge/Seldom.cpp.o
[ 37%] Building CXX object CMakeFiles/fl-obj.dir/src/hedge/Somewhat.cpp.o
[ 38%] Building CXX object CMakeFiles/fl-obj.dir/src/hedge/Very.cpp.o
[ 39%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/CppExporter.cpp.o
[ 39%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/Exporter.cpp.o
[ 40%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/FclExporter.cpp.o
[ 41%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/FclImporter.cpp.o
[ 42%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/FisExporter.cpp.o
[ 43%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/FisImporter.cpp.o
[ 44%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/FldExporter.cpp.o
[ 45%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/FllExporter.cpp.o
[ 46%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/FllImporter.cpp.o
[ 47%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/Importer.cpp.o
[ 48%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/JavaExporter.cpp.o
[ 49%] Building CXX object CMakeFiles/fl-obj.dir/src/imex/RScriptExporter.cpp.o
[ 50%] Building CXX object CMakeFiles/fl-obj.dir/src/main.cpp.o
/home/kambala/.cache/yay/fuzzylite/src/fuzzylite-6.0/fuzzylite/src/main.cpp: In function ‘int main(int, const char**)’:
/home/kambala/.cache/yay/fuzzylite/src/fuzzylite-6.0/fuzzylite/src/main.cpp:24:24: error: ‘void (* std::set_unexpected(unexpected_handler))()’ is deprecated [-Werror=deprecated-declarations]
   24 |     std::set_unexpected(fl::Exception::terminate);
      |     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.1/ios:39,
                 from /usr/include/c++/12.2.1/ostream:38,
                 from /usr/include/c++/12.2.1/iostream:39,
                 from /home/kambala/.cache/yay/fuzzylite/src/fuzzylite-6.0/fuzzylite/./fl/fuzzylite.h:22,
                 from /home/kambala/.cache/yay/fuzzylite/src/fuzzylite-6.0/fuzzylite/./fl/Headers.h:27,
                 from /home/kambala/.cache/yay/fuzzylite/src/fuzzylite-6.0/fuzzylite/src/main.cpp:17:
/usr/include/c++/12.2.1/exception:91:22: note: declared here
   91 |   unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
      |                      ^~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/fl-obj.dir/build.make:790: CMakeFiles/fl-obj.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/fl-obj.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
make: Leaving directory '/home/kambala/.cache/yay/fuzzylite/src/build'
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: fuzzylite-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
fuzzylite - exit status 4
vcmi - exit status 8

@Gigas002
Copy link
Contributor

@kambala-decapitator try installing fuzzylite-git if fuzzylite doesn't builds for you

@kambala-decapitator
Copy link
Collaborator

@kambala-decapitator try installing fuzzylite-git if fuzzylite doesn't builds for you

thanks! it helped, that warning wasn't treated as an error.

@IvanSavenko
Copy link
Member

IvanSavenko commented Apr 30, 2023

This might be the reason: potential nullptr to reference conversion (undefined behavior in c++)
9f55666#diff-4c7f71931df9a5b21c63b766aabea394c6525eb200c0368d719317df686e38f6R437

What compiler and c++ library is used by Arch right now? Probably newer than one we use right now...

Can somebody try applying this patch and check if it has any effect?

server.patch

@kambala-decapitator
Copy link
Collaborator

Established connection with VCMI 1.2.0.ec4b05d4dec534882cd7835b2438b4cf80f018d0 (server). UUID: 7ecec151-2c5f-4930-be58-9bd530f34cf8
/usr/include/c++/12.2.1/bits/shared_ptr_base.h:1349: std::__shared_ptr_access<_Tp, _Lp, , >::element_type& std::__shared_ptr_access<_Tp, _Lp, , >::operator*() const [with _Tp = CGameHandler; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic; bool = false; bool = false; element_type = CGameHandler]: Assertion '_M_get() != nullptr' failed.
Lost connection to server, ending listening thread!
read_some: End of file [asio.misc:2]
Error: server failed to close correctly or crashed!

Same behaviour on my Arch Linux installation. I tried to disable shared pointers, but has no success.

yeah, same assert on my side

@Gigas002
Copy link
Contributor

Gigas002 commented May 1, 2023

@IvanSavenko can confirm this patch fixes issue on arch linux as well

@IvanSavenko
Copy link
Member

Great. Will create PR with that patch today & probably backport it to 1.2

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

Successfully merging a pull request may close this issue.

11 participants