Stuck at 100% CPU simulating other teams' games

Here you can... report bugs. Open a new thread for each bug, please.
Post Reply
Certes
Posts: 5
Joined: Thu Aug 29, 2019 1:18 pm

Stuck at 100% CPU simulating other teams' games

Post by Certes »

I'm enjoying the game very much. Thanks for all your work. I have one problem: simulating other teams' games (CPU vs CPU) sometimes goes into an infinite loop. When continuing after finishing my own match, the picture appears in the middle of the screen, the progress bar moves part way, the results flash by but it then stops, using 100% CPU permanently. It doesn't happen after every match - I've managed to play five matches into a season before getting stuck - but it's consistent when resuming from the same save file. I attach a save from my current game which always freezes displaying the result of Valencia vs Hajduk Split. (The score varies each time it's run. It's probably actually simulating the next match after that.)

I'm running version 2.3.2 on Ubuntu 16.04 and playing Altrincham. There doesn't seem anything odd about my current fixture: Bygfoot freezes in the same place whether I win or lose, get a red card, etc. Any help would be appreciated.
Attachments
Altrincham.1.11.2.zip
Save file after my match but before CPUvCPU matches. Click the bus to reproduce the problem.
(725.96 KiB) Downloaded 274 times
gunnar
Site Admin
Posts: 233
Joined: Wed Oct 19, 2005 11:13 am
Contact:

Re: Stuck at 100% CPU simulating other teams' games

Post by gunnar »

I can't promise when, but I'll look into it.
Certes
Posts: 5
Joined: Thu Aug 29, 2019 1:18 pm

Re: Stuck at 100% CPU simulating other teams' games

Post by Certes »

Thank you!

Tail from debug is:
cup_get_choose_team_league_cup: sid england5 league National Conference
Start w 11 r 2
followed by the usual hundreds of expressions, the last one being
misc_string_replace_expressions: #_LAYERDIFF_ = 1 or 1 < -8#
So I think it's finished the round 1 matches properly (the Valencia result is only shown because it was the last match of the round) and is setting up round 2.

I downloaded real team names but I've also reproduced the behaviour with the original definitions files, so I don't think that's the problem.
billys_boots
Posts: 105
Joined: Wed Apr 17, 2019 4:45 pm

Re: Stuck at 100% CPU simulating other teams' games

Post by billys_boots »

I don't know if a problem I sometimes get is the same. After week 10 the match window doesn't close and the game stops. I have to kill that window (I run Bygfoot on Linux) and I can then either click on the bus icon or press the spacebar which moves me forward one week. I don't lose any match data from week 10 and I can scroll back and check the results from that week. This doesn't happen every time or for every league so I just put this down to one of those strange occurrences that happen during the game. What I haven't checked is cpu usage when this happens, so thanks for the heads up on this and I will check that the next time it happens.
Certes
Posts: 5
Joined: Thu Aug 29, 2019 1:18 pm

Re: Stuck at 100% CPU simulating other teams' games

Post by Certes »

I have slightly different symptoms but the problems may be related. Clicking the bus or pressing space does nothing for me. I can click menus and select options such as Team → Playing style → Balanced but they don't actually do anything. Closing the window brings up the Linux "program not responding" dialog. ps shows one bygfoot process running. Killing it kills bygfoot (not just the match window), as does clicking "Force quit" on the Linux dialog. Despite the title I made up before trying debug mode, I think the program is setting up round 2, not still simulating the non-player round 1 games.
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Re: Stuck at 100% CPU simulating other teams' games

Post by will_the_canuck »

Hello Certes.

I am another user who checks the forum out at times, like the other two people who responded to your post already, although only one of them has the knowledge to do anything about it, when it comes to programming things. :) Though, I do have some thoughts and questions for you about this odd "bug".

First off, I did download and try your saved file and find the result rather odd. Before I even downloaded it, I thought it was related to the auto-save feature, as I know that can take up some cpu power when saving, at least on my single core cpu computers that I have. So as it may not appear to be that, as I did check the "saves" directory and nothing new is happening, that may not be the problem.

Now you do say you have been enjoying the game very much. How long have you played this game would you say? Also, how long on your current system can I ask? And how old is your computer might you say, roughly speaking? Other points of interest appear to be that the version you provided in the saved game has or uses real names for the teams. Is this something you did yourself or find online to download or what can I ask?

Additional information that is useful is that you're using the latest version 2.3.2 and running in on Ubuntu 16.04. I use Lubuntu 18.04 myself on a netbook with an atom processor and let me say that after upgrading from 16.04 to 18.04, the apport thingie doesn't seem to work as well, so if any errors on the system happen, I can't seem to report them for some odd reason too. Oh well. I'll likely have to reinstall it sometime in the future. Just mentioning this.

1. FC Köln and Bayern München. Look at how they are displayed in this game. In Week 11 round 2, Bayern München appears to be loading for the first time, although 1. FC Köln has already appeared in weeks 7 and 9. I think that this could be a problem and if so, it could relate to the Germany definitions. One question Certes is that when you play bygfoot, you said that this usually happens that you get to a certain point and then it stops. Is that correct? Also, what country files do you normally play? If you only play teams from Europe, this could be the issue. Could you try playing a team from another continent like North America, South America, or even Australia or Japan, to see if this problem persists. I guess also for the fun of it, could you also try playing Bayern München from the Germany definitions and see how that goes, whether or not it creates a similar error that you are experiencing. That is one way to determine if the Germany definitions are the problem or not. I would think you would just have to play a few rounds to see if anything comes up or not.

If the problem persists, have you ever uninstalled and then reinstalled the game bygfoot, playing with the original definitions only? Hopefully if you had to reinstall the game, you would hopefully allow the previous installation to be completely wiped so as to get a fresh install to compare it to.

And on a personal note, you mentioned you did a debug mode. How did you do that? I'm just curious and might want to try it out sometime too.

So if the problem isn't the germany spellings, I haven't a clue, but if the problem only relates to European countries, then that's another interesting point. So good luck Certes and let us know the outcomes of trying other teams from continents not in Europe, if you haven't tried any of those before.

will_the_canuck
Certes
Posts: 5
Joined: Thu Aug 29, 2019 1:18 pm

Re: Stuck at 100% CPU simulating other teams' games

Post by Certes »

Hello Will,

I'm new to bygfoot and have only played the lowest English league. Thank you for your suggestion about selecting other teams; I'll try that next time I play. I'll also try reinstalling bygfoot and not adding the real definitions. I got them from https://bygfoot.sourceforge.io/old_site ... _names.zip.

The file I attached is a manual save, because I wanted to save after my match (to save others having to replay it) but before other round 1 matches (after which the round 2 setup starts immediately and fails). Autosave runs in less than a second and produces a good file that reloads perfectly. My PC is about five years old and has four cores but bygfoot only uses one of them. When I replace my PC I'll install a later Linux (probably Mint 19 based on 18.04) but for now I'm sticking with LTS 16.04.

For debugging, I used a terminal to run "bygfoot --debug-level=1000". (Smaller numbers probably work just as well.) My next step would be to compile from source and add more debug statements to find exactly where in the code it's stopping. That should identify the problem. A simple example would be a counter which should increase but gets incremented by 0 due to bad data and loops forever without reaching its limit, but I expect it's actually something more complex.
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Re: Stuck at 100% CPU simulating other teams' games

Post by will_the_canuck »

Certes wrote: Sun Sep 01, 2019 12:10 pm Hello Will,

I'm new to bygfoot and have only played the lowest English league. Thank you for your suggestion about selecting other teams; I'll try that next time I play. I'll also try reinstalling bygfoot and not adding the real definitions. I got them from https://bygfoot.sourceforge.io/old_site ... _names.zip.
Hello again Certes.

Ah...a few things actually which somehow skipped my mind when writing my last post to you. :) Since you are using Ubuntu 16.04, if you installed bygfoot through the Ubuntu Repositories, then you shouldn't have to uninstall and then reinstall bygfoot if the extras you installed above were installed into your home directory (i.e. /home/user_id/.bygfoot-2.3.2/definitions/) directory. That is because bygfoot installs itself in the directory of /usr/share/games/bygfoot/support_files, where the original definitions would exist in a directory in the support_files directory itself. So if you just deleted the definitions directory in your home directory (/home/user_id/.bygfoot-2-3-2/definitions) while not having bygfoot open or loaded, and then running it after the directory has been deleted, it should repopulate the directory with the original definitions. Now if you installed the extras into the /usr/share... directory, then yes, you would have to uninstall the game and then reinstall it to get the original definitions back. This is something that I forgot about when writing the last post about this issue.

Now I will say that I also downloaded the official_names.zip file to take a look at it and I think I might have an idea to what the problem could be. It might be the team definition files for the related teams and not subsequently the country and league definition files, although you can't rule them out either, but they likely may not be the cause of this problem. What I think the problem is relates to the use of special characters in the team and player names and it might relate to creating or saving the files under Windows and using them with bygfoot. I suspect this because having modified the Mexican definition files in Windows XP, when I would load the file up in notepad, the special characters did not translate well and I had to use the ASCII/decimal code for the special letters (i.e. &#243; for ó). Also, the files in Windows had to be saved in ANSI format I believe, which may not have been the default for notepad. When you look at some of the team definition files that have special characters for the team and player names, they display characters that are different from what they should be and it seems to be similar to what would happen if the special letters were inputted through a Windows program. Anyways, that's one thought on that. :)

I'll add that right now, I played part of a game on no live game and am up to week 20, playing as Altrinchan, but I only have the original definitions installed, nothing more in relation to the UEFA countries.
For debugging, I used a terminal to run "bygfoot --debug-level=1000". (Smaller numbers probably work just as well.) My next step would be to compile from source and add more debug statements to find exactly where in the code it's stopping. That should identify the problem. A simple example would be a counter which should increase but gets incremented by 0 due to bad data and loops forever without reaching its limit, but I expect it's actually something more complex.
Thanks for that debugging information. It might be useful to use sometime to check on a few bugs and where to identify it in the code, if I ever get that far. :) But as for this issue Certes, it feels like there are just a few bad definition files that are causing your problem. And without proper testing before releasing those definition files, they can spring up on people and they likely wouldn't know why otherwise.

Anyways, that's all for now from me and I'll let you go. Hopefully you can enjoy the game once again without any major errors happening, like this one.

will_the_canuck
Certes
Posts: 5
Joined: Thu Aug 29, 2019 1:18 pm

Re: Stuck at 100% CPU simulating other teams' games

Post by Certes »

Thanks for that, Will. I've now played a whole season as "B. Münich" with the original definitions and everything worked smoothly. I've also played half a season with Altrincham with original definitions (much further than I got last time) with no problems. I think you're right about the definitions being the problem. In particular, things can go wrong if these custom definitions are in use when starting the game (even if you later save, switch back to standard definitions and reload). I do indeed use the Ubuntu distribution of bygfoot and I didn't reinstall. I had renamed the original definitions directory (rather than deleting it) so I just switched back before starting these games.

I'm happy to live with standard definitions and will play without real names in future. The game works well as designed; I just broke it trying to install an improvement. Thanks again for all your help, and happy footballing.
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Re: Stuck at 100% CPU simulating other teams' games

Post by will_the_canuck »

Certes wrote: Tue Sep 03, 2019 10:31 am Thanks for that, Will. I've now played a whole season as "B. Münich" with the original definitions and everything worked smoothly. I've also played half a season with Altrincham with original definitions (much further than I got last time) with no problems. I think you're right about the definitions being the problem. In particular, things can go wrong if these custom definitions are in use when starting the game (even if you later save, switch back to standard definitions and reload). I do indeed use the Ubuntu distribution of bygfoot and I didn't reinstall. I had renamed the original definitions directory (rather than deleting it) so I just switched back before starting these games.
Hey Certes. I just wanted to comment and say that I believe that the definitions you start a game with and then save that game and then reload that game another time, those are the definitions that you will use for that particular saved game, for as long as you play with that saved game. Even if you were to have different definitions for the country file that you were playing, they would not affect the saved game you were playing unless you started a new game with those different definitions. So in theory, you could have different definitions for the same country/team and different saved games for them and they would be totally different.
I'm happy to live with standard definitions and will play without real names in future. The game works well as designed; I just broke it trying to install an improvement. Thanks again for all your help, and happy footballing.
Thank you and you're welcome. Hopefully you can get lots of enjoyment from the game and from any future added definitions that may be created, as well as properly tested. ;) Bye for now.

will_the_canuck
Post Reply