Assert fail

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Assert fail

Post by rebhuhn »

Hello,

I downloaded the latest BfW and did a new install. Have been playing through the pre-packaged campaigns to see what was new.

I have twice now triggered an assert fail. Didn't capture the info from the first time, but I believe it was the same assert. In both cases it occurred at the end of a scenario where I had delayed finishing the scenario to grab xp for some units. so it was the last round of the scenario. I killed all the enemy units, then the leader and got this failure. Replaying the save game I have NOT been able to recreate the failure. Here is the info from the second failure:

Microsoft Windows 10 Home
Version 10.0.18363 Build 18363
Intel i7-8700

BfW versino 1.4.11 in English

The Battle for Wesnoth version 1.14.11
Running on Microsoft Windows 10 (10.0.18363)
Distribution channel: SourceForge

Game paths
==========

Data dir: D:\dbp\Battle for Wesnoth 1.14.11
User config dir: C:\Users\USER\Documents\My Games\Wesnoth1.14
User data dir: C:\Users\USER\Documents\My Games\Wesnoth1.14
Saves dir: C:\Users\USER\Documents\My Games\Wesnoth1.14\saves
Add-ons dir: C:\Users\USER\Documents\My Games\Wesnoth1.14\data\add-ons
Cache dir: C:\Users\USER\Documents\My Games\Wesnoth1.14\cache

Libraries
=========

Boost: 1.59
OpenSSL/libcrypto: 1.1.0f (runtime 1.1.0f)
Cairo: 1.10.2 (runtime 1.10.2)
Pango: 1.30.1 (runtime 1.30.1)
SDL: 2.0.4 (runtime 2.0.4)
SDL_image: 2.0.0 (runtime 2.0.0)
SDL_mixer: 2.0.0 (runtime 2.0.0)
SDL_ttf: 2.0.12 (runtime 2.0.12)

Features
========

JPEG screenshots: no
Lua console completion: yes
Legacy bidirectional rendering: no
Win32 notifications back end: yes

Log from session that crashed:

Battle for Wesnoth v1.14.11
Started on Sun Apr 05 20:21:59 2020

Automatically found a possible data directory at D:\dbp\Battle for Wesnoth 1.14.11

Data directory: D:\dbp\Battle for Wesnoth 1.14.11
User configuration directory: C:\Users\USER\Documents\My Games\Wesnoth1.14
User data directory: C:\Users\USER\Documents\My Games\Wesnoth1.14
Cache directory: C:\Users\USER\Documents\My Games\Wesnoth1.14\cache

Setting mode to 1680x1048
Checking lua scripts... ok

Procedure to create failure:

Playing last round of scenario. Killed all minions, then killed the leader, got an assert fail. This is the second time I have seen this, the first was in a different campaign, again, was the last round of a scenario, killing the leader.

The play was roughly

Sorceress kills undead
Marksman kills bat
Merman uses trident to kill undead
Avenger shoots undead
11.25 mage shoots apprentice
11.24 mage shoots apprentice
horsemen move next to leader
captain moves next to leader
horsemen charge, one of them kills leader.

I have replayed the last turn multiple times and have not been able to recreate the failure.
Attachments
HttT-Muff Malal’s Peninsula-Auto-Save21.gz
(46.68 KiB) Downloaded 55 times
AssertFail.png

User avatar
Pentarctagon
Project Manager
Posts: 4380
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

I'm not able to reproduce this on Linux Mint 19.3 using the 1.14.11 Steam build, at least the few times I tried it. Hopefully someone on Windows can try, though.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

gfgtdf
Developer
Posts: 1318
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

It's quite possible that this fails for other reasons, specific to his hardware. The only cause that i know for this if the gui2 drawing code allocation a too large surface, (when a insanely large gui2 dialog is shown), since there are no large gui2 dialogs involved in your scenario i have absolutley no idea what happened. Maybe this can also happen if the application run out of memeory? But again he is playing a mainline scenario with no addons, there should be any ram problems.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Re: Assert fail

Post by rebhuhn »

Interesting. I am using a larger screen than I've used before, set to 1920 x 1061. Several times in game I have noticed refresh problems with the map not drawing correctly. An enemy unit will move and I'll get echos of it leaving a trail behind the move rather than redrawing the uncovered terrain.

If it happens again, anything I can look for that might help track it?

User avatar
Pentarctagon
Project Manager
Posts: 4380
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

If you're able to compile Wesnoth yourself, reproducing it on a Debug build and getting a backtrace from that would be useful.

Otherwise, you could try the Steam version and see if it still happens there, since the Steam version uses a newer version of SDL (2.0.8 for Steam vs 2.0.4 for SourceForge).
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Re: Assert fail

Post by rebhuhn »

I'm working on a Windows system.

Downloaded the source, found the externals-VC16.zip file and loaded it.

Tried to do a debug build. Build failed because it could not find SDL2Maind.lib. SDL2Main.lib is there in the externals, but not the debug version.
Checked the VC15 externals zip and it's not there either.

Anyone familiar with doing a debug build on Windows and know where I should get SDL2maind.lib from, and if there are any other debug libraries I'm going to need that might be missing?

User avatar
Pentarctagon
Project Manager
Posts: 4380
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

For the VC16 projectfiles, you'll need to use vcpkg. From the command line it should be:

Code: Select all

git clone https://github.com/microsoft/vcpkg.git vcpkg
cd vcpkg
bootstrap-vcpkg.bat
vcpkg integrate install
vcpkg install sdl2:x64-windows sdl2-image:x64-windows sdl2-mixer:x64-windows sdl2-ttf:x64-windows bzip2:x64-windows zlib:x64-windows pango:x64-windows cairo:x64-windows fontconfig:x64-windows libvorbis:x64-windows libogg:x64-windows boost-filesystem:x64-windows boost-iostreams:x64-windows boost-locale:x64-windows boost-random:x64-windows boost-regex:x64-windows boost-asio:x64-windows boost-program-options:x64-windows boost-system:x64-windows boost-thread:x64-windows boost-bimap:x64-windows boost-multi-array:x64-windows boost-ptr-container:x64-windows boost-logic:x64-windows boost-format:x64-windows
This clones down vcpkg, builds vcpkg, integrates it with Visual Studio so VS can find the libraries, then builds all of Wesnoth's dependencies.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Re: Assert fail

Post by rebhuhn »

Progress, but not success yet.

Did the vcpkg install, did a reboot just because, then successfully built wesnothlib, compaignd, liblua, wesnotd and WindowsTimeout

Build of wesnoth, compilations all work, but linking fails looking for
libboost_date_time-vc142-mt-gd-x64-1_70.lib

Looked in external-VC16, found the 32 bit version of the library, but not 64

tried vcpkg install boost-date-time:x64-windows
said the Package is already installed.

searched the computer for libboost*.lib, found only some libboost_exception* libraries under vcpkg and the files in externals-VC16,
which are only x32 versions. That list is below.

Any thoughts on how I can get the 64 bit versions of those libraries directly, or, if vcpkg should have taken care of it, what I might need
to set in VC so that it can find them?

Thanks



./wesnoth-1.14.11/external-VC16/lib/libboost_bzip2-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_bzip2-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_chrono-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_chrono-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_date_time-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_date_time-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_filesystem-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_filesystem-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_iostreams-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_iostreams-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_locale-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_locale-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_prg_exec_monitor-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_prg_exec_monitor-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_program_options-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_program_options-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_random-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_random-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_regex-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_regex-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_system-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_system-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_test_exec_monitor-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_test_exec_monitor-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_thread-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_thread-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_unit_test_framework-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_unit_test_framework-vc142-mt-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_zlib-vc142-mt-gd-x32-1_70.lib
./wesnoth-1.14.11/external-VC16/lib/libboost_zlib-vc142-mt-x32-1_70.lib

User avatar
vultraz
Developer
Posts: 959
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: Assert fail

Post by vultraz »

Hmm... personally, I also installed the catch-all boost:x64-windows vcpkg package in order to catch everything. Does that help?
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?

rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Re: Assert fail

Post by rebhuhn »

Thanks for the thought, but nope, didn't help

gfgtdf
Developer
Posts: 1318
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

maybe its using the headers from the VCExternal folder rarther than the ones installed by vcpck, i'd ry removing/renaming the the external-VC16 folder and then rebuild all
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Re: Assert fail

Post by rebhuhn »

So, removed the VCExternal folder, did a clean and build on each of the 6 projects. No errors.

Tried starting wesnoth.exe, get an assert fail, which is obviously a setup issue:

assert(game_config::path.empty() == false);

So, being new to all this, what do I do to set things up so that I can try out the standard campaigns and see
if I can trap the original assert with this build?

Thanks.

gfgtdf
Developer
Posts: 1318
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

maybe your wesnoth.exe is at the wrong position, iirc on windows it must be as the same directly as the data directory that contains the game data, basicially the same directly structure as the downloaded wesnoth version
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Re: Assert fail

Post by rebhuhn »

Okay, copied directories around and tried again. Yet another assert fail.

Opened the project and tried running from there, same assert fail.

We are in check_fpu() <wesnoth.cpp>

static void check_fpu()
{
uint32_t f_control;

if(_controlfp_s(&f_control, 0, 0) == 0) {
uint32_t unused;
uint32_t rounding_mode = f_control & _MCW_RC;
uint32_t precision_mode = f_control & _MCW_PC;

if(rounding_mode != _RC_NEAR) {
std::cerr << "Floating point rounding mode is currently '"
<< ((rounding_mode == _RC_CHOP)
? "chop"
: (rounding_mode == _RC_UP)
? "up"
: (rounding_mode == _RC_DOWN)
? "down"
: (rounding_mode == _RC_NEAR) ? "near" : "unknown")
<< "' setting to 'near'\n";

if(_controlfp_s(&unused, _RC_NEAR, _MCW_RC)) {
std::cerr << "failed to set floating point rounding type to 'near'\n";
}
}
if(precision_mode != _PC_53) {
std::cerr << "Floating point precision mode is currently '"
<< ((precision_mode == _PC_53)
? "double"
: (precision_mode == _PC_24)
? "single"
: (precision_mode == _PC_64) ? "double extended" : "unknown")
<< "' setting to 'double'\n";

if(_controlfp_s(&unused, _PC_53, _MCW_PC)) <================== Assert failing on this line
std::cerr << "failed to set floating point precision type to 'double'\n";
}

Value of precision_mode is 0
Value of f_control is 524319
value of rounding_mode is 0

Assert pop up is attached. Text is:
File: minkernel\crts\ucrt\src\appcrt\tran\amd64\ieee.c line 106
Expression: (mask&~(_MCW_DNI_MCW_EMI_MCW_RC))==0
Attachments
AssertFail2.png

gfgtdf
Developer
Posts: 1318
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

rebhuhn wrote:
April 8th, 2020, 11:20 pm
Okay, copied directories around and tried again. Yet another assert fail.

Opened the project and tried running from there, same assert fail.

We are in check_fpu() <wesnoth.cpp>

static void check_fpu()
{
uint32_t f_control;

if(_controlfp_s(&f_control, 0, 0) == 0) {
uint32_t unused;
uint32_t rounding_mode = f_control & _MCW_RC;
uint32_t precision_mode = f_control & _MCW_PC;

if(rounding_mode != _RC_NEAR) {
std::cerr << "Floating point rounding mode is currently '"
<< ((rounding_mode == _RC_CHOP)
? "chop"
: (rounding_mode == _RC_UP)
? "up"
: (rounding_mode == _RC_DOWN)
? "down"
: (rounding_mode == _RC_NEAR) ? "near" : "unknown")
<< "' setting to 'near'\n";

if(_controlfp_s(&unused, _RC_NEAR, _MCW_RC)) {
std::cerr << "failed to set floating point rounding type to 'near'\n";
}
}
if(precision_mode != _PC_53) {
std::cerr << "Floating point precision mode is currently '"
<< ((precision_mode == _PC_53)
? "double"
: (precision_mode == _PC_24)
? "single"
: (precision_mode == _PC_64) ? "double extended" : "unknown")
<< "' setting to 'double'\n";

if(_controlfp_s(&unused, _PC_53, _MCW_PC)) <================== Assert failing on this line
std::cerr << "failed to set floating point precision type to 'double'\n";
}

Value of precision_mode is 0
Value of f_control is 524319
value of rounding_mode is 0

Assert pop up is attached. Text is:
File: minkernel\crts\ucrt\src\appcrt\tran\amd64\ieee.c line 106
Expression: (mask&~(_MCW_DNI_MCW_EMI_MCW_RC))==0
Can you give the stderr output for this one?
I think you have found a yet undiscovered bug here that requires a nontrovial fix, please file a bugreport at https://github.com/wesnoth/wesnoth/issues

For the meantime you can just remove these three lines
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

Post Reply