The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: dummy | Created: 2017-10-19 10:46:20
Subject: Segfault in Mouse, Tiger
While testing with Corkscrew I got a segfault. The situation was extreme however as Mouse and Tiger weren't able to pit and constantly got stuck ;)

Thread 1 "torcs-bin" received signal SIGSEGV, Segmentation fault.
Stuck::init (this=this@entry=0x7fffe73ad5e8 <s_robot+18120>, track=...,
s=s@entry=0x555555931ab0, me=me@entry=0x5555565f4570) at Stuck.cpp:683
683 if( !cell.isAvailable() )
(gdb) #0 Stuck::init (this=this@entry=0x7fffe73ad5e8 <s_robot+18120>, track=...,
s=s@entry=0x555555931ab0, me=me@entry=0x5555565f4570) at Stuck.cpp:683
#1 0x00007fffe719e348 in Stuck::executeRacing (
this=this@entry=0x7fffe73ad5e8 <s_robot+18120>, track=..., s=s@entry=0x555555931ab0,
me=me@entry=0x5555565f4570, mySit=...) at Stuck.cpp:165
#2 0x00007fffe719e44c in Stuck::execute (this=0x7fffe73ad5e8 <s_robot+18120>, track=...,
s=0x555555931ab0, me=0x5555565f4570, mySit=...) at Stuck.cpp:125
#3 0x00007fffe718f1ec in MyRobot::Drive (this=0x7fffe73a8f20 <s_robot>, index=0,
car=0x5555565f4570, s=0x555555931ab0) at MyRobot.cpp:3537
Last Edited: 2017-10-19 10:46:20 by dummy
    Author: timfoden | Created: 2017-10-19 19:27:30
    Subject: Re: Segfault in Mouse, Tiger
    Thanks for the bug report.

    Due to the problem you mentioned with pitting I've seen pretty much the same thing too, and already fixed it. It needs an "if(!isValid(x,y)) continue;" before the call to "at(x,y)", both before line 681 and before line 744.

    You should be able to fix the pitting by copying the car6-trb1.xml to track-corkscrew.xml and then changing the value of "pit entry offset" to "125".
    Last Edited: 2017-10-19 19:27:30 by timfoden
      Author: dummy | Created: 2017-10-19 21:37:25
      Subject: Re: Segfault in Mouse, Tiger
      Thanks Tim, I will do so.
      Last Edited: 2017-10-19 21:37:25 by dummy