投稿者 トピック: [nightly] koords3d index out of bounds  (参照数 4649 回)

z9999+

  • 管理人
  • 急行
  • *
  • 投稿: 381
[nightly] koords3d index out of bounds
« on: 2011/09/02 22:56 »
This problem is reported in english forum too.
And reproducing this is very difficult, but randomly happened.
I used Ters savegame which is attached here.
http://forum.simutrans.com/index.php?topic=7846.0

I hope this report helps to solve the problem.

Edit:
Forgot to say, I did nothing, loaded savegame and left it.
And this savegame doesn't have any AI player.

コード: [選択]
4794.exe caused an Integer Divide By Zero at location 005eb7b2 in module 4794.exe.

Registers:
eax=0000000f ebx=00000005 ecx=00000000 edx=00000000 esi=00000000 edi=00000000
eip=005eb7b2 esp=0023dca8 ebp=0023dd58 iopl=0         nv up ei pl zr ac po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000256

Call stack:
005EB7B2  4794.exe:005EB7B2  log_t::fatal(char const*, char const*, ...)  log.cc:250
...
// generate a division be zero error, if the user request it
static int make_this_a_division_by_zero = 0;
> printf("%i", 15 / make_this_a_division_by_zero);
make_this_a_division_by_zero &= 0xFF;
}
...

0067E4AD  4794.exe:0067E4AD  vector_tpl<koord3d>::operator[](unsigned) const  vector_tpl.h:254
...
dbg->fatal("vector_tpl<T>::[]", "%s: index out of bounds: %i not in 0..%d", typeid(T).name(), i, count - 1);
}
> return data[i];
}

...

0068B732  4794.exe:0068B732  route_t::position_bei(unsigned short) const  route.h:87
...
* @author Hj. Malthaner
*/
> const koord3d& position_bei(const uint16 n) const { return route[n]; }

koord3d const& front() const { return route.front(); }
...

005F8F73  4794.exe:005F8F73  automobil_t::ist_weg_frei(int&, bool)  simvehikel.cc:2032
...
// calculate new direction
route_t const& r = *cnv->get_route();
> koord next = (route_index < r.get_count() - 1u ? r.position_bei(route_index + 1u) : pos_next).get_2d();
ribi_t::ribi curr_fahrtrichtung   = get_fahrtrichtung();
ribi_t::ribi curr_90fahrtrichtung = calc_richtung(get_pos().get_2d(), pos_next.get_2d());
...

005F9F3D  4794.exe:005F9F3D  automobil_t::ist_weg_frei(int&, bool)  simvehikel.cc:2175
...
const convoi_t* const ocnv = car->get_convoi();
int dummy;
> if(  ocnv->front()->ist_weg_frei(dummy, true)  &&  ocnv->front()->get_route_index() != ocnv->get_route()->get_count()  ) {
return true;
}
...

005F455B  4794.exe:005F455B  vehikel_t::hop_check()  simvehikel.cc:1021
...
// ist_weg_frei() berechnet auch die Geschwindigkeit
// mit der spaeter weitergefahren wird
> if(!ist_weg_frei(restart_speed,false)) {

// convoi anhalten, wenn strecke nicht frei
...

005F1787  4794.exe:005F1787  vehikel_basis_t::fahre_basis(unsigned)  simvehikel.cc:313
...

// Hop as many times as possible.
> while(steps_target>steps_next  &&  hop_check()) {
steps_target -= steps_next+1;
steps_done += steps_next+1;
...

005728E6  4794.exe:005728E6  convoi_t::sync_step(long)  simconvoi.cc:795
...
// now actually move the units
sp_soll += (akt_speed*delta_t);
> uint32 sp_hat = fahr[0]->fahre_basis(sp_soll);
// stop when depot reached ...
if(state==INITIAL) {
...

005DA22E  4794.exe:005DA22E  karte_t::sync_step(long, bool, bool)  simworld.cc:2711
...
// if false, then remove
sync_steppable *ss = *i;
> if(!ss->sync_step(delta_t)) {
delete ss;
}
...

00598DC8  4794.exe:00598DC8  interrupt_check(char const*)  simintr.cc:101
...
enabled = false;
last_time = now;
> welt_modell->sync_step( diff, !welt_modell->is_fast_forward(), true );
enabled = true;
}
...

0045B82D  4794.exe:0045B82D  route_t::intern_calc_route(karte_t*, koord3d, koord3d, fahrer_t*, int, unsigned)  route.cc:472
...
#endif

> INT_CHECK("route 194");
// target reached?
if(!ziel_erreicht  || step >= MAX_STEP  ||  tmp->parent==NULL) {
...

0045B998  4794.exe:0045B998  route_t::calc_route(karte_t*, koord3d, koord3d, fahrer_t*, int, int)  route.cc:513
...
long ms=dr_time();
#endif
> bool ok = intern_calc_route(welt, start, ziel, fahr, max_khm, 0xFFFFFFFFul );
#ifdef DEBUG_ROUTES
if(fahr->get_waytype()==water_wt) {DBG_DEBUG("route_t::calc_route()","route from %d,%d to %d,%d with %i steps in %u ms found.",start.x, start.y, ziel.x, ziel.y, route.get_count()-1, dr_time()-ms );}
...

005F7DCB  4794.exe:005F7DCB  automobil_t::calc_route(koord3d, koord3d, int, route_t*)  simvehikel.cc:1809
...
}
target_halt = halthandle_t();// no block reserved
> return route->calc_route(welt, start, ziel, this, max_speed, cnv->get_tile_length() );
}

...

00572C75  4794.exe:00572C75  convoi_t::drive_to()  simconvoi.cc:868
...
}

> if(  !fahr[0]->calc_route( start, ziel, speed_to_kmh(min_top_speed), &route )  ) {
if(  state != NO_ROUTE  ) {
state = NO_ROUTE;
...

005732B5  4794.exe:005732B5  convoi_t::step()  simconvoi.cc:989
...
}
// Hajo: now calculate a new route
> drive_to();
// finally, was there a record last time?
if(max_record_speed>welt->get_record_speed(fahr[0]->get_waytype())) {
...

005DC795  4794.exe:005DC795  karte_t::step()  simworld.cc:3293
...
for(sint32 i=convoi_array.get_count()-1;  i>=0;  i--  ) {
convoihandle_t cnv = convoi_array[i];
> cnv->step();
if((i&7)==0) {
INT_CHECK("simworld 1947");
...

005E8449  4794.exe:005E8449  karte_t::interactive(unsigned)  simworld.cc:5873
...
INT_CHECK( "karte_t::interactive()" );
set_random_mode( STEP_RANDOM );
> step();
clear_random_mode( STEP_RANDOM );
idle_time = ((idle_time*7) + next_step_time - dr_time())/8;
...

005A0057  4794.exe:005A0057  simu_main(int, char**)  simmain.cc:1195
...

// run the loop
> welt->interactive(quit_month);

new_world = true;
...

00615A50  4794.exe:00615A50  WinMain  simsys_w.cc:786
...
}

> simu_main(argc, argv);
timeEndPeriod(1);

...

0061682A  4794.exe:0061682A  dr_play_sample(int, int)  win32_sound.cc:102
...
last_sample_nr = sample_number;
}
> }

...

00401247  4794.exe:00401247
004012B8  4794.exe:004012B8
7C817077  kernel32.dll:7C817077  RegisterWaitForInputIdle


« 最終編集: 2011/09/03 02:19 by z9999+ »

z9999+

  • 管理人
  • 急行
  • *
  • 投稿: 381
Re:[nightly] koords3d index out of bounds
« 返信 #1 on: 2011/09/07 20:07 »
関連トピック:

http://forum.simutrans.com/index.php?topic=7868.0
引用: infernalmachine
The index is not always "8" but it is always an integer less than 10. These first appeared with r4778.

So, I am suspicious of commit r4775.

CHG: vehicle behaviour at intersections
https://github.com/aburch/simutrans/commit/b00b523187d17753b6a89e8e10f324b5000afbc7