Re: [Gaul-devel] Compiling the examples under AIX
Brought to you by:
stewartadcock
From: Andrew W. N. <and...@gm...> - 2006-05-23 16:08:27
|
On 5/22/06, Andrew W. Nosenko <and...@gm...> wrote: > On 5/22/06, Mike Cooling <m.c...@au...> wrote: > > > hpc 37% dbx wildfire core > > Type 'help' for help. > > [using memory image in core] > > reading symbolic information ... > > > > Segmentation fault in ga_population_new at line 391 in file "" ($t1) > > couldn't read "ga_core.c" > > (dbx) where > > ga_population_new(stable_size =3D 4, num_chromosome =3D -555863816, > > len_chromosome =3D 3200), line 391 in "ga_core.c" > > ga_genesis_integer(0x32, 0x1, 0xc80, 0x20000824, 0x0, 0x0, 0x0, 0x20000= 830), > > line 161 in "ga_utility.c" > > main(argc =3D 1, argv =3D 0x2ff229e8), line 598 in "wildfire.c" > > (dbx) > > > > Does that help? > > Very interesting... I will think... Seems like wildfire* series of examples contains two potencial sources for core dump: 1. By default, AIX allocates small enough per-thread stack (~96 Kb). Therefore, allocating of the 4 arrays by 12.5 Kb each is enough dangerous. ('map' in main() --> 'map' in wildfire_score() --> 'burning' and 'crews' in wildfire_simulation() if "trace" call stack). Attached patch fixes this potencial issue. 2. Out-of-array-bounds access exists in the wildfire_simulation() function. In the 'case 1:' (East direction), 'map[j]' and 'burning[j]' falls over array boundary in the while() condition when 'p =3D=3D 3199' and, therefore, 'j=3D=3D3200' (3200 =3D=3D WILDFIRE_X_DIMENSION*WILDFIRE_Y_DIMENSION) while-loop in question is: while( crews[p]<WILDFIRE_WIND_SPEED && (j=3Dp+crews[p])%WILDFIRE_X_DIMENSION<(WILDFIRE_X_DIMENSION-1)= && map[j] =3D=3D 0 && burning[j] =3D=3D 0 ) I NOT patched this issue because don't understand exactly the used algo and its goal. Therefore, just #warning was added. :-( Stewart, can you look into this? --=20 Andrew W. Nosenko <and...@gm...> |