Assert fail

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

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

gfgtdf wrote: April 9th, 2020, 12:11 am
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>

Code: Select all

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.
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

Sounds like the same crash as this fixed, which doesn't look to have been backported to 1.14 since at the time there probably wasn't a way to build 1.14 as 64-bit on Windows.
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: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

Pentarctagon wrote: April 9th, 2020, 12:31 am Sounds like the same crash as this fixed, which doesn't look to have been backported to 1.14 since at the time there probably wasn't a way to build 1.14 as 64-bit on Windows.
oh indeed
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.
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

In any case I suppose, I've opened #4843 to backport this, assuming there's no reason not to.
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 »

Submitted a bug report, comment out the lines and rebuilt. Tried again.

This time it actual creates the base window, all black with the Wesnoth version as a title.

Then I get an assert fail in SQL_DestroyRenderer(SDL_Renderer * renderer) because the renderer pointer is null.
> SDL2d.dll!SDL_DestroyRenderer_REAL(SDL_Renderer * renderer) Line 3183 C
SDL2d.dll!SDL_DestroyRenderer(SDL_Renderer * a) Line 379 C
wesnoth.exe!gui2::canvas::draw(const bool force) Line 1412 C++
wesnoth.exe!gui2::canvas::blit(surface & surf, SDL_Rect rect) Line 1435 C++
wesnoth.exe!gui2::panel::impl_draw_background(surface & frame_buffer, int x_offset, int y_offset) Line 73 C++
wesnoth.exe!gui2::widget::draw_background(surface & frame_buffer, int x_offset, int y_offset) Line 382 C++
wesnoth.exe!gui2::window::draw() Line 750 C++

Willing to keep going if anyone has suggestions and it's worth the time.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

pushed a simple fix for the SDL_DestroyRenderer assertion failure thing https://github.com/wesnoth/wesnoth/comm ... 7052da5941


I think for the meantime you can just press ignore on this particular assertion failure.
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 »

Applied the patch, up and running scenarios now. Haven't been able to recreate the original assert yet.
rebhuhn
Posts: 32
Joined: March 15th, 2015, 11:08 pm

Re: Assert fail

Post by rebhuhn »

Played through a number to scenarios and now have tripped another graphics assert fail:

> SDL2d.dll!SDL_SetRenderDrawBlendMode_REAL(SDL_Renderer * renderer, SDL_BlendMode blendMode) Line 2213 C
SDL2d.dll!SDL_SetRenderDrawBlendMode(SDL_Renderer * a, SDL_BlendMode b) Line 363 C
wesnoth.exe!gui2::canvas::draw(const bool force) Line 1418 C++
wesnoth.exe!gui2::canvas::blit(surface & surf, SDL_Rect rect) Line 1437 C++
wesnoth.exe!gui2::panel::impl_draw_background(surface & frame_buffer, int x_offset, int y_offset) Line 73 C++
wesnoth.exe!gui2::widget::draw_background(surface & frame_buffer, int x_offset, int y_offset) Line 382 C++74
wesnoth.exe!gui2::window::draw() Line 750 C++
AssertFail3.png
Once again renderer is null

This happens from canvas.cpp, right after the patch we applied. It would appear that the call to
SDL_CreateSoftwareRender(canvas_) has failed.

Going to the output window I find many exceptions, all the same:

Exception thrown at 0x00007FFF50DFA859 in wesnoth.exe: Microsoft C++ exception: std::invalid_argument at memory location 0x0000009057D6C370.

Holding it in the debugger if you have an suggestions on things to check.

The Diagnostic Tools "Failed unexpectedly" so I can't look at memory or cpu usage. Task manager shows 74% memory in use, but Google Chrome is using more than VS or wesnoth.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

rebhuhn wrote: April 11th, 2020, 7:32 pm This happens from canvas.cpp, right after the patch we applied. It would appear that the call to
SDL_CreateSoftwareRender(canvas_) has failed.
Hmm i have no idea what codul hve casues this, we should call SDL_GetError after SDL_CreateSoftwareRenderer, i made a patch to 1.14:


https://github.com/wesnoth/wesnoth/comm ... 23e561fddb

im not sure how to get the result of SDL_GetError via debug mode though.
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.
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

rebhuhn wrote: April 11th, 2020, 7:32 pm Played through a number to scenarios and now have tripped another graphics assert fail:
Which campaign/scenario were you playing when this happened?
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 »

The last save file I can see is HttT-Crossroads-Auto-Save18.gz, so probably round 19 of that scenario.

I started HttT new in this debug session, so I've run through all the scenarios before this and then the 18 turns of this one before it tripped.
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

Can you upload HttT-Crossroads-Auto-Save18.gz here?
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 »

Save attached
Attachments
HttT-Crossroads-Auto-Save18.gz
(65.88 KiB) Downloaded 341 times
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Assert fail

Post by Pentarctagon »

I can't reproduce it, but I also use Linux so that doesn't necessarily mean much I suppose. When you say:
I started HttT new in this debug session, so I've run through all the scenarios before this and then the 18 turns of this one before it tripped.
Do you mean you played through the entire HttT campaign, finished it, started a second play through, and then the Crossroads scenario of the second play through is when you got the assert?
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: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Assert fail

Post by gfgtdf »

rebhuhn wrote: April 11th, 2020, 9:56 pm The last save file I can see is HttT-Crossroads-Auto-Save18.gz, so probably round 19 of that scenario.

I started HttT new in this debug session, so I've run through all the scenarios before this and then the 18 turns of this one before it tripped.
Can you reproduce this issue when reloading that savefile?


EDIT:
Also after you got the assertion failure did you press "ignore"? And if yes what happens then? Did the game cntinue normally?
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