pystk icon indicating copy to clipboard operation
pystk copied to clipboard

config.RaceMode.CAPTURE_THE_FLAG causes segfault

Open benhoff opened this issue 3 years ago • 0 comments

Describe the bug Using the CAPTURE_THE_FLAG race type causes a segfault

To Reproduce

    config = pystk.GraphicsConfig.hd()
     config.screen_width = 800
     config.screen_height = 600
     pystk.init(config)
 
     config = pystk.RaceConfig()
     config.num_kart = 2
     config.track ='stadium'
 
     # config.players[0].controller = pystk.PlayerConfig.Controller.PLAYER_CONTROL
     config.players[0].controller = pystk.PlayerConfig.Controller.AI_CONTROL
     config.players[0].team = 0
     # NOTE: Add 4 players
     for _ in range(3):
         team_number = (_ + 1) % 2
         print(team_number)
         config.players.append(
                 pystk.PlayerConfig('', pystk.PlayerConfig.Controller.AI_CONTROL, team_number))
              
 
     # config.mode = config.RaceMode.THREE_STRIKES
     config.mode = config.RaceMode.CAPTURE_THE_FLAG
 
     race = pystk.Race(config)
     race.start()
     race.step()
#0  0x00007ffff670945a in std::vector<Quad*, std::allocator<Quad*> >::size (this=0x8) at /usr/include/c++/11.1.0/bits/stl_vector.h:919                   
No locals.                                                                                                                                               
#1  0x00007ffff69706e1 in Graph::findRoadSector (this=0x0, xyz=..., sector=0x555570de6818, all_sectors=0x0, ignore_vertical=false)                       
    at /home/hoff/swdev/pystk/src/tracks/graph.cpp:493                                                                                                   
        indx = -1                                                                                                                                        
        max_count = 32767                                                                                                                                
#2  0x00007ffff6a74a4f in SkiddingAI::reset (this=0x555570de5420) at /home/hoff/swdev/pystk/src/karts/controller/skidding_ai.cpp:177                     
No locals.                                                                                                                                               
#3  0x00007ffff6a7479d in SkiddingAI::SkiddingAI (this=0x555570de5420, kart=0x55555671e790)                                                              
    at /home/hoff/swdev/pystk/src/karts/controller/skidding_ai.cpp:63                                                                                    
No locals.                                                                                                                                               
#4  0x00007ffff6907e76 in World::loadAIController (this=0x555567d41680, kart=0x55555671e790) at /home/hoff/swdev/pystk/src/modes/world.cpp:350           
        controller = 0x0                                                                                                                                 
        turn = 0                                                                                                                                         
#5  0x00007ffff66f4ce2 in PySTKRace::start (this=0x55555cc82700) at /home/hoff/swdev/pystk/pystk_cpp/pystk.cpp:471                                       
        player_kart = 0x55555671e790                                                                                                                     
        i = 0                                                                                                                                            
#6  0x00007ffff66875ad in pybind11::cpp_function::cpp_function<void, PySTKRace, , pybind11::name, pybind11::is_method, pybind11::sibling, char [15]>(void
 (PySTKRace::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [15])::{lambda(PySTKRace*)#1}::operator()(
PySTKRace*) const (__closure=0x55555569d578, c=0x55555cc82700) at /home/hoff/swdev/pystk/lib/pybind11/include/pybind11/pybind11.h:91                     
        f = (void (PySTKRace::*)(PySTKRace * const)) 0x7ffff66f4c2e <PySTKRace::start()>                                                                 
#7  0x00007ffff66cd309 in pybind11::detail::argument_loader<PySTKRace*>::call_impl<void, pybind11::cpp_function::cpp_function<void, PySTKRace, , pybind11
::name, pybind11::is_method, pybind11::sibling, char [15]>(void (PySTKRace::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling co
nst&, char const (&) [15])::{lambda(PySTKRace*)#1}&, 0ul, pybind11::detail::void_type>(pybind11::cpp_function::cpp_function<void, PySTKRace, , pybind11::
name, pybind11::is_method, pybind11::sibling, char [15]>(void (PySTKRace::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling cons
t&, char const (&) [15])::{lambda(PySTKRace*)#1}&, std::integer_sequence<unsigned long, 0ul>, pybind11::detail::void_type&&) && (this=0x7fffffffda20, 
    f=...) at /home/hoff/swdev/pystk/lib/pybind11/include/pybind11/cast.h:119

Screenshots If applicable, add screenshots to help explain your problem.

System information:

  • OS: linux

Additional context This appears to be an issue with the AI. Using all human players does not have this bug pop up

benhoff avatar Dec 08 '21 21:12 benhoff