spammed with error messages

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:
Post Reply
vghetto
Posts: 198
Joined: November 2nd, 2019, 5:12 pm

spammed with error messages

Post by vghetto »

Hi,

I'm getting spammed with the same error message on 1.15.5 with no hint on what is causing it. This didn't happen on 1.14

this is a small sample of what the console says.

Code: Select all

20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
20200927 14:13:46 error general: Invalid range: -999
Unfortunately these messages repeat so much that it pushed up an actual micro ai lua error that I no longer have the output for :(

that error was something about a nil value in robust attack and move something
hopefully I'll be able to recreate that error too.
User avatar
Pentarctagon
Project Manager
Posts: 4532
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: spammed with error messages

Post by Pentarctagon »

If you're on Windows, you can take a look at the log file which should have all the messages present. For macOS or Linux, you'll need to run Wesnoth from the command line to see the same information.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
vghetto
Posts: 198
Joined: November 2nd, 2019, 5:12 pm

Re: spammed with error messages

Post by vghetto »

yes, i'm on linux and I'm getting that error message in the command line console. They are so many that my console cannot scroll up further up to see the other error messages.
I'll see about redirecting stdout and stderr to a file to get around it.

Anyone has any hints on what could be triggering that invalid range error message? wesnoth 1.14.14 didn't complain about anything like that.

Anyway, I managed to grab the micro ai error.
This is wesnoth 1.15.5.

Code: Select all

20200927 15:49:44 error scripting/lua: attempt to call a nil value
stack traceback:
        [C]: in field 'attack'
        ai/lua/ai_helper.lua:448: in field 'robust_move_and_attack'
        ai/lua/ca_high_xp_attack.lua:301: in field 'execution'
        [string "local self, params, data, filter_own = ......"]:2: in main chunk
Oh, I don't see the invalid range error inside wesnoth itself, it is only seen on the command line.
The lua error on the other hand I got inside of wesnoth as a chat message on the top left corner.
User avatar
Pentarctagon
Project Manager
Posts: 4532
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: spammed with error messages

Post by Pentarctagon »

You should also be able to change how many lines of text the console can display.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
mattsc
Developer
Posts: 1171
Joined: October 13th, 2010, 6:14 pm
Location: Hidden on the hex behind Fred

Re: spammed with error messages

Post by mattsc »

On the Micro AI error, somebody reported the same thing to me a few weeks ago via PM. Unfortunately, without a way to reproduce it, I cannot tell what causes this. As in, I know what the error is complaining about, but I don't know why this is happening. Do you have a save, or another way for me to reproduce this?

Edit: Actually, it's not a Micro AI error, this is one of the new CAs of the updated default AI.

Edit2: Oh, unless it's the Fast MAI, which uses this CA as well. It's been too long, I've forgotten half of this ... :P
vghetto
Posts: 198
Joined: November 2nd, 2019, 5:12 pm

Re: spammed with error messages

Post by vghetto »

Ok, I'm getting somewhere...

about

Code: Select all

error general: Invalid range: -999
this error seems to be related to fire_event or the macro CALL_FUNCTION.
I'm attaching _main.cfg that reproduces the error. Right click on the red mage and select fire event... then select CALL_FUNCTION.
Look and your console and you'll see the error twice.

Hi, mattsc!

I'm attaching my save file of Wild Frontiers. I didn't get the error on replay, but if you load the save file and click End turn, you'll get the error on the Orcs turn. It will happen after one of the assasin orcs gets zapped with a rune.
You don't have to move anyone, just click End turn, I've tried it 3 or 4 time and each time I got the lua error.
Hint: press shift to speed things up :)

Edit: the invalid range error seems to be complaining about undefined x2,y2 passed in secondary_unit. It is part of CALL_FUNCTION macro

Code: Select all

[secondary_unit]
    x=$x2
    y=$y2
[/secondary_unit]
Attachments
WF.gz
(516.49 KiB) Downloaded 26 times
_main.cfg
(2.22 KiB) Downloaded 26 times
mattsc
Developer
Posts: 1171
Joined: October 13th, 2010, 6:14 pm
Location: Hidden on the hex behind Fred

Re: spammed with error messages

Post by mattsc »

Hi vghetto. Thanks for the save. I can reproduce the error now and have started looking into it, but I do not understand what is going on. The error happens at the end of attacks on units that are 1 XP from advancing, but the attack (and the advancing afterward) seems to execute just fine.

Strangely, it only happens at the end of attacks on units on Side 9. If you use debug mode to change the side of the Junior Commander on 46,9 and the Heavy Infantryman on 37,13 to Side 1 (simply press shift-u once for each), the same attacks happen but there's no error. If you only change one of them to Side 1, then it happens whenever the still-on-Side-9 unit gets attacked. Do you do anything special with units of that side at the end of attacks, or when they advance?

I am reasonably sure that this is not a problem caused by the Micro AI itself. What I don't understand yet is whether it's an engine bug, or something in your add-on that throws the AI attack execution for a loop. I'll keep digging around, but if you can think of anything that might be related, let me know.
vghetto
Posts: 198
Joined: November 2nd, 2019, 5:12 pm

Re: spammed with error messages

Post by vghetto »

Hi mattsc,
yes, this doesn't seem to be related to WF or Micro AI.
I managed to reproduce it in the attached demo consistently. Start and click on End Turn, the error happens when side 3 unit advances after they get attacked.

Please feel free to open a ticket on github about it.

Thank you.
Attachments
_main.cfg
(2.19 KiB) Downloaded 30 times
mattsc
Developer
Posts: 1171
Joined: October 13th, 2010, 6:14 pm
Location: Hidden on the hex behind Fred

Re: spammed with error messages

Post by mattsc »

Hi vghetto,

Thank you for putting that demo together, that's been very helpful! I may open a github issue for it later. For now, I'm still looking into what might be going on myself. So far I can tell that the problem appears to have been introduced somewhere between the 1.15.2 and 1.15.3 releases. I hope that I won't have to do a full bisect, but if that's what it takes ... I'll let you know what I find.

Thanks!

EDIT: On the positive side, everything seems to execute just fine. So for now, you can just ignore the error message (dismiss it with ctrl-x or whatever the shortcut is on your system) and hopefully we'll have it fixed by the next release.
mattsc
Developer
Posts: 1171
Joined: October 13th, 2010, 6:14 pm
Location: Hidden on the hex behind Fred

Re: spammed with error messages

Post by mattsc »

Really quick update: Pentarctagon did the bisecting, and gfgtdf fixed the bug in this commit. The error was only triggered when it was an AI side attacking another AI side and when the unit leveling up was the defender, that's why it was hard to track down.
Post Reply