Thursday, September 27, 2007

memory dump

path_L = (Point*)memalign(8, 4*npoints*sizeof(Point)); // should be + 1
path_R = (Point*)memalign(8, 4*npoints*sizeof(Point));
// if npoints = 2
path_L[8] = something;
path_R[8] = something;
free(path_L);
free(path_R);

There is a BSP general exception happens and says the memory alignment problem in memory location 0008d380. path_L overwrites part of path_R and make 'free' wrong.
objdump --syms test.bsp | sort grep " g" > test.map

Open the .map file the find the memory location close to the reported location. In this case, something was wrong with 'free_r'.

1 comment: