MantisBT - VCMI
View Issue Details
0002177VCMIMechanics - Adventure Mappublic2015-04-09 12:172023-10-28 20:37
resolvedunable to reproduce 
0002177: Server crashes on FreeBSD
I'm trying to run vcmi on FreeBSD. After some minor changes ( [^] + another one for which I'm still to prepare proper patch) it builds fine, launcher, client and server run, however when I try to start the game (either random map or campaign), server dies:

    CPack serialized... this should not happen!

Logs attached. Any more info I could provide? Tracebacks are disabled atm, but can do. Would tcpdump capture be useful?
No tags attached.
txt VCMI_Client_log.txt (82,138) 2015-04-09 12:18
txt VCMI_Server_log.txt (64,835) 2015-04-09 12:18
txt wireshark-dump.txt (9,910) 2015-04-11 02:19
Issue History
2015-04-09 12:17AMDmi3New Issue
2015-04-09 12:18AMDmi3File Added: VCMI_Client_log.txt
2015-04-09 12:18AMDmi3File Added: VCMI_Server_log.txt
2015-04-11 02:19AMDmi3File Added: wireshark-dump.txt
2015-04-11 02:44AMDmi3Note Added: 0005701
2015-04-11 02:44AMDmi3Note Edited: 0005701bug_revision_view_page.php?bugnote_id=5701#r2902
2015-04-11 02:45AMDmi3Note Edited: 0005701bug_revision_view_page.php?bugnote_id=5701#r2903
2015-04-11 02:46AMDmi3Note Edited: 0005701bug_revision_view_page.php?bugnote_id=5701#r2904
2015-04-11 02:47AMDmi3Note Edited: 0005701bug_revision_view_page.php?bugnote_id=5701#r2905
2015-04-12 04:55AVSNote Added: 0005721
2015-04-14 03:28AMDmi3Note Added: 0005732
2015-04-14 03:43AMDmi3Note Edited: 0005732bug_revision_view_page.php?bugnote_id=5732#r2912
2015-04-14 08:48AVSNote Added: 0005733
2016-09-18 20:27SXXNote Added: 0006687
2023-10-28 20:37NordsoftStatusnew => resolved
2023-10-28 20:37NordsoftFixed in Version => 1.4.0
2023-10-28 20:37NordsoftResolutionopen => unable to reproduce
2023-10-28 20:37NordsoftAssigned To => Nordsoft

2015-04-11 02:44   
(edited on: 2015-04-11 02:47)
The original description may not be fully correct. Actually, the client crashes with SIGBUS, I originally though this is because of server error, but the CPack serialized message may be unrelated. Client backtrace:

#0 0x000000080e8694e6 in ?? () from /usr/local/lib/
#1 0x000000080e811f99 in ?? () from /usr/local/lib/
0000002 0x0000000810514a6b in ?? () from /usr/local/lib/
0000003 0x00000008105a5cb3 in ?? () from /usr/local/lib/
0000004 0x00000008105a5d20 in ?? () from /usr/local/lib/
0000005 0x000000080e860cd0 in ?? () from /usr/local/lib/
0000006 0x000000000056ce01 in CGuiHandler::renderFrame()::$_2::operator()() const (this=0x7fffffffc498) at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/gui/CGuiHandler.cpp:427
0000007 0x000000000056eb8c in __invoke<(lambda at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/gui/CGuiHandler.cpp:414:18) &> (__f=...) at /usr/include/c++/v1/__functional_base:413
0000008 std::__1::__function::__func<CGuiHandler::renderFrame()::$_2, std::__1::allocator<CGuiHandler::renderFrame()::$_2>, void ()>::operator()() (this=0x7fffffffc490) at /usr/include/c++/v1 /functional:1370
0000009 0x00000000004fc377 in std::__1::function<void ()>::operator()() const (this=0x7fffffffc490) at /usr/include/c++/v1/functional:1756
0000010 0x0000000000b15df7 in CGPreGame::runLocked(std::__1::function<void ()>) (this=0x80c0add80, cb=...) at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CPreGame.cpp:549
0000011 0x0000000000b15e4c in non-virtual thunk to CGPreGame::runLocked(std::__1::function<void ()>) () at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CPreGame.cpp:546
0000012 0x000000000056ca36 in CGuiHandler::renderFrame (this=0x10288d0 <GH>) at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/gui/CGuiHandler.cpp:433
0000013 0x0000000000a067e4 in mainLoop () at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CMT.cpp:1197
0000014 0x00000000009ffb0d in main (argc=1, argv=0x7fffffffe9e8) at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CMT.cpp:485

2015-04-12 04:55   
04:15:09.350783 ERROR global [0x80c006400] - Selected resolution 1920x1080 was not found!
04:15:09.351010 ERROR global [0x80c006400] - Falling back to 800x600

1) Smth wrong with configuration

2) backtrace missing inside SDL: CGuiHandler.cpp:427 is SDL call but dot directly libGL. May be SDL bug.
2015-04-14 03:28   
(edited on: 2015-04-14 03:43)
> 04:15:09.350783 ERROR global [0x80c006400] - Selected resolution 1920x1080 was not found!
> 04:15:09.351010 ERROR global [0x80c006400] - Falling back to 800x600
>1) Smth wrong with configuration

This is seemingly irrelevant - the game was run from launcher then and probably I've tried selecting 1920x1080 resolution. There's no such error when the game is run as `vcmiclient'

> 2) backtrace missing inside SDL: CGuiHandler.cpp:427 is SDL call but dot directly libGL. May be SDL bug.

With SDL1:

#0 0x000000080688f71a in thr_kill () from /lib/
#1 0x000000080688f688 in raise () from /lib/
0000002 0x000000080688de29 in abort () from /lib/
0000003 0x000000080686eeb1 in __assert () from /lib/
0000004 0x000000080cc45857 in _XReply () from /usr/local/lib/
0000005 0x000000080cc41557 in XSync () from /usr/local/lib/
0000006 0x000000080328b97a in XSync (a=0x80c75b000, b=0) at ./src/video/x11/SDL_x11sym.h:104
0000007 0x000000080329903b in X11_VideoQuit (this=0x80c407400) at ./src/video/x11/SDL_x11video.c:1493
0000008 0x000000080327d299 in SDL_VideoQuit () at ./src/video/SDL_video.c:1365
0000009 0x000000080323f738 in SDL_QuitSubSystem (flags=65535) at ./src/SDL.c:196
0000010 0x000000080323f7be in SDL_Quit () at ./src/SDL.c:222
0000011 0x0000000806866d68 in __cxa_finalize () from /lib/
0000012 0x00000008068052dc in exit () from /lib/
0000013 0x0000000000835c83 in CServerHandler::callServer (this=0x7fffdf3f6dc8) at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/Client.cpp:1003
0000014 0x0000000000846ca2 in boost::_mfi::mf0<void, CServerHandler>::operator()(CServerHandler*) const ()
0000015 0x0000000000846c00 in void boost::_bi::list1<boost::_bi::value<CServerHandler*> >::operator()<boost::_mfi::mf0<void, CServerHandler>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, CServerHandler>&, boost::_bi::list0&, int) ()
0000016 0x0000000000846b9c in boost::_bi::bind_t<void, boost::_mfi::mf0<void, CServerHandler>, boost::_bi::list1<boost::_bi::value<CServerHandler*> > >::operator()() ()
0000017 0x0000000000846b4c in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, CServerHandler>, boost::_bi::list1<boost::_bi::value<CServerHandler*> > > >::run()
0000018 0x000000080302844b in boost::(anonymous namespace)::thread_proxy (param=<optimized out>) at libs/thread/src/pthread/thread.cpp:164
0000019 0x0000000806536774 in ?? () from /lib/
0000020 0x0000000000000000 in ?? ()

#0 0x0000000803249eab in SDL_PumpEvents () at ./src/events/SDL_events.c:376
#1 0x0000000803249f01 in SDL_PollEvent (event=0x7fffffffc950) at ./src/events/SDL_events.c:395
0000002 0x0000000000a05360 in mainLoop () at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CMT.cpp:1195
0000003 0x00000000009fdfdf in main (argc=1, argv=0x7fffffffe9d8) at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CMT.cpp:485

With SDL2:

#0 0x00000008032a88ce in SDL_PumpEvents_REAL () at /usr/work/usr/ports/devel/sdl20/work/SDL2-2.0.3/src/events/SDL_events.c:402
#1 0x00000008032a8948 in SDL_WaitEventTimeout_REAL (event=0x7fffffffc510, timeout=0) at /usr/work/usr/ports/devel/sdl20/work/SDL2-2.0.3/src/events/SDL_events.c:435
0000002 0x00000008032a8907 in SDL_PollEvent_REAL (event=0x7fffffffc510) at /usr/work/usr/ports/devel/sdl20/work/SDL2-2.0.3/src/events/SDL_events.c:417
0000003 0x0000000803294e54 in SDL_PollEvent (a=0x7fffffffc510) at /usr/work/usr/ports/devel/sdl20/work/SDL2-2.0.3/src/dynapi/SDL_dynapi_procs.h:157
0000004 0x0000000000a066f0 in mainLoop () at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CMT.cpp:1192
0000005 0x00000000009ffb0d in main (argc=1, argv=0x7fffffffe9d8) at /usr/work/home/amdmi3/projects/ports/vcmi/work/vcmi-0.98/client/CMT.cpp:485

It seems to me that these are races when client exits after server dies.

Is there a way to run client and server separately (and on different hosts)? I'd like to try running FreeBSD client with Linux server and vice versa, and to run server in separate gdb. Unfortunately I couldn't find a way to tell client to use specific server instead of running its own.

2015-04-14 08:48   
>Is there a way to run client and server separately (and on different hosts)?
No. (You can connect to network game from host with any OS/architecture, but there is no possibility (yet) to run dedicated server.)
2016-09-18 20:27   
BTW I fixed server startup now so it's possible to run server without client.

Also added option to conect to any IP/port for "host" player: [^]