Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seg Fault when enemy can't produce any troop/tanks #106

Open
gurditsbedi opened this issue Feb 8, 2019 · 7 comments
Open

Seg Fault when enemy can't produce any troop/tanks #106

gurditsbedi opened this issue Feb 8, 2019 · 7 comments

Comments

@gurditsbedi
Copy link

version: ToF_Beta_0.7.0_linux64
execution using: ./ToF_Beta_0.7.0_linux64.bin

got the following output

Boot splash path: res://assets/splash_screen.png
Loaded certs from 'res://assets/dst.crt':  1
ToF: map file user://restore_map.map not exists!
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
ERROR: get_node: Condition ' !node ' is true. returned: __null
   At: scene/main/node.cpp:907.
Segmentation fault (core dumped)

In campaign mode, map peninsula.

I put a tank in every troop/tank spawn point i.e. infront of HQ, barracks and factory.
I end my turn.
And it is CPU turn now. after 1 sec their is segfault.

possible reason from my point of view: enemy unable to create any troop/tank.

@czlowiekimadlo
Copy link
Collaborator

Interesting. I have done this strategy multiple times on all campaign maps and never encountered an error. I'll try reproducing this with the release version.

@gurditsbedi
Copy link
Author

order of putting tanks:

  1. In front of factory
  2. In front of barracks
  3. In front of HQ
    after which an in-game dialog appears and it crashes to seg fault

@gurditsbedi
Copy link
Author

I have more observation.

There are many times when the game closes while its running (only in campaign mode), the issue is am not seeing any pattern.

It gives segmentation fault.

@teeks99
Copy link

teeks99 commented Mar 3, 2019

I'm also seeing seg faults in ToF_Beta_0.7.0_linux64. I haven't been able to narrow it down to any specific action. I also see the repeated

ERROR: get_node: Condition ' !node ' is true. returned: __null                                                          
   At: scene/main/node.cpp:907.     

but I'm not sure if that is related, because I also see that at other times.

Any info on generating a debug version and catching the segfault?

@teeks99
Copy link

teeks99 commented Mar 4, 2019

If it is helpful, I was able to capture the core dump, I'll leave it out here for a short-ish amount of time:
http://jimbo.teeks99.com/tmp/core-ToF_Beta_0.7.0_.14833.lisa.1551660197

@teeks99
Copy link

teeks99 commented Mar 4, 2019

Running the source inside of the Godot engine seemed to have an issue at move_hand.gd:15: Invalid get index 'position_on_map' (on base: 'previously freed instance').

@czlowiekimadlo
Copy link
Collaborator

Ah, this issue again. Thank you for your help!
This one is very tricky, as it may show up (or not) depending on the performance of the device and order of execution of some code. Would explain why I very rarely get it on my PC.
Re-write of the whole AI had minimizing this specific issue in mind, as one of the goals. This stems from flaws that go deep in the code, and the architecture of the game as a whole. It's one of the reasons I consider starting whole new ToF project on Godot 3.1 (with backwards compatibility) instead of porting current codebase.
As for why this issue occures, it might be, because some unit dies, and it's queue_free() gets delayed, so next AI loop picks up this unit, but it dissapears during the loop, when it should not have been considered from the get go. Very nasty thing to debug and fix, as Godot has very poor support for detecting if a particular variable references some memory, that has been freed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants