Bus error - Help!

Hi,
I've been asked to see if I can fix a C program so that it will run on a mac. It currently compiles and runs perfectly on a linux machine, but as soon as you run it on a mac, it will compile, but quit with a bus error very early on. The full code is here:
// Program for the construction of cartograms (density-equalizing map
// projections) using the Gastner-Newman technique. The program needs polygon
// coordinates and a count of cases in each region as input, calculates the new
// coordinates, and writes these to a file. Postscript images of the original
// map and the cartogram are created.
// WRITTEN BY MICHAEL GASTNER, September 20, 2004.
// If you use output created by this program please acknowledge the use of this
// code and its first publication in:
// "Generating population density-equalizing maps", Michael T. Gastner and
// M. E. J. Newman, Proceedings of the National Academy of Sciences of the
// United States of America, vol. 101, pp. 7499-7504, 2004.
// The input coordinates in MAPGENFILE must be in ArcInfo "generate" format of
// the type:
// 1
// 0.3248690E+06 0.8558454E+06
// 0.3248376E+06 0.8557575E+06
// 0.3248171E+06 0.8556783E+06
// 0.3247582E+06 0.8556348E+06
// 0.3246944E+06 0.8555792E+06
// 0.3246167E+06 0.8555253E+06
// 0.3250221E+06 0.8557324E+06
// 0.3249436E+06 0.8557322E+06
// 0.3248690E+06 0.8558454E+06
// END
// 1
// 0.3248690E+06 0.8558454E+06
// 0.3249651E+06 0.8558901E+06
// 0.3250519E+06 0.8559769E+06
// 0.3250691E+06 0.8561246E+06
// 0.3249678E+06 0.8560541E+06
// 0.3249003E+06 0.8560088E+06
// 0.3076424E+06 0.8477603E+06
// 0.3075691E+06 0.8477461E+06
// 0.3075595E+06 0.8476719E+06
// END
// 2
// 0.6233591E+06 0.6056502E+06
// 0.6235193E+06 0.6056467E+06
// 0.6235054E+06 0.6055372E+06
// 0.7384296E+06 0.2334260E+06
// 0.7383532E+06 0.2345770E+06
// END
// END
// The number of cases in CENSUSFILE must be given in the form
// region #cases (optional comment), e. g:
// 43 0.9 Alabama
// 51 0.3 Alaska
// 37 0.8 Arizona
// 47 0.6 Arkansas
// 25 5.4 California
// 32 0.8 Colorado
// 19 0.8 Connecticut
// 29 0.3 Delaware
// 28 0.3 District of Columbia
// 49 2.5 Florida
// 45 1.3 Georgia
// 1 0.4 Hawaii
// The output coordinates are written to CARTGENFILE in ArcInfo "generate"
// format. A postscript image of the original input is prepared as MAP2PS,
// an image of the cartogram as CART2PS.
// Modified on Oct 29, 2004. The number of divisions in each dimension lx, ly
// will now be determined from the input map. Also fixed array bound
// violations in intpol and newt2, and centered the ps-files.
// Modified on Dec 3, 2004. Introduced pointers bbmaxx,bbmaxy,bbminx,bbminy -
// the bounding box coordinates for each polygon - to reduce calculations in
// crnmbr. Thanks to Chris Brunsdon for the suggestion.
// Program now terminates with error message if there is no density specified
// in CENSUSFILE for a region on the map.
// "Donut" polygons are now handled properly. Polygons oriented clockwise will
// be considered exterior boundaries. If they are oriented anti-clockwise they
// are holes inside an enclosing polygon. (Unconventional for mathematicians,
// but this is ArcGIS standard.) The identifier is either that of the enclosing
// polygon, or -99999 in which case it is a hole in the preceding polygon.
// The population can now be a floating-point number.
// If a region contains exactly zero population, it will be replaced by
// MINPOPFAC times the smallest positive population in any region.
// Obviously, MINPOPFAC should be <1, I will set it to 0.1 by default. This
// should reduce the value of sigma necessary for the integrator to finish
// properly.
// Modified on March 31, 2005. Initialized maxchange in nonlinvoltra() as
// INFTY. Replaced crnmbr() by a similar, but faster routine interior().
// Many thanks to Stuart Anderson for pointing out this shortcut.
// TO DO LIST:
// - Do Gaussian blur within nonlinvoltra as a simple call to calcv and
// eliminate gaussianblur().
// - Modify the NR code for the FFTs to deal more naturally with the fencepost
// issue. No more copying of arrays in sinft and cosft.
// - Write truly two-dimensional versions of coscosft, cossinft, and sincosft.
// See Chan and Ho: A new two-dimensional fast cosine transform algorithm,
// IEEE Transactions on Signal Processing, 39, 481ff. (1991).
// - Read polygon data directly from shapefile instead of generate file.
// - Reorganize data structures. It is currently quite a mess to read.
// Inclusions
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
// Definitions
#define CART2PS "./cart.ps","w" // Cartogram image.
#define CARTGENFILE "./cartogram.gen" // Cartogram generate file.
#define CENSUSFILE "./census.dat","r" // Input.
#define CONVERGENCE 1e-100 // Convergence criterion for integrator.
// #define DISPLFILE "./displ.dat","w"
#define FALSE 0
#define HINITIAL 1e-4 // Initial time step size in nonlinvoltra.
#define IMAX 50 // Maximum number of iterations in Newton-Raphson routine.
#define INFTY 1e100
#define LINELENGTH 1000
#define MAP2PS "map.ps","w" // Map image.
#define MAPGENFILE "./map.gen","r" // Input coordinates.
#define MAX(a,b) ((b>a)?(b):(a))
#define MAXINTSTEPS 3000 // Maximum number of time steps in nonlinvoltra.
#define MAXNSQLOG 18 // The number of sample points for rho_0 is <~2^MAXNSQLOG.
#define MIN(a,b) ((b<a)?(b):(a))
#define MINH 1e-5 // Smallest permitted time step in the integrator.
#define MINPOPFAC 0.1 // Replace 0 population by a fraction of the minimum.
#define NR_END 1
#define NSUBDIV 1 // Number of linear subdivisions for digitizing the density.
#define PADDING 1.5 // Determines space between map and boundary.
#define PI 3.141592653589793
#define SIGMA 0.1 // Initial width of Gaussian blur.
#define SIGMAFAC 1.2 // Increase sigma by this factor. Must be > 1.
#define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr;
#define TIMELIMIT 1e8 // Maximum time allowed in integrator.
#define TOLF 1e-3 // Sensitivity w. r. t. function value in newt2.
#define TOLINT 1e-3 // Sensitivity of the integrator.
#define TOLX 1e-3 // Sensitivity w. r. t. independent variables in newt2.
#define TRUE !FALSE
// Types
typedef int BOOLEAN;
typedef struct
float x;
float y;
} POINT;
// Globals
float bbmaxx,*bbmaxy,*bbminx,*bbminy,**gridvx,*gridvy,maxx,maxy,minpop,
minx,miny,polymaxx,polymaxy,polyminx,polyminy,*rho,**rho_0,**vx,**vy,*x,
*xappr,xstepsize,**y,*yappr,ystepsize;
int lx,ly,maxid,nblurs=0,npoly,npolycorn,*npolyinreg,nregcorn,nregion,
polygonid,**polyinreg,*regionid,*regionidinv,*within;
POINT *polycorn,*regcorn;
// Function prototypes
int readline(char line[],FILE *infile);
void countpoly(FILE *infile);
void countcorn(FILE *infile);
void readcorn(FILE *infile);
void makeregion(void);
void pspicture(FILE *outfile);
void bboxes(void);
void interior(void);
double regionarea(int ncrns,POINT *polygon);
void digdens(void);
void four1(float data[],unsigned long nn,int isign);
void realft(float data[],unsigned long n,int isign);
void cosft(float z[],unsigned long n,int isign);
void sinft(float z[],unsigned long n,int isign);
void coscosft(float **y,int isign1,int isign2);
void cossinft(float **y,int isign1,int isign2);
void sincosft(float **y,int isign1,int isign2);
float **dmatrix(long nrl,long nrh,long ncl,long nch);
float *d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
void free_matrix(float **m,long nrl,long nrh,long ncl,long nch);
void free_f3tensor(float *t,long nrl,long nrh,long ncl,long nch,long ndl,
long ndh);
void fourn(float data[],unsigned long nn[],int ndim,int isign);
void rlft3(float *data,float **speq,unsigned long nn1,unsigned long nn2,
unsigned long nn3,int isign);
void gaussianblur(void);
void initcond(void);
void calcv(float t);
float intpol(float **arr,float x,float y);
BOOLEAN newt2(float h,float *xappr,float xguess,float *yappr,float yguess,
int j,int k);
BOOLEAN nonlinvoltra(void);
POINT transf(POINT p);
void cartogram(void);
// Function to read one line.
int readline(char line[],FILE *infile)
if (fgets(line,LINELENGTH,infile)==NULL) return 1;
return 0;
// Function to count the number of polygons.
void countpoly(FILE *infile)
char line[LINELENGTH];
npoly = 0;
while (!readline(line,infile)) if (line[0] == 'E') npoly++;
npoly--; // The .gen file ends with two consecutive "END"s.
// Function to count polygon corners. Also determines minimum/maximum x-/y-
// coordinate.
void countcorn(FILE *infile)
BOOLEAN bnd_ok = FALSE;
char line[LINELENGTH];
float x,y;
int polyctr=0,ratiolog;
npolycorn = (int*)calloc(npoly,sizeof(int));
polycorn = (POINT*)malloc(npoly*sizeof(POINT));
readline(line,infile); // Skip first line.
readline(line,infile);
sscanf(line,"%f %f",&x,&y);
polyminx = x; polymaxx = x; polyminy = y; polymaxy = y;
npolycorn[0] = 1;
while (!readline(line,infile))
if (line[0] != 'E')
sscanf(line,"%f %f",&x,&y);
if (x < polyminx) polyminx = x;
if (x > polymaxx) polymaxx = x;
if (y < polyminy) polyminy = y;
if (y > polymaxy) polymaxy = y;
npolycorn[polyctr]++;
else
readline(line,infile);
polycorn[polyctr] = (POINT)malloc(npolycorn[polyctr]sizeof(POINT));
polyctr++;
if (ceil(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2))+
floor(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2))>
2*log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2))
ratiolog = (int)floor(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2));
else
ratiolog = (int)ceil(log((polymaxx-polyminx)/(polymaxy-polyminy))/log(2));
lx = (int)pow(2,(int)(0.5*(ratiolog+MAXNSQLOG)));
ly = (int)pow(2,(int)(0.5*(MAXNSQLOG-ratiolog)));
if ((polymaxx-polyminx)/lx > (polymaxy-polyminy)/ly)
maxx = 0.5((1PADDING)*polymaxx(1-PADDING)polyminx);
minx = 0.5((1-PADDING)*polymaxx(1PADDING)polyminx);
maxy = 0.5(polymaxypolyminy(maxx-minx)ly/lx);
miny = 0.5(polymaxy+polyminy-(maxx-minx)ly/lx);
else
maxy = 0.5((1PADDING)*polymaxy(1-PADDING)polyminy);
miny = 0.5((1-PADDING)*polymaxy(1PADDING)polyminy);
maxx = 0.5(polymaxxpolyminx(maxy-miny)lx/ly);
minx = 0.5(polymaxx+polyminx-(maxy-miny)lx/ly);
// Uncomment the next lines for interactive choice of boundary conditions.
/* printf("For the %i polygon(s) under consideration:\n",npoly);
printf("minimum x = %f\tmaximum x = %f\n",polyminx,polymaxx);
printf("minimum y = %f\tmaximum y = %f\n",polyminy,polymaxy);
while (!bnd_ok)
printf("Type in your choice of boundaries.\nminx = ");
scanf("%f",&minx);
printf("maxx = ");
scanf("%f",&maxx);
printf("miny = ");
scanf("%f",&miny);
printf("maxy = ");
scanf("%f",&maxy);
if (minx>polyminx || maxx<polymaxx || miny>polyminy || maxy<polymaxy)
printf("Invalid choice, does not enclose the polygon(s).\n");
else bnd_ok = TRUE;
// Function to read polygon corners. The first and last vertex of each polygon
// must be identical.
void readcorn(FILE *infile)
char line[LINELENGTH];
float xcoord,ycoord;
int i,id,polyctr=0;
polygonid = (int)malloc(npolysizeof(int));
xstepsize = (maxx-minx)/lx;
ystepsize = (maxy-miny)/ly;
if (fabs((xstepsize/ystepsize)-1)>1e-3)
fprintf(stderr,"WARNING: Area elements are not square: %f : %f\n",
xstepsize,ystepsize);
readline(line,infile);
sscanf(line,"%i",&id);
polygonid[polyctr] = id;
i = 0;
while (!readline(line,infile))
if (line[0] != 'E')
sscanf(line,"%f %f",&xcoord,&ycoord);
polycorn[polyctr].x = (xcoord-minx)/xstepsize;
polycorn[polyctr][i++].y = (ycoord-miny)/ystepsize;
else
// Is first and last vertex the same?
if (fabs(polycorn[polyctr][0].x-
polycorn[polyctr][npolycorn[polyctr]-1].x)+
fabs(polycorn[polyctr][0].y-
polycorn[polyctr][npolycorn[polyctr]-1].y)>1e-12)
fprintf(stderr,
"ERROR: %i-th polygon does not close upon itself.\n",
polyctr+1);
fprintf(stderr,"Identifier %i, first point %f %f.\n",
polygonid[polyctr],polycorn[polyctr][0].x*xstepsize+minx,
polycorn[polyctr][0].y*ystepsize+miny);
exit(1);
readline(line,infile);
sscanf(line,"%i",&id);
i = 0;
polyctr++;
if (polyctr<npoly) polygonid[polyctr] = id;
polyminx = (polyminx-minx)/xstepsize;
polyminy = (polyminy-miny)/ystepsize;
polymaxx = (polymaxx-minx)/xstepsize;
polymaxy = (polymaxy-miny)/ystepsize;
// Function to make regions from polygons.
void makeregion(void)
BOOLEAN repeat;
int i,lastid,minid,polyctr,ptctr,regctr;
// Count the number of regions.
nregion = 0;
maxid = minid = polygonid[0];
for (polyctr=0; polyctr<npoly; polyctr++)
if (polygonid[polyctr] == -99999) continue;
if (polygonid[polyctr]>maxid || polygonid[polyctr]<minid) nregion++;
else
repeat = FALSE;
for (i=0; i<polyctr; i++)
if (polygonid[polyctr]==polygonid)
repeat = TRUE;
break;
if (!repeat) nregion++;
if (polygonid[polyctr]>maxid) maxid = polygonid[polyctr];
if (polygonid[polyctr]<minid) minid = polygonid[polyctr];
if (minid < 0)
fprintf(stderr,
"ERROR: Negative region identifier %i.\n",minid);
exit(1);
// Match region identifiers.
regionid = (int)malloc(nregionsizeof(int));
nregion = 0;
maxid = minid = polygonid[0];
for (polyctr=0; polyctr<npoly; polyctr++)
if (polygonid[polyctr] == -99999) continue;
if (polygonid[polyctr]>maxid || polygonid[polyctr]<minid)
regionid[nregion++] = polygonid[polyctr];
else
repeat = FALSE;
for (i=0; i<polyctr; i++)
if (polygonid[polyctr]==polygonid)
repeat = TRUE;
break;
if (!repeat) regionid[nregion++] = polygonid[polyctr];
if (polygonid[polyctr]>maxid) maxid = polygonid[polyctr];
if (polygonid[polyctr]<minid) minid = polygonid[polyctr];
regionidinv = (int)malloc((maxid+1)sizeof(int));
// Negative number for unused identifiers.
for (i=0; i<=maxid; i++) regionidinv = -1;
for (regctr=0; regctr<nregion; regctr++)
regionidinv[regionid[regctr]] = regctr;
// Which polygons contribute to which regions?
npolyinreg = (int*)calloc(nregion,sizeof(int));
polyinreg = (int*)malloc(nregion*sizeof(int));
lastid = polygonid[0];
for (polyctr=0; polyctr<npoly; polyctr++)
if (polygonid[polyctr] != -99999)
npolyinreg[regionidinv[polygonid[polyctr]]]++;
lastid = polygonid[polyctr];
else npolyinreg[regionidinv[lastid]]++;
for (regctr=0; regctr<nregion; regctr++)
polyinreg[regctr] = (int)malloc(npolyinreg[regctr]sizeof(int));
for (regctr=0; regctr<nregion; regctr++) npolyinreg[regctr] = 0;
lastid = polygonid[0];
for (polyctr=0; polyctr<npoly; polyctr++)
if (polygonid[polyctr] != -99999)
polyinreg[regionidinv[polygonid[polyctr]]]
[npolyinreg[regionidinv[polygonid[polyctr]]]++] = polyctr;
lastid = polygonid[polyctr];
else polyinreg[regionidinv[lastid]][npolyinreg[regionidinv[lastid]]++]
= polyctr;
// Make regions from polygons. Start and end each polygon at (0,0).
nregcorn = (int*)calloc(nregion,sizeof(int));
regcorn = (POINT*)malloc(nregion*sizeof(POINT));
for (regctr=0; regctr<nregion; regctr++)
for (i=0; i<npolyinreg[regctr]; i++)
nregcorn[regctr] += npolycorn[polyinreg[regctr]]+1;
nregcorn[regctr]++;
for (regctr=0; regctr<nregion; regctr++)
regcorn[regctr] = (POINT)malloc(nregcorn[regctr]sizeof(POINT));
ptctr = 0;
regcorn[regctr][ptctr].x = regcorn[regctr][ptctr++].y = 0.0;
for (polyctr=0; polyctr<npolyinreg[regctr]; polyctr++)
for (i=0; i<npolycorn[polyinreg[regctr][polyctr]]; i++)
regcorn[regctr][ptctr++] = polycorn[polyinreg[regctr][polyctr]];
regcorn[regctr][ptctr].x = regcorn[regctr][ptctr++].y = 0.0;
// Function to prepare a map in postscript standard letter format.
void pspicture(FILE *outfile)
char line[LINELENGTH];
float addx,addy,b,conv,g,r;
int ptctr,regctr;
if (11*lx > 8.5*ly)
conv = (float)8.5*72/lx;
addx = 0;
addy = 1136-8.5*36ly/lx;
else
conv = (float)11*72/ly;
addx = 8.536-11*36lx/ly;
addy = 0;
fprintf(outfile,"0.5 setlinewidth\n");
for (regctr=0; regctr<nregion; regctr++)
fprintf(outfile,"newpath\n");
fprintf(outfile,"%f %f moveto\n",
regcorn[regctr][1].x*conv+addx,
regcorn[regctr][1].y*conv+addy);
for (ptctr=2; ptctr<nregcorn[regctr]; ptctr++)
if (fabs(regcorn[regctr][ptctr].x)+
fabs(regcorn[regctr][ptctr].y)>1e-12)
fprintf(outfile,"%f %f lineto\n",
regcorn[regctr][ptctr].x*conv+addx,
regcorn[regctr][ptctr].y*conv+addy);
else
fprintf(outfile,"closepath\n");
if (ptctr<nregcorn[regctr]-1)
ptctr++;
fprintf(outfile,"%f %f moveto\n",
regcorn[regctr][ptctr].x*conv+addx,
regcorn[regctr][ptctr].y*conv+addy);
// Determine colors for map (without better knowledge I will do it
// arbitrarily).
if (regctr%3 == 0)
r = (float)regctr/nregion;
g = 1-(float)regctr/nregion;
b = fabs(1-2*(float)regctr/nregion);
else if (regctr%3 == 1)
b = (float)regctr/nregion;
r = 1-(float)regctr/nregion;
g = fabs(1-2*(float)regctr/nregion);
else
g = (float)regctr/nregion;
b = 1-(float)regctr/nregion;
r = fabs(1-2*(float)regctr/nregion);
fprintf(outfile,"%f %f %f setrgbcolor\ngsave\nfill\n",r,g,b);
fprintf(outfile,"grestore\n0 setgray stroke\n");
fprintf(outfile,"showpage\n");
// Function to find the bounding box for each polygon.
void bboxes(void)
int i,j;
float maxx, minx, maxy, miny;
bbmaxx = (float)malloc(npolysizeof(float));
bbmaxy = (float)malloc(npolysizeof(float));
bbminx = (float)malloc(npolysizeof(float));
bbminy = (float)malloc(npolysizeof(float));
for (i = 0; i < npoly; i++)
maxx = polycorn[0].x;
maxy = polycorn[0].y;
minx = maxx;
miny = maxy;
for (j = 0; j < npolycorn; j++)
if (polycorn[j].x > maxx) maxx = polycorn[j].x;
if (polycorn[j].x < minx) minx = polycorn[j].x;
if (polycorn[j].y < miny) miny = polycorn[j].y;
if (polycorn[j].y > maxy) maxy = polycorn[j].y;
bbmaxx=maxx;
bbmaxy=maxy;
bbminx=minx;
bbminy=miny;
void interior(void)
int i,inhowmanyregions,inregion[2],j,k,l,m,n,regctr;
// Initialize within[][]. -1 means outside all regions.
for (i=0; i<=lx; i++) for (j=0; j<=ly; j++) within[j] = -1;
// Fill within[][].
for (i=0; i<nregion; i++) for (j=0; j<npolyinreg; j++)
for (k=0, n=npolycorn[polyinreg[j]]-1;
k<npolycorn[polyinreg[j]]; n=k++)
for (l=(int)ceil(MIN(polycorn[polyinreg[j]][k-1].y,
polycorn[polyinreg[j]][k].y));
l<MAX(polycorn[polyinreg[j]][k-1].y,
polycorn[polyinreg[j]][k].y); l++)
for (m=(int)floor(bbminx[polyinreg[j]]);
m<(polycorn[polyinreg[j]][n].x-
polycorn[polyinreg[j]][k].x)*
(l-polycorn[polyinreg[j]][k].y)/
(polycorn[polyinreg[j]][n].y-
polycorn[polyinreg[j]][k].y)+
polycorn[polyinreg[j]][k].x;
m++)
within[m][l] = i-within[m][l]-1;
// Function to determine polygon area. This is needed to determine the average
// population.
// The problem in short is to find the area of a polygon whose vertices are
// given. Recall Stokes' theorem in 3d for a vector field v:
// integral[around closed curve dA]v(x,y,z).ds =
// integral[over area A]curl(v).dA.
// Now let v(x,y,z) = (0,Q(x,y),0) and dA = (0,0,dx*dy). Then
// integral[around closed curve dA]Q(x,y)dy = integral[over area A]dQ/dxdxdy.
// If Q = x:
// A = integral[over area A]dx*dy = integral[around closed curve dA]x dy.
// For every edge from (x,y) to (x[i1],y[i1]) there is a
// parametrization
// (x(t),y(t)) = ((1-t)xtx[i+1],(1-t)y+ty[i1]), 0<t<1
// so that the path integral along this edge is
// int[from 0 to 1]{(1-t)xt*x[i+1]}(y[i1]-y)dt =
// 0.5(y[i1]-y)(x+x[i1]).
// Summing over all edges yields:
// Area = 0.5*[(x[0]+x[1])(y[1]-y[0]) + (x[1]+x[2])(y[2]-y[1]) + ...
// ...(x[n-1]+x[n])(y[n]-y[n-1])+(x[n]x[0])(y[0]-y[n])]
// ArcGIS treats a clockwise direction as positive, so there is a minus sign.
double regionarea(int ncrns,POINT *polygon)
double area=0;
int i;
for (i=0; i<ncrns-1; i++)
area -=
0.5(polygon.xpolygon[i+1].x)(polygon[i1].y-polygon.y);
return area -= 0.5(polygon[ncrns-1].x+polygon[0].x)
(polygon[0].y-polygon[ncrns-1].y);
// Function to digitize density.
void digdens(void)
char line[LINELENGTH];
double area,avgdens,*cases,dens,minpop=INFTY,ncases,totarea=0.0,totpop=0.0;
FILE* infile;
int i,id,ii,inhowmanyregions,inregion[2],j,jj,regctr;
if ((infile=fopen(CENSUSFILE))==NULL)
fprintf(stderr,"ERROR: Cannot find CENSUSFILE.\n");
exit(1);
// Find the minimum positive number of cases.
while (!readline(line,infile))
sscanf(line,"%i %lf",&id,&ncases);
if (ncases<minpop && ncases>1e-12) minpop = ncases;
fclose(infile);
// Store the number of cases in an array.
cases = (double)malloc(nregionsizeof(double));
for (i=0; i<nregion; i++) cases = -1.0;
infile = fopen(CENSUSFILE);
while (!readline(line,infile))
sscanf(line,"%i %lf",&id,&ncases);
if (id>maxid || regionidinv[id]<0)
fprintf(stderr,"ERROR: Identifier %i in CENSUSFILE does not\n",id);
fprintf(stderr,"match any identifier in generate file.\n");
exit(1);
if (ncases>1e-12) totpop += (cases[regionidinv[id]] = ncases);
else totpop += (cases[regionidinv[id]] = MINPOPFAC*minpop);
for (regctr=0; regctr<nregion; regctr++) if (cases[regctr] < 0.0)
fprintf(stderr,"ERROR: No density for region %i?\n",regionid[regctr]);
fprintf(stderr,"cases = %f\n",cases[regctr]);
exit(1);
fclose(infile);
// Calculate regions' areas, total area to be mapped, regional and average
// densities.
area = (double)malloc(nregionsizeof(double));
for (regctr=0; regctr<nregion; regctr++)
totarea += (area[regctr] = regionarea(nregcorn[regctr],regcorn[regctr]));
dens = (double)malloc(nregionsizeof(double));
for (regctr=0; regctr<nregion; regctr++)
dens[regctr] = cases[regctr]/area[regctr];
avgdens = totpop/totarea;
// Digitize density.
for (i=0; i<=lx; i++) for (j=0; j<=ly; j++) rho_0[j] = 0; // Initialize.
printf("digitizing density ...\n");
for (i=0; i<lx; i++) for (j=0; j<ly; j++)
if (within[j]==-1) rho_0[j] = avgdens;
else rho_0[j] = dens[within[j]];
// Fill the edges correctly.
rho_0[0][0] += rho_0[0][ly] + rho_0[lx][0] + rho_0[lx][ly];
for (i=1; i<lx; i++) rho_0[0] += rho_0[ly];
for (j=1; j<ly; j++) rho_0[0][j] += rho_0[lx][j];
for (i=0; i<lx; i++) rho_0[ly] = rho_0[0];
for (j=0; j<=ly; j++) rho_0[lx][j] = rho_0[0][j];
// Replace rho_0 by Fourier transform
coscosft(rho_0,1,1);
free(area);
free(cases);
for (i=0; i<npoly; i++) free(polycorn);
free(polycorn);
for (i=0; i<nregion; i++) free(regcorn);
free(regcorn);
free(dens);
free(npolycorn);
free(nregcorn);
free(polygonid);
free(regionid);
free(regionidinv);
free(bbmaxx);
free(bbmaxy);
free(bbminx);
free(bbminy);
for (i=0; i<nregion; i++) free(polyinreg);
free(polyinreg);
free(npolyinreg);
// Function to replace data[1...2*nn] by its discrete Fourier transform, if
// isign is input as 1; or replaces data[1...2*nn] by nn times its inverse
// discrete Fourier transform, if isign is input as -1. data is a complex array
// of length nn or, equivalently, a real array of length 2*nn. nn MUST be an
// integer power of 2 (this is not checked for!).
// From "Numerical Recipes in C".
void four1(float data[],unsigned long nn,int isign)
double theta,wi,wpi,wpr,wr,wtemp;
float tempi,tempr;
unsigned long i,istep,j,m,mmax,n;
n=nn<<1;
j=1;
for (i=1; i<n; i+=2)
if (j>i)
// This is the bit-reversal section of the routine.
SWAP(data[j],data);
SWAP(data[j1],data[i1]); // Exchange the two complex numbers.
m=n>>1;
while (m>=2 && j>m)
j -= m;
m>>=1;
j += m;
// Here begins the Danielson-Lanczos section of the routine.
mmax=2;
while (n>mmax) // Outer loop executed log_2 nn times.
istep = mmax<<1;
// Initialize the trigonometric recurrence.
theta = isign*(6.28318530717959/mmax);
wtemp = sin(0.5*theta);
wpr = -2.0wtempwtemp;
wpi = sin(theta);
wr = 1.0;
wi = 0.0;
for (m=1; m<mmax; m+=2) // Here are the two nested inner loops.
for (i=m; i<=n; i+=istep)
j=i+mmax; // This is the Danielson-Lanczos formula
tempr=wrdata[j]-widata[j+1];
tempi=wrdata[j1]widata[j];
data[j]=data-tempr;
data[j1]=data[i1]-tempi;
data += tempr;
data[i+1] += tempi;
wr = (wtemp=wr)wpr-wiwpi+wr; // Trigonometric recurrence.
wi = wiwprwtempwpiwi;
mmax=istep;
// Function to calculate the Fourier Transform of a set of n real-valued data
// points. It replaces this data (which is stored in array data[1...n]) by the
// positive frequency half of its complex Fourier Transform. The real-valued
// first and last components of the complex transform are returned as elements
// data[1] and data[2] respectively. n must be a power of 2. This routine also
// calculates the inverse transform of a complex data array if it is the
// transform of real data. (Result in this case must be multiplied by 2/n).
// From "Numerical Recipes in C".
void realft(float data[],unsigned long n,int isign)
double theta,wi,wpi,wpr,wr,wtemp;
float c1=0.5,c2,h1i,h1r,h2i,h2r;
unsigned long i,i1,i2,i3,i4,np3;
theta = 3.141592653589793/(double) (n>>1); // Initialize the recurrence
if (isign == 1)
c2 = -0.5;
four1(data,n>>1,1); // The forward transform is here.
else // Otherwise set up for an inverse transform.
c2 = 0.5;
theta = -theta;
wtemp = sin(0.5*theta);
wpr = -2.0wtempwtemp;
wpi = sin(theta);
wr = 1.0+wpr;
wi = wpi;
np3 = n+3;
for (i=2; i<=(n>>2); i++) // Case i=1 done separately below.
i4 = 1(i3=np3-(i2=1+(i1=ii-1)));
// The two separate transforms are separated out of data.
h1r = c1*(data[i1]+data[i3]);
h1i = c1*(data[i2]-data[i4]);
h2r = -c2*(data[i2]+data[i4]);
h2i = c2*(data[i1]-data[i3]);
// Here they are recombined to form the true transform of the original
// data.
data[i1] = h1r+wrh2r-wih2i;
data[i2] = h1iwrh2iwih2r;
data[i3] = h1r-wrh2r+wih2i;
data[i4] = -h1iwrh2iwih2r;
wr = (wtemp=wr)wpr-wiwpi+wr; // The recurrence.
wi = wiwprwtempwpiwi;
if (isign == 1)
data[1] = (h1r=data[1])+data[2]; // Squeeze the first and last data
// together to get them all within the original array.
data[2] = h1r-data[2];
else
data[1] = c1*((h1r=data[1])+data[2]);
data[2] = c1*(h1r-data[2]);
// This is the inverse transform for the case isign = -1.
four1(data,n>>1,-1);
// Function to calculate the cosine transform of a set z[0...n] of real-valued
// data points. The transformed data replace the original data in array z. n
// must be a power of 2. For forward transform set isign=1, for back transform
// isign = -1. (Note: The factor 2/n has been taken care of.)
// From "Numerical Recipes in C".
void cosft(float z[],unsigned long n,int isign)
double theta,wi=0.0,wpi,wpr,wr=1.0,wtemp;
float *a,sum,y1,y2;
int j,n2;
// Numerical Recipes starts counting at 1 which is rather confusing. I will
// count from 0.
a = (float)malloc((n+2)sizeof(float));
for (j=1; j<=n+1; j++) a[j] = z[j-1];
// Here is the Numerical Recipes code.
theta=PI/n; //Initialize the recurrence.
wtemp = sin(0.5*theta);
wpr = -2.0wtempwtemp;
wpi = sin(theta);
sum = 0.5*(a[1]-a[n+1]);
a[1] = 0.5*(a[1]a[n1]);
n2 = n+2;
for (j=2; j<=(n>>1); j++)
wr = (wtemp=wr)wpr-wiwpi+wr;
wi = wiwprwtempwpiwi;
y1 = 0.5*(a[j]+a[n2-j]);
y2 = (a[j]-a[n2-j]);
a[j] = y1-wi*y2;
a[n2-j] = y1+wi*y2;
sum += wr*y2;
realft(a,n,1);
a[n+1] = a[2];
a[2] = sum;
for (j=4; j<=n; j+=2)
sum += a[j];
a[j] = sum;
// Finally I revert to my counting method.
if (isign == 1) for (j=1; j<=n+1; j++) z[j-1] = a[j];
else if (isign == -1) for (j=1; j<=n+1; j++) z[j-1] = 2.0*a[j]/n;
free(a);
// Function to calculate the sine transform of a set of n real-valued data
// points stored in array z[0..n]. The number n must be a power of 2. On exit
// z is replaced by its transform. For forward transform set isign=1, for back
// transform isign = -1.
void sinft(float z[],unsigned long n,int isign)
double theta,wi=0.0,wpi,wpr,wr=1.0,wtemp;
float *a,sum,y1,y2;
int j;
unsigned long n2=n+2;
// See my comment about Numerical Recipe's counting above. Note that the last
// component plays a completely passive role and does not need to be stored.
a = (float*) malloc((n+1)*sizeof(float));
for (j=1; j<=n; j++) a[j] = z[j-1];
// Here is the Numerical Recipes code.
theta = PI/(double)n; // Initialize the recurrence.
wtemp = sin(0.5*theta);
wpr = -2.0wtempwtemp;
wpi = sin(theta);
a[1] = 0.0;
for (j=2; j<=(n>>1)+1; j++)
// Calculate the sine for the auxiliary array.
wr = (wtemp=wr)wpr-wiwpi+wr;
// The cosine is needed to continue the recurrence.
wi = wiwprwtempwpiwi;
// Construct the auxiliary array.
y1 = wi*(a[j]+a[n2-j]);
y2 = 0.5*(a[j]-a[n2-j]);
// Terms j and N-j are related.
a[j] = y1+y2;
a[n2-j] = y1-y2;
// Transform the auxiliary array.
realft(a,n,1);
// Initialize the sum used for odd terms below.
a[1] *= 0.5;
sum = a[2] = 0.0;
// Even terms determined directly. Odd terms determined by running sum.
for (j=1; j<=n-1; j+=2)
sum += a[j];
a[j] = a[j+1];
a[j+1] = sum;
// Change the indices.
if (isign == 1) for (j=1; j<=n; j++) z[j-1] = a[j];
else if (isign == -1) for (j=1; j<=n; j++) z[j-1] = 2.0*a[j]/n;
z[n] = 0.0;
free(a);
// Function to calculate a two-dimensional cosine Fourier transform. Forward/
// backward transform in x: isign1 = +/-1, in y: isign2 = +/-1.
void coscosft(float **y,int isign1,int isign2)
float temp[lx+1];
unsigned long i,j;
for (i=0; i<=lx; i++)
cosft(y,ly,isign2);
for (j=0; j<=ly; j++)
for (i=0; i<=lx; i++) temp=y[j];
cosft(temp,lx,isign1);
for (i=0; i<=lx; i++) y[j]=temp;
// Function to calculate a cosine Fourier transform in x and a sine transform
// in y. Forward/backward transform in x: isign1 = +/-1, in y: isign2 = +/-1.
void cossinft(float **y,int isign1,int isign2)
float temp[lx+1];
unsigned long i,j;
for (i=0; i<=lx; i++)
sinft(y,ly,isign2);
for (j=0; j<=ly; j++)
for (i=0; i<=lx; i++) temp=y[j];
cosft(temp,lx,isign1);
for (i=0; i<=lx; i++) y[j]=temp;
// Function to calculate a sine Fourier transform in x and a cosine transform
// in y. Forward/backward transform in x: isign1 = +/-1, in y: isign2 = +/-1.
void sincosft(float **y,int isign1,int isign2)
float temp[lx+1];
unsigned long i,j;
for (i=0; i<=lx; i++)
cosft(y,ly,isign2);
for (j=0; j<=ly; j++)
for (i=0; i<=lx; i++) temp=y[j];
sinft(temp,lx,isign1);
for (i=0; i<=lx; i++) y[j]=temp;
// Function to allocate a float matrix with subscript range
// m[nrl..nrh][ncl..nch]. From "Numerical Recipes in C".
float **dmatrix(long nrl,long nrh,long ncl,long nch)
long i, nrow=nrh-nrl1,ncol=nch-ncl1;
float **m;
/* allocate pointers to rows */
m=(float **) malloc((unsigned int)((nrow+NR_END)sizeof(float)));
if (!m)
fprintf(stderr,"allocation failure 1 in matrix()\n");
exit(1);
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(float *) malloc((unsigned int)((nrowncol+NR_END)sizeof(float)));
if (!m[nrl])
fprintf(stderr,"allocation failure 2 in matrix()\n");
exit(1);
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl1;i<=nrh;i+) m=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
// Function to allocate a float 3tensor with range
// t[nrl..nrh][ncl..nch][ndl..ndh]. From "Numerical Recipes in C".
float *d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
long i,j,nrow=nrh-nrl1,ncol=nch-ncl+1,ndep=ndh-ndl1;
float *t;
/* allocate pointers to pointers to rows */
t=(float *) malloc((sizet)((nrow+NREND)sizeof(float*)));
if (!t)
fprintf(stderr,"allocation failure 1 in f3tensor()\n");
exit(1);
t += NR_END;
t -= nrl;
/* allocate pointers to rows and set pointers to them */
t[nrl]=(float **) malloc((sizet)((nrowncol+NREND)*sizeof(float)));
if (!t[nrl])
fprintf(stderr,"allocation failure 2 in f3tensor()\n");
exit(1);
t[nrl] += NR_END;
t[nrl] -= ncl;
/* allocate rows and set pointers to them */
t[nrl][ncl]=(float *) malloc((sizet)((nrowncol*ndep+NREND)sizeof(float)));
if (!t[nrl][ncl])
fprintf(stderr,"allocation failure 3 in f3tensor()\n");
exit(1);
t[nrl][ncl] += NR_END;
t[nrl][ncl] -= ndl;
for(j=ncl1;j<=nch;j+) t[nrl][j]=t[nrl][j-1]+ndep;
for(i=nrl1;i<=nrh;i+) {
t=t[i-1]+ncol;
t[ncl]=t[i-1][ncl]+ncol*ndep;
for(j=ncl1;j<=nch;j+) t[j]=t[j-1]+ndep;
/* return pointer to array of pointers to rows */
return t;
void free_matrix(float **m,long nrl,long nrh,long ncl,long nch)
free((char*) (m[nrl]+ncl-1));
free((char*) (m+nrl-1));
void free_f3tensor(float *t,long nrl,long nrh,long ncl,long nch,long ndl,
long ndh)
free((char*) (t[nrl][ncl]+ndl-1));
free((char*) (t[nrl]+ncl-1));
free((char*) (t+nrl-1));
// Function to replace data by its ndim-dimensional discrete Fourier transform,
// if isign is input as 1. nn[1..ndim] is an integer array containing the
// lengths of each dimension (number of complex values), which MUST be all
// powers of 2. data is a real array of length twice the product of these
// lengths, in which the data are stored as in a multidimensional complex
// array: real and imaginary parts of each element are in consecutive
// locations, and the rightmost index of the array increases most rapidly as
// one proceeds along data. For a two-dimensional array, this is equivalent to
// storing the arrays by rows. If isign is input as -1, data is replaced by its
// inverse transform times the product of the lengths of all dimensions.
void fourn(float data[],unsigned long nn[],int ndim,int isign)
int idim;
unsigned long i1,i2,i3,i2rev,i3rev,ip1,ip2,ip3,ifp1,ifp2;
unsigned long ibit,k1,k2,n,nprev,nrem,ntot;
double tempi,tempr;
float theta,wi,wpi,wpr,wr,wtemp;
for (ntot=1, idim=1; idim<=ndim; idim++)
ntot *= nn[idim];
nprev = 1;
for (idim=ndim; idim>=1; idim--)
n = nn[idim];
nrem = ntot/(n*nprev);
ip1=nprev << 1;
ip2 = ip1*n;
ip3 = ip2*nrem;
i2rev = 1;
for (i2=1; i2<=ip2; i2+=ip1)
if (i2 < i2rev)
for (i1=i2; i1<=i2+ip1-2; i1+=2)
for (i3=i1; i3<=ip3; i3+=ip2)
i3rev = i2rev+i3-i2;
SWAP(data[i3],data[i3rev]);
SWAP(data[i31],data[i3rev1]);
ibit = ip2>>1;
while (ibit>=ip1 && i2rev>ibit)
i2rev -= ibit;
ibit >>= 1;
i2rev += ibit;
ifp1 = ip1;
while (ifp1 < ip2)
ifp2 = ifp1 << 1;
theta = 2isignPI/(ifp2/ip1);
wtemp = sin(0.5*theta);
wpr = -2.0wtempwtemp;
wpi = sin(theta);
wr = 1.0;
wi = 0.0;
for (i3=1; i3<=ifp1; i3+=ip1)
for (i1=i3; i1<=i3+ip1-2; i1+=2)
for (i2=i1; i2<=ip3; i2+=ifp2)
k1 = i2;
k2 = k1+ifp1;
tempr = (float)wrdata[k2]-(float)widata[k2+1];
tempi = (float)wrdata[k21](float)widata[k2];
data[k2] = data[k1]-tempr;
data[k2+1] = data[k1+1]-tempi;
data[k1] += tempr;
data[k1+1] += tempi;
wr = (wtemp=wr)wpr-wiwpi+wr;
wi = wiwprwtempwpiwi;
ifp1 = ifp2;
nprev *= n;
// Function to calculate a three-dimensional Fourier transform of
// data[1..nn1][1..nn2][1..nn3] (where nn1=1 for the case of a logically two-
// dimensional array). This routine returns (for isign=1) the complex fast
// Fourier transform as two complex arrays: On output, data contains the zero
// and positive frequency values of the third frequency component, while
// speq[1..nn1][1..2*nn2] contains the Nyquist critical frequency values of the
// third frequency component. First (and second) frequency components are
// stored for zero, positive, and negative frequencies, in standard wrap-around
// order. See Numerical Recipes for description of how complex values are
// arranged. For isign=-1, the inverse transform (times nn1nn2nn3/2 as a
// constant multiplicative factor) is performed, with output data (viewed as
// real array) deriving from input data (viewed as complex) and speq. For
// inverse transforms on data not generated first by a forward transform, make
// sure the complex input data array satisfies property 12.5.2 from NR. The
// dimensions nn1, nn2, nn3 must always be integer powers of 2.
void rlft3(float *data,float **speq,unsigned long nn1,unsigned long nn2,
unsigned long nn3,int isign)
double theta,wi,wpi,wpr,wr,wtemp;
float c1,c2,h1r,h1i,h2r,h2i;
unsigned long i1,i2,i3,j1,j2,j3,nn[4],ii3;
if (1+&data[nn1][nn2][nn3]-&data[1][1][1] != nn1nn2nn3)
fprintf(stderr,
"rlft3: problem with dimensions or contiguity of data array\n");
exit(1);
c1 = 0.5;
c2 = -0.5*isign;
theta = 2isign(PI/nn3);
wtemp = sin(0.5*theta);
wpr = -2.0wtempwtemp;
wpi = sin(theta);
nn[1] = nn1;
nn[2] = nn2;
nn[3] = nn3 >> 1;
// Case of forward transform. Here is where most all of the compute time is
// spent. Extend data periodically into speq.
if (isign == 1)
fourn(&data[1][1][1]-1,nn,3,isign);
for (i1=1; i1<=nn1; i1++)
for (i2=1, j2=0; i2<=nn2; i2++)
speq[i1][++j2] = data[i1][i2][1];
speq[i1][++j2] = data[i1][i2][2];
for (i1=1; i1<=nn1; i1++)
// Zero frequency is its own reflection; otherwise locate corresponding
// negative frequency in wrap-around order.
j1 = (i1 != 1 ? nn1-i1+2 : 1);
// Initialize trigonometric recurrence.
wr = 1.0;
wi = 0.0;
for (ii3=1, i3=1; i3<=(nn3>>2)+1; i3+,ii3=2)
for (i2=1; i2<=nn2; i2++)
if (i3 == 1)
j2 = (i2 != 1 ? ((nn2-i2)<<1)+3 : 1);
h1r = c1*(data[i1][i2][1]+speq[j1][j2]);
h1i = c1*(data[i1][i2][2]-speq[j1][j2+1]);
h2i = c2*(data[i1][i2][1]-speq[j1][j2]);
h2r = -c2*(data[i1][i2][2]speq[j1][j21]);
data[i1][i2][1] = h1r+h2r;
data[i1][i2][2] = h1i+h2i;
speq[j1][j2] = h1r-h2r;
speq[j1][j2+1] = h2i-h1i;
else
j2 = (i2 != 1 ? nn2-i2+2 : 1);
j3 = nn3+3-(i3<<1);
h1r = c1*(data[i1][i2][ii3]+data[j1][j2][j3]);
h1i = c1*(data[i1][i2][ii31]-data[j1][j2][j31]);
h2i = c2*(data[i1][i2][ii3]-data[j1][j2][j3]);
h2r = -c2*(data[i1][i2][ii31]+data[j1][j2][j31]);
data[i1][i2][ii3] = h1r+wrh2r-wih2i;
data[i1][i2][ii3+1] = h1iwrh2iwih2r;
data[j1][j2][j3] = h1r-wrh2r+wih2i;
data[j1][j2][j3+1] = -h1iwrh2iwih2r;
// Do the recurrence.
wr = (wtemp=wr)wpr-wiwpi+wr;
wi = wiwprwtempwpiwi;
// Case of reverse transform.
if (isign == -1)
fourn(&data[1][1][1]-1,nn,3,isign);
// Function to perform Gaussian blur.
void gaussianblur(void)
float **blur,***conv,***pop,**speqblur,**speqconv,*speqpop;
int i,j,p,q;
blur = d3tensor(1,1,1,lx,1,ly);
conv = d3tensor(1,1,1,lx,1,ly);
pop = d3tensor(1,1,1,lx,1,ly);
speqblur = dmatrix(1,1,1,2*lx);
speqconv = dmatrix(1,1,1,2*lx);
speqpop = dmatrix(1,1,1,2*lx);
// Fill population and convolution matrix.
for (i=1; i<=lx; i++) for (j=1; j<=ly; j++)
if (i > lx/2) p = i-1-lx;
else p = i-1;
if (j > ly/2) q = j-1-ly;
else q = j-1;
pop[1][j] = rho_0[i-1][j-1];
conv[1][j] = 0.5*
(erf((p+0.5)/(sqrt(2.0)(SIGMApow(SIGMAFAC,nblurs))))-
erf((p-0.5)/(sqrt(2.0)(SIGMA*pow(SIGMAFAC,nblurs)))))
(erf((q+0.5)/(sqrt(2.0)(SIGMApow(SIGMAFAC,nblurs))))-
erf((q-0.5)/(sqrt(2.0)(SIGMA*pow(SIGMAFAC,nblurs)))))/(lxly);
// Fourier transform.
rlft3(pop,speqpop,1,lx,ly,1);
rlft3(conv,speqconv,1,lx,ly,1);
// Multiply pointwise.
for (i=1; i<=lx; i++)
for (j=1; j<=ly/2; j++)
blur[1][2*j-1] =
pop[1][2j-1]*conv[1][2j-1]-
pop[1][2j]*conv[1][2j];
blur[1][2*j] =
pop[1][2j]*conv[1][2j-1]+
pop[1][2j-1]*conv[1][2j];
for (i=1; i<=lx; i++)
speqblur[1][2*i-1] =
speqpop[1][2i-1]*speqconv[1][2i-1]-
speqpop[1][2i]*speqconv[1][2i];
speqblur[1][2*i] =
speqpop[1][2i]*speqconv[1][2i-1]+
speqpop[1][2i-1]*speqconv[1][2i];
// Backtransform.
rlft3(blur,speqblur,1,lx,ly,-1);
// Write to rho_0.
for (i=1; i<=lx; i++) for (j=1; j<=ly; j++) rho_0[i-1][j-1] = blur[1][j];
free_f3tensor(blur,1,1,1,lx,1,ly);
free_f3tensor(conv,1,1,1,lx,1,ly);
free_f3tensor(pop,1,1,1,lx,1,ly);
free_matrix(speqblur,1,1,1,2*lx);
free_matrix(speqconv,1,1,1,2*lx);
free_matrix(speqpop,1,1,1,2*lx);
// Function to initialize rho_0. The original density is blurred with width
// SIGMA*pow(SIGMAFAC,nblurs).
void initcond(void)
float maxpop;
int i,j;
// Reconstruct population density.
coscosft(rho_0,-1,-1);
// There must not be negative densities.
for (i=0; i<lx; i++) for (j=0; j<ly; j++) if (rho_0[j]<-1e10)
fprintf(stderr,"ERROR: Negative density in DENSITYFILE.\n");
exit(1);
// Perform Gaussian blur.
printf("Gaussian blur ...\n");
gaussianblur();
// Find the mimimum density. If it is very small suggest an increase in
// SIGMA.
minpop = rho_0[0][0];
maxpop = rho_0[0][0];
for (i=0; i<lx; i++) for (j=0; j<ly; j++) if (rho_0[j]<minpop)
minpop = rho_0[j];
for (i=0; i<lx; i++) for (j=0; j<ly; j++) if (rho_0[j]>maxpop)
maxpop = rho_0[j];
if (0<minpop && minpop<1e-8*maxpop)
fprintf(stderr,"Minimimum population very small (%f). Integrator\n",
minpop);
fprintf(stderr,
"will probably converge very slowly. You can speed up the\n");
fprintf(stderr,"process by increasing SIGMA to a value > %f.\n",
SIGMA*pow(SIGMAFAC,nblurs));
// Replace rho_0 by cosine Fourier transform in both variables.
coscosft(rho_0,1,1);
// Function to calculate the velocity field
void calcv(float t)
int j,k;
// Fill rho with Fourier coefficients.
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
rho[j][k] = exp(-((PIj/lx)*(PI*j/lx)+(PI*k/ly)*(PI*k/ly))*t)rho_0[j][k];
// Calculate the Fourier coefficients for the partial derivative of rho.
// Store temporary results in arrays gridvx, gridvy.
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
gridvx[j][k] = -(PIj/lx)rho[j][k];
gridvy[j][k] = -(PIk/ly)rho[j][k];
// Replace rho by cosine Fourier backtransform in both variables.
coscosft(rho,-1,-1);
// Replace vx by sine Fourier backtransform in the first and cosine Fourier
// backtransform in the second variable.
sincosft(gridvx,-1,-1);
// Replace vy by cosine Fourier backtransform in the first and sine Fourier
// backtransform in the second variable.
cossinft(gridvy,-1,-1);
// Calculate the velocity field.
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
gridvx[j][k] = -gridvx[j][k]/rho[j][k];
gridvy[j][k] = -gridvy[j][k]/rho[j][k];
// Function to bilinearly interpolate a two-dimensional array. For higher
// accuracy one could consider higher order interpolation schemes.
float intpol(float **arr,float x,float y)
int gaussx,gaussy;
float deltax,deltay;
// Decompose x and y into an integer part and a decimal.
gaussx = (int)x;
gaussy = (int)y;
deltax = x-gaussx;
deltay = y-gaussy;
// Interpolate.
if (gaussx==lx && gaussy==ly)
return arr[gaussx][gaussy];
if (gaussx==lx)
return (1-deltay)arr[gaussx][gaussy]deltayarr[gaussx][gaussy1];
if (gaussy==ly)
return (1-deltax)arr[gaussx][gaussy]deltaxarr[gaussx1][gaussy];
return (1-deltax)(1-deltay)arr[gaussx][gaussy]+
(1-deltax)deltayarr[gaussx][gaussy1]
deltax(1-deltay)arr[gaussx1][gaussy]
deltaxdeltayarr[gaussx1][gaussy1];
// Function to find the root of the system of equations
// xappr-0.5h*v_x(t+h,xappr,yappr)-x[j][k]-0.5*hvx[j][k]=0,
// yappr-0.5h*v_y(t+h,xappr,yappr)-y[j][k]-0.5*hvy[j][k]=0
// with Newton-Raphson. Returns TRUE after sufficient convergence.
BOOLEAN newt2(float h,float *xappr,float xguess,float *yappr,float yguess,
int j,int k)
float deltax,deltay,dfxdx,dfxdy,dfydx,dfydy,fx,fy;
int gaussx,gaussxplus,gaussy,gaussyplus,i;
// Initial guess.
*xappr = xguess;
*yappr = yguess;
for (i=1; i<=IMAX; i++)
// fx, fy are the left-hand sides of the two equations. Find
// v_x(t+h,xappr,yappr), v_y(t+h,xappr,yappr) by interpolation.
fx = xappr-0.5*h*intpol(gridvx,*xappr,*yappr)-x[j][k]-0.5*hvx[j][k];
fy = yappr-0.5*h*intpol(gridvy,*xappr,*yappr)-y[j][k]-0.5*hvy[j][k];
// Linearly approximate the partial derivatives of fx, fy with a finite
// difference method. More elaborate techniques are possible, but this
// quick and dirty method appears to work reasonably for our purpose.
gaussx = (int)(*xappr);
gaussy = (int)(*yappr);
if (gaussx == lx) gaussxplus = 0;
else gaussxplus = gaussx+1;
if (gaussy == ly) gaussyplus = 0;
else gaussyplus = gaussy+1;
deltax = x[j][k] - gaussx;
deltay = y[j][k] - gaussy;
dfxdx = 1 - 0.5h
((1-deltay)*(gridvx[gaussxplus][gaussy]-gridvx[gaussx][gaussy])+
deltay*(gridvx[gaussxplus][gaussyplus]-gridvx[gaussx][gaussyplus]));
dfxdy = -0.5h
((1-deltax)*(gridvx[gaussx][gaussyplus]-gridvx[gaussx][gaussy])+
deltax*(gridvx[gaussxplus][gaussyplus]-gridvx[gaussxplus][gaussy]));
dfydx = -0.5h
((1-deltay)*(gridvy[gaussxplus][gaussy]-gridvy[gaussx][gaussy])+
deltay*(gridvy[gaussxplus][gaussyplus]-gridvy[gaussx][gaussyplus]));
dfydy = 1 - 0.5h
((1-deltax)*(gridvy[gaussx][gaussyplus]-gridvy[gaussx][gaussy])+
deltax*(gridvy[gaussxplus][gaussyplus]-gridvy[gaussxplus][gaussy]));
// If the current approximation is (xappr,yappr) for the zero of
// (fx(x,y),fy(x,y)) and J is the Jacobian, then we can approximate (in
// vector notation) for |delta|<<1:
// f((xappr,yappr)+delta) = f(xappr,yappr)+J*delta.
// Setting f((xappr,yappr)+delta)=0 we obtain a set of linear equations
// for the correction delta which moves f closer to zero, namely
// J*delta = -f.
// The improved approximation is then x = xappr+delta.
// The process will be iterated until convergence is reached.
if ((fx*fx + fy*fy) < TOLF) return TRUE;
deltax = (fy*dfxdy - fxdfydy)/(dfxdxdfydy - dfxdy*dfydx);
deltay = (fx*dfydx - fydfxdx)/(dfxdxdfydy - dfxdy*dfydx);
if ((deltax*deltax + deltay*deltay) < TOLX) return TRUE;
*xappr += deltax;
*yappr += deltay;
//printf("deltax %f, deltay %f\n",deltax,deltay);
fprintf(stderr,"newt2 failed, increasing sigma to %f.\n",
SIGMA*pow(SIGMAFAC,nblurs));
return FALSE;
// Function to integrate the nonlinear Volterra equation. Returns TRUE after
// the displacement field converged, after MAXINTSTEPS integration steps, or
// if the time exceeds TIMELIMIT.
BOOLEAN nonlinvoltra(void)
BOOLEAN stepsize_ok;
#ifdef DISPLFILE
FILE *displfile = fopen(DISPLFILE);
#endif
float h,maxchange=INFTY,t,vxplus,vyplus,xguess,yguess;
int i,j,k;
do
initcond();
nblurs++;
if (minpop<0.0)
fprintf(stderr,
"Minimum population negative, will increase sigma to %f\n",
SIGMA*pow(SIGMAFAC,nblurs));
while (minpop<0.0);
h = HINITIAL;
t = 0; // Start at time t=0.
// (x[j][k],y[j][k]) is the position for the element that was at position
// (j,k) at time t=0.
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
x[j][k] = j;
y[j][k] = k;
calcv(0.0);
// (gridvx[j][k],gridvy[j][k]) is the velocity at position (j,k).
// (vx[j][k],vy[j][k]) is the velocity at position (x[j][k],y[j][k]).
// At t=0 they are of course identical.
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
vx[j][k] = gridvx[j][k];
vy[j][k] = gridvy[j][k];
i = 1; // i counts the integration steps.
// Here is the integrator.
do
stepsize_ok = TRUE;
calcv(t+h);
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
// First take a naive integration step. The velocity at time t+h for
// the element [j][k] is approximately
// v(th,x[j][k]+hvx[j][k],y[j][k]hvy[j][k]).
// The components, call them vxplus and vyplus, are interpolated from
// gridvx and gridvy.
vxplus = intpol(gridvx,x[j][k]hvx[j][k],y[j][k]hvy[j][k]);
vyplus = intpol(gridvy,x[j][k]hvx[j][k],y[j][k]hvy[j][k]);
// Based on (vx[j][k],vy[j][k]) and (vxplus,vyplus) we expect the
// new position at time t+h to be:
xguess = x[j][k] + 0.5h(vx[j][k]+vxplus);
yguess = y[j][k] + 0.5h(vy[j][k]+vyplus);
// Then we make a better approximation by solving the two nonlinear
// equations:
// xappr[j][k]-0.5hv_x(t+h,xappr[j][k],yappr[j][k])-
// x[j][k]-0.5hvx[j][k]=0,
// yappr[j][k]-0.5hv_y(t+h,xappr[j][k],yappr[j][k])-
// y[j][k]-0.5hvy[j][k]=0
// with Newton-Raphson and (xguess,yguess) as initial guess.
// If newt2 fails to converge, exit nonlinvoltra.
if (!newt2(h,&xappr[j][k],xguess,&yappr[j][k],yguess,j,k))
return FALSE;
// If the integration step was too large reduce the step size.
if ((xguess-xappr[j][k])*(xguess-xappr[j][k])+
(yguess-yappr[j][k])*(yguess-yappr[j][k]) > TOLINT)
if (h<MINH)
fprintf(stderr,
"Time step below %f, increasing SIGMA to %f\n",
h,SIGMA*pow(SIGMAFAC,nblurs));
nblurs++;
return FALSE;
h /= 10;
stepsize_ok = FALSE;
break;
if (!stepsize_ok) continue;
else
t += h;
maxchange = 0.0; // Monitor the maximum change in positions.
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
if ((x[j][k]-xappr[j][k])*(x[j][k]-xappr[j][k])+
(y[j][k]-yappr[j][k])*(y[j][k]-yappr[j][k]) > maxchange)
maxchange =
(x[j][k]-xappr[j][k])*(x[j][k]-xappr[j][k])+
(y[j][k]-yappr[j][k])*(y[j][k]-yappr[j][k]);
x[j][k] = xappr[j][k];
y[j][k] = yappr[j][k];
vx[j][k] = intpol(gridvx,xappr[j][k],yappr[j][k]);
vy[j][k] = intpol(gridvy,xappr[j][k],yappr[j][k]);
h *= 1.2; // Make the next integration step larger.
if (i%10==0) printf("time %f\n",t);
i++;
} while (i<MAXINTSTEPS && t<TIMELIMIT && maxchange>CONVERGENCE);
if (maxchange>CONVERGENCE)
fprintf(stderr,
"WARNING: Insufficient convergence within %i steps, time %f.\n",
MAXINTSTEPS,TIMELIMIT);
#ifdef DISPLFILE
// Write displacement field to file.
fprintf(displfile,"time %f\nminx %f\nmaxx %f\nminy %f\nmaxy %f\n",
t,minx,maxx,miny,maxy);
fprintf(displfile,"sigma %f\n",SIGMA*pow(SIGMAFAC,nblurs-1));
fprintf(displfile,"background %f\nlx\nly\n\n",0,lx,ly);
for (j=0; j<=lx; j++) for (k=0; k<=ly; k++)
fprintf(displfile,"j %i, k %i, x %f, y %f\n",j,k,x[j][k],y[j][k]);
fclose(displfile);
#endif
return TRUE;
// Function to transform points according to displacement field.
POINT transf(POINT p)
float deltax,deltay,den,t,u;
int gaussx,gaussy;
POINT a,b,c,d,ptr;
p.x = (p.x-minx)*lx/(maxx-minx);
p.y = (p.y-miny)*ly/(maxy-miny);
gaussx = (int)p.x;
gaussy = (int)p.y;
if (gaussx<0 || gaussx>lx || gaussy<0 || gaussy>ly)
fprintf(stderr,"ERROR: Coordinate limits exceeded in transf.\n");
exit(1);
deltax = p.x - gaussx;
deltay = p.y - gaussy;
// The transformed point is the intersection of the lines:
// (I) connecting
// (1-deltax)(x,y[gaussx][gaussy])deltax(x,y[gaussx1][gaussy])
// and
// (1-deltax)(x,y[gaussx][gaussy1])+deltax(x,y[gaussx+1][gaussy1])
// (II) connecting
// (1-deltay)(x,y[gaussx][gaussy])deltay(x,y[gaussx][gaussy1])
// and
// (1-deltay)(x,y[gaussx1][gaussy])+deltay(x,y[gaussx+1][gaussy1]).
// Call these four points a, b, c and d.
a.x = (1-deltax)*x[gaussx][gaussy] + deltax*x[gaussx+1][gaussy];
a.y = (1-deltax)*y[gaussx][gaussy] + deltax*y[gaussx+1][gaussy];
b.x = (1-deltax)*x[gaussx][gaussy+1] + deltax*x[gaussx1][gaussy1];
b.y = (1-deltax)*y[gaussx][gaussy+1] + deltax*y[gaussx1][gaussy1];
c.x = (1-deltay)*x[gaussx][gaussy] + deltay*x[gaussx][gaussy+1];
c.y = (1-deltay)*y[gaussx][gaussy] + deltay*y[gaussx][gaussy+1];
d.x = (1-deltay)*x[gaussx+1][gaussy] + deltay*x[gaussx1][gaussy1];
d.y = (1-deltay)*y[gaussx+1][gaussy] + deltay*y[gaussx1][gaussy1];
// Solve the vector equation a+t(b-a) = c+u(d-c) for the scalars t, u.
if (fabs(den=(b.x-a.x)(c.y-d.y)+(a.y-b.y)(c.x-d.x))<1e-12)
fprintf(stderr,"ERROR: Transformed area element has parallel edges.\n");
exit(1);
t = ((c.x-a.x)(c.y-d.y)+(a.y-c.y)(c.x-d.x))/den;
u = ((b.x-a.x)(c.y-a.y)+(a.y-b.y)(c.x-a.x))/den;
if (t<-1e-3|| t>1+1e-3 || u<-1e-3 || u>1+1e-3)
fprintf(stderr,"WARNING: Transformed area element non-convex.\n");
ptr.x = (1-(a.x+t(b.x-a.x))/lx)minx + ((a.x+t(b.x-a.x))/lx)maxx;
ptr.y = (1-(a.y+t(b.y-a.y))/ly)miny + ((a.y+t(b.y-a.y))/ly)maxy;
return ptr;
// Function to read spatial features from user-specified file and map to
// cartogram.
void cartogram(void)
char id[LINELENGTH],line[LINELENGTH];
FILE infile,outfile;
float xcoord,ycoord;
POINT p;
infile = fopen(MAPGENFILE);
outfile = fopen(CARTGENFILE,"w");
while (!readline(line,infile))
if (sscanf(line,"%s %f %f",&id,&xcoord,&ycoord)==3)
p.x = xcoord;
p.y = ycoord;
p = transf(p);
fprintf(outfile,"%s %f %f\n",id,p.x,p.y);
else if (sscanf(line,"%f %f",&xcoord,&ycoord)==2)
p.x = xcoord;
p.y = ycoord;
p = transf(p);
fprintf(outfile,"%f %f\n",p.x,p.y);
else
sscanf(line,"%s",&id);
fprintf(outfile,"%s\n",id);
fclose(infile);
fclose(outfile);
main(void)
BOOLEAN n;
char c;
FILE genfile,psfile = fopen(MAP2PS);
float oldlx,oldly,oldmaxx,oldmaxy,oldminx,oldminy,totarea;
int i,polyctr,regctr;
// Read the polygon coordinates.
if ((genfile = fopen(MAPGENFILE)) == NULL)
fprintf(stderr,"ERROR: Cannot find MAPGENFILE\n");
exit(1);
countpoly(genfile);
fclose(genfile);
genfile = fopen(MAPGENFILE);
countcorn(genfile);
fclose(genfile);
genfile = fopen(MAPGENFILE);
readcorn(genfile);
fclose(genfile);
makeregion();
printf("%i polygon(s), %i region(s)\n",npoly,nregion);
printf("lx=%i, ly=%i\n",lx,ly);
// Calculate total area.
//totarea = 0.0;
//for (regctr=0; regctr<nregion; regctr++)
// printf("region %i has area %f, contains %i polygons\n",regionid[regctr],
// regionarea(nregcorn[regctr],regcorn[regctr]),npolyinreg[regctr]);
// totarea += regionarea(nregcorn[regctr],regcorn[regctr]);
//printf("totarea = %f\n",totarea);
// Make map.
pspicture(psfile);
fclose(psfile);
// Allocate memory for arrays.
gridvx = (float*)malloc((lx+1)*sizeof(float));
gridvy = (float*)malloc((lx+1)*sizeof(float));
rho = (float*)malloc((lx+1)*sizeof(float));
rho_0 = (float*)malloc((lx+1)*sizeof(float));
vx = (float*)malloc((lx+1)*sizeof(float));
vy = (float*)malloc((lx+1)*sizeof(float));
x = (float*)malloc((lx+1)*sizeof(float));
xappr = (float*)malloc((lx+1)*sizeof(float));
y = (float*)malloc((lx+1)*sizeof(float));
yappr = (float*)malloc((lx+1)*sizeof(float));
within = (int*)malloc((lx+1)*sizeof(int));
for (i=0; i<=lx; i++)
gridvx = (float)malloc((ly+1)sizeof(float));
gridvy = (float)malloc((ly+1)sizeof(float));
rho = (float)malloc((ly+1)sizeof(float));
rho_0 = (float)malloc((ly+1)sizeof(float));
vx = (float)malloc((ly+1)sizeof(float));
vy = (float)malloc((ly+1)sizeof(float));
x = (float)malloc((ly+1)sizeof(float));
xappr = (float)malloc((ly+1)sizeof(float));
y = (float)malloc((ly+1)sizeof(float));
yappr = (float)malloc((ly+1)sizeof(float));
within = (int)malloc((ly+1)sizeof(int));
// Digitize the density.
bboxes();
interior();
digdens();
// Solve the diffusion equation.
do n = nonlinvoltra(); while (!n);
// Print cartogram generate file.
cartogram();
// Read the transformed polygon coordinates.
oldlx = lx;
oldly = ly;
oldmaxx = maxx;
oldmaxy = maxy;
oldminx = minx;
oldminy = miny;
genfile = fopen(CARTGENFILE,"r");
countpoly(genfile);
fclose(genfile);
genfile = fopen(CARTGENFILE,"r");
countcorn(genfile);
fclose(genfile);
lx = oldlx;
ly = oldly;
maxx = oldmaxx;
maxy = oldmaxy;
minx = oldminx;
miny = oldminy;
genfile = fopen(CARTGENFILE,"r");
readcorn(genfile);
fclose(genfile);
makeregion();
// Make cartogram
psfile = fopen(CART2PS);
pspicture(psfile);
fclose(psfile);
The part of the code where the bus error occurs is this:
void interior(void)
int i,inhowmanyregions,inregion[2],j,k,l,m,n,regctr;
// Initialize within[][]. -1 means outside all regions.
for (i=0; i<=lx; i++) for (j=0; j<=ly; j++) within[j] = -1;
// Fill within[][].
for (i=0; i<nregion; i++) for (j=0; j<npolyinreg; j++)
for (k=0, n=npolycorn[polyinreg[j]]-1;
k<npolycorn[polyinreg[j]]; n=k++)
for (l=(int)ceil(MIN(polycorn[polyinreg[j]][k-1].y,
polycorn[polyinreg[j]][k].y));
l<MAX(polycorn[polyinreg[j]][k-1].y,
polycorn[polyinreg[j]][k].y); l++)
for (m=(int)floor(bbminx[polyinreg[j]]);
m<(polycorn[polyinreg[j]][n].x-
polycorn[polyinreg[j]][k].x)*
(l-polycorn[polyinreg[j]][k].y)/
(polycorn[polyinreg[j]][n].y-
polycorn[polyinreg[j]][k].y)+
polycorn[polyinreg[j]][k].x;
m++)
within[m][l] = i-within[m][l]-1;
I really have no idea what is going on. Can anyone help?
Thanks,
mooseguy

orangekay wrote:
That is absolutely unreadable.
I agree completely. How about also providing a link to a set of input files so that we could actually run the code ourselves? Otherwise, there is no chance to debug the source code, it is just a mess.
You might have better luck with an older version of the file. To quote the comments:
// Modified on March 31, 2005. Initialized maxchange in nonlinvoltra() as
// INFTY. Replaced crnmbr() by a similar, but faster routine interior().
// Many thanks to Stuart Anderson for pointing out this shortcut.
I suspect that the "interior" function is just plain incorrect. It doesn't matter if it runs on some other OS. Something about it is wrong and the code is so cryptic that it can't be deciphered.

Similar Messages

  • How do I fix: DirectoryServices: Job appears to have crashed: Bus error

    Can anyone help with this problem? The only solution I have found is to erase and reinstall the OS. A reinstall alone will not fix it.
    I have experienced this problem on 3 Macs now, and Apple Care has virtually rebuilt my mini attempting to fix it. However to date, I haven't been able to find anyone at Apple who will look at the data. Here is what appears endlessly in /var/log/system.log:
    Apr 1 08:55:43 Peters-MacBook-Air com.apple.launchd[1] (com.apple.DirectoryServices[161]): Job appears to have crashed: Bus error
    Apr 1 08:55:43 Peters-MacBook-Air com.apple.launchd[1] (com.apple.DirectoryServices): Throttling respawn: Will start in 8 seconds
    Apr 1 08:55:43 Peters-MacBook-Air com.apple.ReportCrash.Root[156]: 2011-04-01 08:55:43.390 ReportCrash[156:140b] Saved crash report for DirectoryService[161] version ??? (???) to /Library/Logs/DiagnosticReports/DirectoryService2011-04-01-085543localhost.crash
    Apr 1 08:55:51 Peters-MacBook-Air DirectoryService[162]: Improper shutdown detected
    Apr 1 08:55:53 Peters-MacBook-Air com.apple.launchd[1] (com.apple.DirectoryServices[162]): Job appears to have crashed: Bus error
    Apr 1 08:55:53 Peters-MacBook-Air com.apple.launchd[1] (com.apple.DirectoryServices): Throttling respawn: Will start in 8 seconds
    Apr 1 08:55:53 Peters-MacBook-Air com.apple.ReportCrash.Root[156]: 2011-04-01 08:55:53.788 ReportCrash[156:380b] Saved crash report for DirectoryService[162] version ??? (???) to /Library/Logs/DiagnosticReports/DirectoryService2011-04-01-085553localhost.crash
    Apr 1 08:56:01 Peters-MacBook-Air DirectoryService[163]: Improper shutdown detected
    Apr 1 08:56:04 Peters-MacBook-Air com.apple.launchd[1] (com.apple.DirectoryServices[163]): Job appears to have crashed: Bus error
    Apr 1 08:56:04 Peters-MacBook-Air com.apple.launchd[1] (com.apple.DirectoryServices): Throttling respawn: Will start in 8 seconds
    Apr 1 08:56:04 Peters-MacBook-Air com.apple.ReportCrash.Root[156]: 2011-04-01 08:56:04.237 ReportCrash[156:472f] Saved crash report for DirectoryService[163] version ??? (???) to /Library/Logs/DiagnosticReports/DirectoryService2011-04-01-085604localhost.crash
    Apr 1 08:56:12 Peters-MacBook-Air DirectoryService[165]: Improper shutdown detected
    Here is one of the crash logs.
    Process: DirectoryService [226]
    Path: /usr/sbin/DirectoryService
    Identifier: DirectoryService
    Version: ??? (???)
    Code Type: X86-64 (Native)
    Parent Process: launchd [1]
    Date/Time: 2011-04-04 10:30:15.232 -0600
    OS Version: Mac OS X 10.6.6 (10J567)
    Report Version: 6
    Exception Type: EXCBADACCESS (SIGBUS)
    Exception Codes: 0x000000000000000a, 0x0000000100385000
    Crashed Thread: 1 Dispatch queue: com.apple.root.default-priority
    Thread 0: Dispatch queue: com.apple.main-thread
    0 libSystem.B.dylib 0x00007fff8503f2da machmsgtrap + 10
    1 libSystem.B.dylib 0x00007fff8503f94d mach_msg + 59
    2 com.apple.CoreFoundation 0x00007fff83955932 __CFRunLoopRun + 1698
    3 com.apple.CoreFoundation 0x00007fff83954dbf CFRunLoopRunSpecific + 575
    4 com.apple.CoreFoundation 0x00007fff83954b46 CFRunLoopRun + 70
    5 DirectoryService 0x000000010000dbe9 main + 3061
    6 DirectoryService 0x000000010000cfec start + 52
    Thread 1 Crashed: Dispatch queue: com.apple.root.default-priority
    0 libSystem.B.dylib 0x00007fff8509a33d strtok_r + 19
    1 DirectoryService 0x00000001000a9d04 FlatFileNode::FetchMatchingRecords(sBDPISearchRecordsContext*, void*, unsigned int*) + 1976
    2 DirectoryService 0x00000001000acad7 FlatFileNode::InternalSearchRecords(sBDPISearchRecordsContext*, void*, unsigned int*) + 681
    3 DirectoryService 0x00000001000acd5b FlatFileNode::SearchRecords(sBDPISearchRecordsContext*, void*, unsigned int*) + 237
    4 DirectoryService 0x00000001000a5a5b BaseDirectoryPlugin::GetRecordList(sGetRecordList*) + 309
    5 DirectoryService 0x00000001000a68a0 BaseDirectoryPlugin::ProcessRequest(void*) + 584
    6 DirectoryService 0x00000001000017fb CRequestHandler::HandlePluginCall(sComData**) + 715
    7 DirectoryService 0x00000001000024bc CRequestHandler::HandleRequest(sComData**) + 222
    8 DirectoryService 0x000000010002e42a CMessaging::SendInlineMessage(unsigned int) + 148
    9 DirectoryService 0x000000010000562b dsGetRecordList + 1113
    10 DirectoryService 0x0000000100082929 CCachePlugin::GetRecordListLibInfo(unsigned int, char const*, char const*, unsigned int, tDataList*, sCacheValidation* (*)(unsigned int, unsigned int, kvbuf_t*, tDataBuffer*, tRecordEntry*, unsigned int, void*, CCache*, char const**), kvbuf_t*, void*, CCache*, char const**, sCacheValidation**) + 221
    11 DirectoryService 0x000000010008933e CCachePlugin::DSgethostbyname_int(char*, char const*, char const*, int, bool, void**, int*) + 960
    12 DirectoryService 0x0000000100089ae2 CCachePlugin::DSgethostbynameservice(kvbuft*, int) + 336
    13 DirectoryService 0x000000010008f7e7 CCachePlugin::ProcessLookupRequest(int, char*, int, int) + 811
    14 DirectoryService 0x000000010002a0fd libinfoDSmigdoQuery + 559
    15 DirectoryService 0x000000010009325a _XQuery + 262
    16 DirectoryService 0x0000000100092fea DSlibinfoMIG_server + 106
    17 DirectoryService 0x00000001000282a1 dsmigdemux_internaldispatch(mach_msg_headert*, machmsg_headert*) + 65
    18 libSystem.B.dylib 0x00007fff850bbe24 machmsgserver + 357
    19 libSystem.B.dylib 0x00007fff8507b2c4 dispatch_call_block_andrelease + 15
    20 libSystem.B.dylib 0x00007fff85059810 dispatch_workerthread2 + 206
    21 libSystem.B.dylib 0x00007fff85059168 pthreadwqthread + 353
    22 libSystem.B.dylib 0x00007fff85059005 start_wqthread + 13
    Thread 2:
    0 libSystem.B.dylib 0x00007fff8503f2da machmsgtrap + 10
    1 libSystem.B.dylib 0x00007fff8503f94d mach_msg + 59
    2 com.apple.CoreFoundation 0x00007fff83955932 __CFRunLoopRun + 1698
    3 com.apple.CoreFoundation 0x00007fff83954dbf CFRunLoopRunSpecific + 575
    4 com.apple.CoreFoundation 0x00007fff83954b46 CFRunLoopRun + 70
    5 DirectoryService 0x000000010001c784 CPluginRunLoopThread::ThreadMain() + 150
    6 ...ectoryServiceCore.Framework 0x00000001001790ac DSCThread::Run() + 36
    7 ...ectoryServiceCore.Framework 0x000000010017934b DSLThread::_RunWrapper(void*) + 67
    8 libSystem.B.dylib 0x00007fff85078536 pthreadstart + 331
    9 libSystem.B.dylib 0x00007fff850783e9 thread_start + 13
    Thread 3: Dispatch queue: com.apple.root.high-priority
    0 libSystem.B.dylib 0x00007fff8503f316 semaphorewaittrap + 10
    1 libSystem.B.dylib 0x00007fff8507b669 dispatch_semaphore_waitslow + 211
    2 DirectoryService 0x00000001000286bd ___StartKernelListener_block_invoke8 + 33
    3 libSystem.B.dylib 0x00007fff8507b2c4 dispatch_call_block_andrelease + 15
    4 libSystem.B.dylib 0x00007fff85059831 dispatch_workerthread2 + 239
    5 libSystem.B.dylib 0x00007fff85059168 pthreadwqthread + 353
    6 libSystem.B.dylib 0x00007fff85059005 start_wqthread + 13
    Thread 4: Dispatch queue: com.apple.libdispatch-manager
    0 libSystem.B.dylib 0x00007fff8505816a kevent + 10
    1 libSystem.B.dylib 0x00007fff8505a03d dispatch_mgrinvoke + 154
    2 libSystem.B.dylib 0x00007fff85059d14 dispatch_queueinvoke + 185
    3 libSystem.B.dylib 0x00007fff8505983e dispatch_workerthread2 + 252
    4 libSystem.B.dylib 0x00007fff85059168 pthreadwqthread + 353
    5 libSystem.B.dylib 0x00007fff85059005 start_wqthread + 13
    Thread 5:
    0 libSystem.B.dylib 0x00007fff8503f2da machmsgtrap + 10
    1 libSystem.B.dylib 0x00007fff8503f94d mach_msg + 59
    2 libSystem.B.dylib 0x00007fff8504ac4e vprocmig_lookup2 + 182
    3 libSystem.B.dylib 0x00007fff8504aaa5 bootstraplookup2 + 268
    4 libSystem.B.dylib 0x00007fff85053ec4 dsrunning + 52
    5 libSystem.B.dylib 0x00007fff85053ce1 searchgetmodule + 86
    6 libSystem.B.dylib 0x00007fff85053c68 searchitembynumber + 196
    7 libSystem.B.dylib 0x00007fff85073a56 getpwuid + 26
    8 com.apple.CoreFoundation 0x00007fff8393cf49 _CFUpdateUserInfo + 105
    9 com.apple.CoreFoundation 0x00007fff8393ce96 _CFUserName + 22
    10 com.apple.CoreFoundation 0x00007fff8393b119 __CFXPreferencesGetManagedSourceForBundleIDAndUser + 537
    11 com.apple.CoreFoundation 0x00007fff8393aae7 __CFXPreferencesGetSearchListForBundleID + 119
    12 com.apple.CoreFoundation 0x00007fff8393a9fb CFPreferencesCopyAppValue + 43
    13 com.apple.CoreFoundation 0x00007fff8393a999 _CFBundleCopyUserLanguages + 665
    14 com.apple.CoreFoundation 0x00007fff8393a1b4 _CFBundleAddPreferredLprojNamesInDirectory + 404
    15 com.apple.CoreFoundation 0x00007fff83939c8a _CFBundleGetLanguageSearchList + 170
    16 com.apple.CoreFoundation 0x00007fff8393a4ba _CFBundleAddPreferredLprojNamesInDirectory + 1178
    17 com.apple.CoreFoundation 0x00007fff83993e97 _CFBundleCopyLanguageSearchListInDirectory + 167
    18 com.apple.CoreFoundation 0x00007fff839990d9 CFBundleCopyResourceURLsOfTypeInDirectory + 249
    19 DirectoryService 0x000000010001eb92 CPluginHandler::LoadPlugins(unsigned int) + 388
    20 DirectoryService 0x000000010000e9c9 CPluginHandler::ThreadMain() + 491
    21 ...ectoryServiceCore.Framework 0x00000001001790ac DSCThread::Run() + 36
    22 ...ectoryServiceCore.Framework 0x000000010017934b DSLThread::_RunWrapper(void*) + 67
    23 libSystem.B.dylib 0x00007fff85078536 pthreadstart + 331
    24 libSystem.B.dylib 0x00007fff850783e9 thread_start + 13
    Thread 6: Dispatch queue: com.apple.root.default-priority
    0 libSystem.B.dylib 0x00007fff8503f2da machmsgtrap + 10
    1 libSystem.B.dylib 0x00007fff8503f94d mach_msg + 59
    2 libSystem.B.dylib 0x00007fff850bbe93 machmsgserver + 468
    3 libSystem.B.dylib 0x00007fff8507b2c4 dispatch_call_block_andrelease + 15
    4 libSystem.B.dylib 0x00007fff85059810 dispatch_workerthread2 + 206
    5 libSystem.B.dylib 0x00007fff85059168 pthreadwqthread + 353
    6 libSystem.B.dylib 0x00007fff85059005 start_wqthread + 13
    Thread 7: Dispatch queue: com.apple.root.high-priority
    0 libSystem.B.dylib 0x00007fff8507b8c2 syscall + 10
    1 DirectoryService 0x00000001000284ca ___StartKernelListener_block_invoke9 + 72
    2 libSystem.B.dylib 0x00007fff8507b2c4 dispatch_call_block_andrelease + 15
    3 libSystem.B.dylib 0x00007fff85059831 dispatch_workerthread2 + 239
    4 libSystem.B.dylib 0x00007fff85059168 pthreadwqthread + 353
    5 libSystem.B.dylib 0x00007fff85059005 start_wqthread + 13
    Thread 1 crashed with X86 Thread State (64-bit):
    rax: 0x0000000000000000 rbx: 0x000000010040c300 rcx: 0x00007fff70996630 rdx: 0x000000010040bab0
    rdi: 0x0000000100385000 rsi: 0x00000001000eebea rbp: 0x000000010037fd70 rsp: 0x000000010037fd70
    r8: 0x0000000000000000 r9: 0x000000010040c1e0 r10: 0x0000000000000001 r11: 0x0000000000000011
    r12: 0x0000000000000000 r13: 0x0000000000000001 r14: 0x000000010040c380 r15: 0x000000010037fea0
    rip: 0x00007fff8509a33d rfl: 0x0000000000010206 cr2: 0x0000000100385000
    Binary Images:
    0x100000000 - 0x100120ff7 +DirectoryService ??? (???) <910DBBCD-D741-1530-210F-9A3944045A5B> /usr/sbin/DirectoryService
    0x100171000 - 0x100182fff com.apple.DirectoryServiceCore.Framework 3.6 (621.9) <16FCF0D0-89B6-6BD2-F8CA-443E1A89307C> /System/Library/PrivateFrameworks/DirectoryServiceCore.framework/Versions/A/Dir ectoryServiceCore
    0x7fff5fc00000 - 0x7fff5fc3bdef dyld 132.1 (???) <DB8B8AB0-0C97-B51C-BE8B-B79895735A33> /usr/lib/dyld
    0x7fff80a41000 - 0x7fff80b58fef libxml2.2.dylib 10.3.0 (compatibility 10.0.0) <AFE91118-DBF3-6313-37B8-8A2002C6A46B> /usr/lib/libxml2.2.dylib
    0x7fff80bc6000 - 0x7fff80c7cfff libobjc.A.dylib 227.0.0 (compatibility 1.0.0) <1960E662-D35C-5D98-EB16-D43166AE6A22> /usr/lib/libobjc.A.dylib
    0x7fff813f6000 - 0x7fff81445ff7 com.apple.DirectoryService.PasswordServerFramework 6.0 (6.0) <F5B744D7-AEAF-6B66-43CF-6E31CDA18EAB> /System/Library/PrivateFrameworks/PasswordServer.framework/Versions/A/PasswordS erver
    0x7fff81446000 - 0x7fff8144aff7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <95718673-FEEE-B6ED-B127-BCDBDB60D4E5> /usr/lib/system/libmathCommon.A.dylib
    0x7fff8144b000 - 0x7fff814ebfff com.apple.LaunchServices 362.2 (362.2) <A8EDC37C-1D40-5ED0-49BE-90EF110A6B3A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchS ervices.framework/Versions/A/LaunchServices
    0x7fff814ec000 - 0x7fff81569fef libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <35ECA411-2C08-FD7D-11B1-1B7A04921A5C> /usr/lib/libstdc++.6.dylib
    0x7fff817a6000 - 0x7fff817d1ff7 libxslt.1.dylib 3.24.0 (compatibility 3.0.0) <6589F0FC-41DB-8494-CA8B-487F4E328EB9> /usr/lib/libxslt.1.dylib
    0x7fff821e1000 - 0x7fff82467fff com.apple.security 6.1.1 (37594) <1B4E1ABD-1BB3-DA49-F574-0EEB23E73C6A> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff824fd000 - 0x7fff82525fff com.apple.DictionaryServices 1.1.2 (1.1.2) <E9269069-93FA-2B71-F9BA-FDDD23C4A65E> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Diction aryServices.framework/Versions/A/DictionaryServices
    0x7fff828c2000 - 0x7fff82922fe7 com.apple.framework.IOKit 2.0 (???) <D107CB8A-5182-3AC4-35D0-07068A695C05> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff82968000 - 0x7fff8297afe7 libsasl2.2.dylib 3.15.0 (compatibility 3.0.0) <30FE378B-99FE-8C7C-06D0-A3AA0A0A70D4> /usr/lib/libsasl2.2.dylib
    0x7fff829ff000 - 0x7fff82a20fff libresolv.9.dylib 41.0.0 (compatibility 1.0.0) <9B7AEE96-D18E-5ECF-9837-BD5CFD397831> /usr/lib/libresolv.9.dylib
    0x7fff83909000 - 0x7fff83a80fe7 com.apple.CoreFoundation 6.6.4 (550.42) <770C572A-CF70-168F-F43C-242B9114FCB5> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff84e33000 - 0x7fff84e44ff7 libz.1.dylib 1.2.3 (compatibility 1.0.0) <5BAFAE5C-2307-C27B-464D-582A10A6990B> /usr/lib/libz.1.dylib
    0x7fff84ee3000 - 0x7fff84f2ffff libauto.dylib ??? (???) <F7221B46-DC4F-3153-CE61-7F52C8C293CF> /usr/lib/libauto.dylib
    0x7fff84f7b000 - 0x7fff84fb8fff com.apple.LDAPFramework 2.0 (120.1) <A890D6E1-2721-1C1B-3B3C-13ACE5EF6B3D> /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
    0x7fff84ff3000 - 0x7fff8503dff7 com.apple.Metadata 10.6.3 (507.15) <5170FCE0-ED6C-2E3E-AB28-1DDE3F628FC5> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Metadata
    0x7fff8503e000 - 0x7fff851fffff libSystem.B.dylib 125.2.1 (compatibility 1.0.0) <71E6D4C9-F945-6EC2-998C-D61AD590DAB6> /usr/lib/libSystem.B.dylib
    0x7fff857a0000 - 0x7fff857a1ff7 com.apple.TrustEvaluationAgent 1.1 (1) <A91CE5B9-3C63-5F8C-5052-95CCAB866F72> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/Tru stEvaluationAgent
    0x7fff857c5000 - 0x7fff85882ff7 com.apple.CoreServices.OSServices 357 (357) <ABB9A264-05D8-DFF1-35DB-C4B19C4E0B71> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServi ces.framework/Versions/A/OSServices
    0x7fff85883000 - 0x7fff85a41fff libicucore.A.dylib 40.0.0 (compatibility 1.0.0) <781E7B63-2AD0-E9BA-927C-4521DB616D02> /usr/lib/libicucore.A.dylib
    0x7fff85b42000 - 0x7fff85b83fff com.apple.SystemConfiguration 1.10.5 (1.10.2) <FB39F09C-57BB-D8CC-348D-93E00C602F7D> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfi guration
    0x7fff85fab000 - 0x7fff8605afff edu.mit.Kerberos 6.5.10 (6.5.10) <05AEA348-2288-E1C0-8F10-0D8880AE7530> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
    0x7fff861c2000 - 0x7fff8627bfff libsqlite3.dylib 9.6.0 (compatibility 9.0.0) <2C5ED312-E646-9ADE-73A9-6199A2A43150> /usr/lib/libsqlite3.dylib
    0x7fff8627c000 - 0x7fff86292fef libbsm.0.dylib ??? (???) <0321D32C-9FE1-3919-E03E-2530A0C1191B> /usr/lib/libbsm.0.dylib
    0x7fff86958000 - 0x7fff86a79fe7 libcrypto.0.9.8.dylib 0.9.8 (compatibility 0.9.8) <48AEAFE1-21F4-B3C8-4199-35AD5E8D0613> /usr/lib/libcrypto.0.9.8.dylib
    0x7fff86c7c000 - 0x7fff86cb6fff libssl.0.9.8.dylib 0.9.8 (compatibility 0.9.8) <C7153747-50E3-32DA-426F-CC4C505D1D6C> /usr/lib/libssl.0.9.8.dylib
    0x7fff8740e000 - 0x7fff8741cff7 libkxld.dylib ??? (???) <4016E9E6-0645-5384-A697-2775B5228113> /usr/lib/system/libkxld.dylib
    0x7fff87454000 - 0x7fff87788fff com.apple.CoreServices.CarbonCore 861.23 (861.23) <08F360FA-1771-4F0B-F356-BEF68BB9D421> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonC ore.framework/Versions/A/CarbonCore
    0x7fff878b9000 - 0x7fff878b9ff7 com.apple.CoreServices 44 (44) <DC7400FB-851E-7B8A-5BF6-6F50094302FB> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff8864d000 - 0x7fff88688fff com.apple.AE 496.4 (496.4) <CB905496-4D6B-F26A-399D-840D26DBEE5B> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.fram ework/Versions/A/AE
    0x7fff88878000 - 0x7fff8894afe7 com.apple.CFNetwork 454.11.5 (454.11.5) <B3E2BE12-D7AA-5940-632A-1E5E7BF8E6E3> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwo rk.framework/Versions/A/CFNetwork
    0x7fff8894b000 - 0x7fff88bceff7 com.apple.Foundation 6.6.4 (751.42) <9A99D378-E97A-8C0F-3857-D0FAA30FCDD5> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff88e7f000 - 0x7fff88f0ffff com.apple.SearchKit 1.3.0 (1.3.0) <45BA1053-9196-3C2F-2421-AFF5E09627CC> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchK it.framework/Versions/A/SearchKit
    0x7fff89120000 - 0x7fff8912ffff com.apple.NetFS 3.2.1 (3.2.1) <4396CAD7-FDAF-8C63-97FA-74E7124DFF2A> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
    0x7fff8913e000 - 0x7fff89144fff com.apple.DiskArbitration 2.3.1 (2.3.1) <D5D3AE5F-83AC-0CEB-2DC3-755F0CC20A4E> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x7fffffe00000 - 0x7fffffe01fff libSystem.B.dylib ??? (???) <71E6D4C9-F945-6EC2-998C-D61AD590DAB6> /usr/lib/libSystem.B.dylib

    Any fix for this yet?
    com.apple.DirectoryServices crashes and attempts to restart every 10 seconds on my system:
    10/10/11 4:05:29 PM    com.apple.launchd[1]    (com.apple.DirectoryServices[1791]) Job appears to have crashed: Bus error
    10/10/11 4:05:29 PM    com.apple.launchd[1]    (com.apple.DirectoryServices) Throttling respawn: Will start in 7 seconds
    10/10/11 4:05:29 PM    com.apple.ReportCrash.Root[1789]    2011-10-10 16:05:29.978 ReportCrash[1789:4543] Saved crash report for DirectoryService[1791] version ??? (???) to /Library/Logs/DiagnosticReports/DirectoryService_2011-10-10-160529_localhost.cr ash

  • Bus error in starting Xorg

    I've been trying to get Xorg to work, but I've been having some issues.
    I worked out all the warnings indicated in my /var/log/Xorg.0.log but the main issue seems to be in line 112 to 115,
    Bus error at address 0xb73c88c0
    Fatal server error:
    Caught signal 7 (Bus error). Server aborting
    But I don't really know how to fix it, and I can't find any documentation of this error.
    The same thing happens with my xorg.conf and with running without an xorg.conf
    I'm running it on an Acer Aspire One, which has Intel 945GME integrated graphics
    Here's the /var/log/Xorg.0.log
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    X.Org X Server 1.7.1.902 (1.7.2 RC 2)
    Release Date: 2009-11-20
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.31-ARCH i686
    Current Operating System: Linux arcturus 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:48:17 CET 2009 i686
    Kernel command line: root=/dev/disk/by-uuid/a3d0fabc-c02c-40de-8157-2e190b743506 ro
    Build Date: 21 November 2009 10:31:54AM
    Current version of pixman: 0.16.2
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Thu Dec 10 01:39:16 2009
    (==) Using config file: "/etc/X11/xorg.conf"
    (==) ServerLayout "X.org Configured"
    (**) |-->Screen "Screen0" (0)
    (**) | |-->Monitor "Monitor0"
    (**) | |-->Device "Card0"
    (**) |-->Input Device "Mouse0"
    (**) |-->Input Device "Keyboard0"
    (**) Option "DontZap" "false"
    (**) Option "AllowMouseOpenFail" "true"
    (**) Option "AllowEmptyInput" "false"
    (**) Option "AutoAddDevices" "false"
    (**) Not automatically adding devices
    (==) Automatically enabling devices
    (==) FontPath set to:
    /usr/share/fonts/misc,
    /usr/share/fonts/100dpi:unscaled,
    /usr/share/fonts/75dpi:unscaled,
    /usr/share/fonts/TTF,
    /usr/share/fonts/Type1
    (**) ModulePath set to "/usr/lib/xorg/modules"
    (II) Loader magic: 0x81e5760
    (II) Module ABI versions:
    X.Org ANSI C Emulation: 0.4
    X.Org Video Driver: 6.0
    X.Org XInput driver : 7.0
    X.Org Server Extension : 2.0
    (--) using VT number 7
    (--) PCI:*(0:0:2:0) 8086:27ae:1025:015b Intel Corporation Mobile 945GME Express Integrated Graphics Controller rev 3, Mem @ 0x78480000/524288, 0x60000000/268435456, 0x78500000/262144, I/O @ 0x000060c0/8
    (--) PCI: (0:0:2:1) 8086:27a6:1025:015b Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller rev 3, Mem @ 0x78400000/524288
    (II) Open ACPI successful (/var/run/acpid.socket)
    (II) "extmod" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dbe" will be loaded. This was enabled by default and also specified in the config file.
    (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
    (II) "record" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dri" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dri2" will be loaded. This was enabled by default and also specified in the config file.
    (II) LoadModule: "dbe"
    (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    (II) Module dbe: vendor="X.Org Foundation"
    compiled for 1.7.1.902, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension DOUBLE-BUFFER
    (II) LoadModule: "extmod"
    (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    (II) Module extmod: vendor="X.Org Foundation"
    compiled for 1.7.1.902, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension MIT-SCREEN-SAVER
    (II) Loading extension XFree86-VidModeExtension
    (II) Loading extension XFree86-DGA
    (II) Loading extension DPMS
    (II) Loading extension XVideo
    (II) Loading extension XVideo-MotionCompensation
    (II) Loading extension X-Resource
    (II) LoadModule: "record"
    (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    (II) Module record: vendor="X.Org Foundation"
    compiled for 1.7.1.902, module version = 1.13.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension RECORD
    (II) LoadModule: "glx"
    (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    Backtrace:
    0: /usr/bin/X (xorg_backtrace+0x3b) [0x809ccab]
    1: /usr/bin/X (0x8048000+0x52ff5) [0x809aff5]
    2: (vdso) (__kernel_rt_sigreturn+0x0) [0xb787440c]
    3: /lib/ld-linux.so.2 (0xb7875000+0x78a7) [0xb787c8a7]
    4: /lib/ld-linux.so.2 (0xb7875000+0x12236) [0xb7887236]
    5: /lib/ld-linux.so.2 (0xb7875000+0xde46) [0xb7882e46]
    6: /lib/ld-linux.so.2 (0xb7875000+0x11cd3) [0xb7886cd3]
    7: /lib/libdl.so.2 (0xb7861000+0xbeb) [0xb7861beb]
    8: /lib/ld-linux.so.2 (0xb7875000+0xde46) [0xb7882e46]
    9: /lib/libdl.so.2 (0xb7861000+0x107c) [0xb786207c]
    10: /lib/libdl.so.2 (dlopen+0x41) [0xb7861b21]
    11: /usr/bin/X (0x8048000+0x105927) [0x814d927]
    12: /usr/bin/X (0x8048000+0x1056c2) [0x814d6c2]
    13: /usr/bin/X (0x8048000+0x1072c2) [0x814f2c2]
    14: /usr/bin/X (xf86LoadModules+0xe8) [0x80a3f78]
    15: /usr/bin/X (InitOutput+0x21b) [0x80a5e5b]
    16: /usr/bin/X (0x8048000+0x1a990) [0x8062990]
    17: /lib/libc.so.6 (__libc_start_main+0xe6) [0xb74b5b86]
    18: /usr/bin/X (0x8048000+0x1a731) [0x8062731]
    Bus error at address 0xb73c88c0
    Fatal server error:
    Caught signal 7 (Bus error). Server aborting
    Please consult the The X.Org Foundation support
    at http://wiki.x.org
    for help.
    Please also check the log file at "/var/log/Xorg.0.log" for additional information.
    And here's my xorg.conf
    Section "ServerLayout"
    Identifier "X.org Configured"
    Screen 0 "Screen0" 0 0
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
    EndSection
    Section "ServerFlags"
    Option "AllowMouseOpenFail" "true"
    Option "AllowEmptyInput" "false"
    Option "AutoAddDevices" "false"
    Option "DontZap" "false"
    EndSection
    Section "Files"
    ModulePath "/usr/lib/xorg/modules"
    EndSection
    Section "Module"
    Load "dbe"
    Load "extmod"
    Load "record"
    Load "glx"
    Load "dri2"
    Load "dri"
    EndSection
    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/input/mice"
    Option "ZAxisMapping" "4 5 6 7"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Monitor Vendor"
    ModelName "Monitor Model"
    EndSection
    Section "Device"
    ### Available Driver options are:-
    ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
    ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
    ### [arg]: arg optional
    #Option "ShadowFB" # [<bool>]
    #Option "DefaultRefresh" # [<bool>]
    #Option "ModeSetClearScreen" # [<bool>]
    Identifier "Card0"
    Driver "vesa"
    VendorName "Intel Corporation"
    BoardName "Mobile 945GME Express Integrated Graphics Controller"
    BusID "PCI:0:2:0"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Card0"
    Monitor "Monitor0"
    SubSection "Display"
    Viewport 0 0
    Depth 1
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 4
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 8
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 15
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 16
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 24
    EndSubSection
    EndSection
    Thanks,
    David

    chao06 wrote:do some mirrors update faster than others?  the latest version that I can find in repo is 1.7.2-2 (which also doesn't work)
    Yes, I had to change my mirror as updates were slow to appear. You can check for a reliable mirror from http://wiki.archlinux.org/index.php/Mir … ror_status

  • InDesign Server CS6 (MacOS) - JavaScripting & Troubleshooting "Bus error" or "Segmentation fault"

    I'm attempting to convert a workflow from InDesign CS5.5 Desktop with AppleScript to InDesign Server CS6 with JavaScript. It seems most of our templates work fine but every now and then I run into one that seems to work properly but right after we export to PDF and JPG which is the final step in the script I get either a Bus error or a Segmentation fault error. The files do export and the console sits idle for a few seconds then I get the crash. It doesn't seem to give me anything else and I can't find a crash dump or core file anywhere on disk to examine.
    The exact same input files on InDesign CS5.5 Desktop completing a very similar automation task via AppleScript work without an issue or error. I'm not certain if it's a problem with the way the InDesign files were put together, a version problem between a CS5.5 file and CS6, or something that I'm doing wrong in the script.
    Is there a way to get InDesign Server to go into debug or verbose mode so that it will show more than just two word errors on crash?  I've read a few people talking here about the debug version but every path I've found to get access to the debug version runs into a roadblock with a bad link.
    I would appreciate a point in the current right direction for how to debug these templates this script.

    Re: verbose mode. These are not InDesign error messages. They are system errors, saying that an app (InDesign?) crashed, went away, hence could not issue any kind of message. Crash logs are the place to start. If they don't help, and the crash is outside your code, after that it's over to the maintainer (Adobe?)
    Worth sharing a suitable crash log, as the list of routines active at the crash can narrow down issues.

  • InDesign Server :line 13: 2753 Bus error "$installed_name" "$@"

    [InDesign Server CS4, CS5, CS5.5    line 13: 2753 Bus error "$installed_name" "$@"]
    We support a few clients on various version of InDesign Server and all have exactly the same issue upon having the application produce PDF files...   line 13: 2753 Bus error "$installed_name" "$@"   which causes InDesign Server to unexpectedly quit.
    Searching these forums we have found CS3 instances of this error message pointing to fonts not loaded on the machine running InDesign Server, but no "this is what we did to fix it" solution has been found.
    Our customers are running beefed up MacPros or Mac Minis with Mac OS 10.6 (non server) and OS 10.7 (server), 8GB - 16GB RAM, 1TB HD
    For font management we have the following being utilized:
    - Universal type server
      - if no plugin exists for InD Server, not sure how much this app will help manage fonts
    - Suitcase Server
    - if no plugin exists for InD Server, not sure how much this app will help manage fonts
    - Loading all fonts into:   /Users/*/Library/Fonts
      - seems to be the best option for font management on a system running InDesign Server
    Our company develops a plugin for InDesign Server and allows regular InDesign to produce the pdfs in a similar manner.  Running our plugin under regular InDesign we DO NOT have these issues of BUS errors, yet as soon as any of our customers utilize InDesign Server, they all immediately see BUS errors.
    We have written a shell script that quits (normally) indesign server, and relaunches it (if quit abnormally) so that we have some semblance of an "always on" InDesign Server application, but this is merely a band-aid fix for a bigger problem.
    We are pointing the finger at Adobe InDesign Server being the problem here, yet our customers do not care where the blame is placed, we are seeing a solution for them in any fashion that presents a permanent solution.
    Julio Vasquez
    Product Specialist @ Comosoft, Inc.

    Hi Julio,
    I am having the same exact problem. We are evaluating the InDesign server and will consider buying it only if it performs reasonably stable. This "installed_name" "$@" is baffling us.
    Team Adobe InDesign Server: Kindly address this concern soon!
    Varun

  • Module bus errors after update

    I did a system update tonight and now I've got a problem.
    The upgrade seemed to go fine, I didn't notice any issues, so I upgrated my virutalbox_bin from aur as well.
    It exited with:
    FATAL: Module vboxdrv not found
    So I tried:
    sudo modprobe vboxdrv
    and got the same.
    Then I rebooted and the boot messages don't look too good, can't find vboxdrv then below that a message saying Updating module dependencies..... This fails with a
    /etc/rc.d/functions line 136: 4056 Bus error
    It manages to boot, and I tried running depmod manually, but I also get a bus error here.
    What's going on? What should I do next?
    Thanks,
      Jeremy

    I managed to insert the vboxdrv.ko using "insmod vboxdrv.ko" from /lib/modules/2.6.33-ARCH/misc.
    This works, and VirtualBox correctly uses the module and runs fine.
    But, modprobe still fails.
    The module is good, the path to the module looks right (matches uname -r).
    I can't even find any helpful messages in /var/log/ or dmesg. 
    Can someone give me a pointer?
    Thanks,
      Jeremy

  • AFP disconnects users, file opening problems, abnormal exits and bus errors

    Hi all
    Since a few weeks we have been having problems with AFP file sharing with OS X Server 10.5.5 (Simple config)
    Several times a day the server stops responding to save commands (especially with Adobe software) or abruptly disconnects users. The console error most frequently associated with these crashes is:
    "com.apple.launchd[1] (com.apple.AppleFileServer[3674]) Exited abnormally: Bus error"
    sometimes starting server preferences we get the following error (roughly translated from French):
    An Error has occured on the server while executing a command.
    the error "CANNOTFSGETVOLINFOERR" occured while executing a command of type "getVolumeList" in the module "servermgr_filebrowser"
    I'm past hoping for a quick fix but any pointers or ideas of what to look for would be greatly appreciated.
    Robin Lambell

    I just want to make sure I have the steps clear.
    disable the automounts in 'Filesharing' in Server Admin
    I disable the automounts in the File Sharing tab of Server Admin by clicking on each share point and clicking the Unshare button.
    then remove the sharepoints
    How? Isn't that automatic? I chose to unshare a share point and it disappeared from the list. Is that enough?
    Then in Terminal.app do:
    sudo rm /private/var/etc/AFP.conf
    Then:
    sudo rm /Library/Preferences/com.apple.AppleFileServer.plist
    Then in Server Admin, restore the sharepoints back and automounts. Then restart the AFP service.
    I restore the share points by manually choosing to share each of them again? I'll have to redefine each one, won't I?
    Thanks for the help. I haven't done this before and I want to make sure I'm doing it right.

  • Solaris 8 - Motif, Xbae apps ZPR with purify or Bus error

    The application runs under 5.6 but after compiling and running on 5.8, I receive a Bus Error or when running purify receive a ZPR & COR. The c program is receiving the error during widget creation:
    tbl = XtVaCreateManagedWidget
    ("tbl",
    xbaeMatrixWidgetClass, parent, ...... etc.)
    Purify outputs this message:
    ZPR: This is occurring while in:
    _XtCompileCallbackList [Callback.c]
    CompileCallbacks [Create.c]
    xtCreate [Create.c]
    _XtVaCreateWidget [VarCreate.c]
    XtVaCreateManagedWidget [VarCreate.c]
    Reading 4 bytes from 0x12
    I have tended to think I have a versioning problem with Solaris 8 but I need some help.
    Thank you very much, Joanne

    The application runs under 5.6 but after compilingand
    running on 5.8, I receive a Bus Error or whenrunning
    purify receive a ZPR & COR. The c program is
    receiving the error during widget creation:
    tbl = XtVaCreateManagedWidget
    ("tbl",
    xbaeMatrixWidgetClass, parent, ......
    , parent, ...... etc.)
    Purify outputs this message:
    ZPR: This is occurring while in:
    _XtCompileCallbackList[Callback.c]
    CompileCallbacks [Create.c]
    xtCreate [Create.c]
    _XtVaCreateWidget [VarCreate.c]
    XtVaCreateManagedWidget
    ateManagedWidget [VarCreate.c]
    Reading 4 bytes from 0x12
    I have tended to think I have a versioning problem
    with Solaris 8 but I need some help.
    Thank you very much, Joanne

  • Core Dump on Solaris 10 (Signal 10 - Bus Error), but not on Solaris 8?

    Hi,
    We just moved our product from Solaris 8 to Solaris 10. It runs for months on Solaris 8 without any problems, while core dumped after running about 2 weeks on Solaris 10.
    Any clue on what could be wrong is apprecaited.
    pam

    Hi Andrew,
    Appreciate your answer very much. I am very new to Solaris and UNIX in general. Would you please let me know what kind of info would help diagnose the
    problem? I have stack pointer, output of "where" from gdb. frme pointer, etc.
    pam
    ===================
    GNU gdb 6.3
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "sparc-sun-solaris2.8"...(no debugging symbols found)
    Core was generated by `./warnsrvr'.
    Program terminated with signal 10, Bus error.
    #0 0x001a3ca8 in __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__ ()
    (gdb) where
    #0 0x001a3ca8 in __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__ ()
    #1 0x001a3ca8 in __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__ ()
    Previous frame identical to this frame (corrupt stack?)
    ======================================
    (gdb) disassemble 0x001a3ca8
    Dump of assembler code for function __1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__:
    0x001a3c24 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+0>: cmp %o0, 1
    0x001a3c28 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+4>: be,pn %icc, 0x1a3c38 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+20>
    0x001a3c2c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+8>: sethi %hi(0x572000), %l6
    0x001a3c30 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+12>: ret
    0x001a3c34 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+16>: restore %g0, 0, %o0
    0x001a3c38 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+20>: ld [ %l6 + 0x358 ], %l5
    0x001a3c3c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+24>: cmp %l5, 0
    0x001a3c40 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+28>: bne,pn %icc, 0x1a3c50 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+44>
    0x001a3c44 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+32>: cmp %l5, 1
    0x001a3c48 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+36>: ret
    0x001a3c4c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+40>: restore %g0, 1, %o0
    0x001a3c50 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+44>: bne,pn %icc, 0x1a3cb0 <__1cSWPReferenceManagerOInputIonoModel6MrknKIONO_MODEL_khki_nGRESULT__+4>
    0x001a3c54 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+48>: sethi %hi(0x1a3c00), %l7
    0x001a3c58 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+52>: mov -1, %i1
    0x001a3c5c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+56>: sth %i1, [ %fp + -1864 ]
    0x001a3c60 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+60>: add %fp, -1824, %o0
    0x001a3c64 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+64>: ldd [ %l7 + 8 ], %f0
    0x001a3c68 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+68>: call 0x1c87f0 <___const_seg_900001301+16>
    0x001a3c6c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+72>: std %f0, [ %fp + -1856 ]
    0x001a3c70 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+76>: call 0x1cf888 <__1cKIono2Ascii6FrknKIONO_MODEL_pcki_v_+100>
    0x001a3c74 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+80>: add %fp, -1864, %o0
    0x001a3c78 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+84>: sllx %i2, 0x30, %o1
    0x001a3c7c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+88>: mov %i0, %o0
    0x001a3c80 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+92>: srax %o1, 0x30, %o1
    0x001a3c84 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+96>: call 0x182cb0 <__1cTGenReferenceManagerOGetCorrections6MrknKCLSGpsTime_rknICLSCoord_rnOCORRECTION_SET__nGRESULT__+3504>
    0x001a3c88 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+100>: add %fp, -1864, %o2
    0x001a3c8c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+104>: cmp %o0, 1
    0x001a3c90 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+108>: be,pn %icc, 0x1a3ca0 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+124>
    0x001a3c94 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+112>: mov %i0, %o0
    0x001a3c98 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+116>: ret
    0x001a3c9c <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+120>: restore %g0, 0, %o0
    0x001a3ca0 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+124>: call 0x1a7068 <__1cSWPReferenceManagerPAdjustXTRATimes6MpnZCLSGnssSatellitePredictor_khrnKCLSGpsTime_rd_nGRESULT__+3584>
    0x001a3ca4 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+128>: add %fp, -1864, %o1
    0x001a3ca8 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+132>: ret
    End of assembler dump.
    =====================================
    (gdb) info registers
    g0 0x0 0
    g1 0xfd77ecb8 -42472264
    g2 0x11 17
    g3 0xecf0 60656
    g4 0xfd77e304 -42474748
    g5 0xfc 252
    g6 0x0 0
    g7 0xfeda4200 -19250688
    o0 0x1 1
    o1 0x20 32
    o2 0x693500 6894848
    o3 0xecf0 60656
    o4 0x6a21f0 6955504
    o5 0x1 1
    sp 0xfd77ec38 0xfd77ec38
    o7 0x1a3ca0 1719456
    l0 0x1b000021 452984865
    l1 0x2ca2a40 46803520
    l2 0x40173076 1075261558
    l3 0x57d22e16 1473392150
    l4 0x3fa80492 1067975826
    l5 0x3c06fe49 1007091273
    l6 0x4072b4a5 1081259173
    l7 0x410d711d 1091399965
    i0 0x421c0000 1109131264
    i1 0xffffffff -1
    i2 0x1d000018 486539288
    i3 0x2ca2808 46802952
    i4 0x40138e4a 1075023434
    i5 0x8b122e16 -1961742826
    fp 0xbfb17c3b 0xbfb17c3b
    i7 0xa817f0db -1474826021
    y 0x3 3
    psr 0xfe401007 -29356025
    wim 0x0 0
    tbr 0x0 0
    pc 0x1a3ca8 0x1a3ca8 <__1cSWPReferenceManagerMInputUtcInfo6MrknIUTC_INFO_khki_nGRESULT__+132>
    npc 0x1a3cac 0x1a3cac <__1cSWPReferenceManagerOInputIonoModel6MrknKIONO_MODEL_khki_nGRESULT__>
    fsr 0x400420 4195360
    csr 0x0 0

  • SIGBUS 10*  bus error in the iplanet weblogic 7.0 sp2 on hpux 11i

    My iplanet web server crashed with the following error messages found in the iplanet error log file:
    [11/Nov/2003:04:12:41] config ( 5180): SIGBUS 10* bus error
    [11/Nov/2003:04:12:41] config ( 5180): si_signo [10]: SIGBUS 10* bus error
    [11/Nov/2003:04:12:41] config ( 5180): si_errno [0]: Error 0
    [11/Nov/2003:04:12:41] config ( 5180): si_code [0]: BUS_UNKNOWN [addr: 0x42618307]
    [11/Nov/2003:04:12:41] config ( 5180):      stackpointer=7690A438
    I am running iplanet 6.0 sp 5 with WebLogic 7.0 sp2 on HPUX 11i. There is no error message in the web logic log file.
    On the other hands, I have found out that there is a recommended patch for weblogic 7.0sp2 if running on HPUX 11i (CR102314). Would this patch fix my problem? Please help.

    My iplanet web server crashed with the following error messages found in the iplanet error log file:
    [11/Nov/2003:04:12:41] config ( 5180): SIGBUS 10* bus error
    [11/Nov/2003:04:12:41] config ( 5180): si_signo [10]: SIGBUS 10* bus error
    [11/Nov/2003:04:12:41] config ( 5180): si_errno [0]: Error 0
    [11/Nov/2003:04:12:41] config ( 5180): si_code [0]: BUS_UNKNOWN [addr: 0x42618307]
    [11/Nov/2003:04:12:41] config ( 5180):      stackpointer=7690A438
    I am running iplanet 6.0 sp 5 with WebLogic 7.0 sp2 on HPUX 11i. There is no error message in the web logic log file.
    On the other hands, I have found out that there is a recommended patch for weblogic 7.0sp2 if running on HPUX 11i (CR102314). Would this patch fix my problem? Please help.

  • Time Machine initial backup fails OS 10.5 with no reason but 'bus error'

    I ran into an error on the last system update and had to go back to Leopard 10.5 just to see my stuff. I managed to move my home directory into the newly installed system and all my files are intact. Now I'm trying to get a Time Machine backup before I proceed (my initial mistake was not keeping up with them in the first place).
    I had some trouble early on and at one point decided to reformat the external drive (a Fantom Drives GreenDrive, usb, 500Gb). I formatted as Mac OS Extended (Journaled) as recommended, no partitions, and then tried my first initial Time Machine backup.
    It predictably spent a long time 'preparing...' and I followed along in the system log. Eventually, the copying began but early on (within the first 45 min) the backup failed with almost no indications in the log as to why. I've pasted the system log below.
    One thought I had was that it was weird that there was an automatic request for backup at 12:36:54. I also included the CrashReport, but I can't make any sense out of it.
    any ideas?
    System log:
    6/23/10 11:57:30 PM /System/Library/CoreServices/backupd[1190] Backup requested by user
    6/23/10 11:57:30 PM /System/Library/CoreServices/backupd[1190] Starting standard backup
    6/23/10 11:57:30 PM /System/Library/CoreServices/backupd[1190] Backing up to: /Volumes/Deep Green/Backups.backupdb
    6/24/10 12:15:13 AM /System/Library/CoreServices/backupd[1190] No pre-backup thinning needed: 173.94 GB requested (including padding), 453.71 GB available
    6/24/10 12:15:13 AM /System/Library/CoreServices/backupd[1190] MDBackupBegin() returned result (910) > 0, waiting
    6/24/10 12:36:54 AM /System/Library/CoreServices/backupd[1190] Backup requested by automatic scheduler
    6/24/10 12:42:17 AM ReportCrash[1431] Formulating crash report for process backupd[1190]
    6/24/10 12:42:18 AM com.apple.launchd[1] (com.apple.backupd[1190]) Exited abnormally: Bus error
    6/24/10 12:42:24 AM ReportCrash[1431] Saved crashreport to /Library/Logs/CrashReporter/backupd2010-06-24-004204dylan-boyds-macbook.crash using uid: 0 gid: 0, euid: 0 egid: 0
    CrashReport:
    Process: backupd [1190]
    Path: /System/Library/CoreServices/backupd
    Identifier: backupd
    4 backupd 0x00007525 0x1000 + 25893
    5 backupd 0x00002332 0x1000 + 4914
    8 backupd 0x00015028 0x1000 + 81960
    9 backupd 0x0000ea64 0x1000 + 55908
    10 backupd 0x00008bfe 0x1000 + 31742
    11 backupd 0x00004c10 0x1000 + 15376
    12 backupd 0x000057b8 0x1000 + 18360
    0x1000 - 0x3dffb backupd ??? (???) <f50411bdb241b61699aa81b2f3dfb7d1> /System/Library/CoreServices/backupd

    I should have added that I've been through about half a dozen sites (including sanctioned apple sites) and their recommendations for getting Time Machine to work properly. I did format the drive once (with extended journaled format and GUID partition scheme, but I didn't zero it out. I'm trying that now and I'll try TM again in about 4 hours.
    This morning I tried turning Time Machine's automatic backups off (moved the slider to off in the preferences pane) and manually started a backup (right-clicking the TM icon in the dock and selecting "Backup Now"). It ran further along than before, but stopped again. This time, it gave an error, and I've pasted the log below. I looked but didn't find much helpful on "error 11."
    system log:
    Jun 24 09:14:08 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Backup requested by user
    Jun 24 09:14:08 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Starting standard backup
    Jun 24 09:14:08 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Backing up to: /Volumes/Deep Green/Backups.backupdb
    Jun 24 09:14:08 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Event store UUIDs don't match for volume: Macintosh HD
    Jun 24 09:14:08 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Node requires deep traversal:/ reason:kFSEDBEventFlagMustScanSubDirs|
    Jun 24 09:47:13 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: No pre-backup thinning needed: 175.31 GB requested (including padding), 453.11 GB available
    Jun 24 10:13:46 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Error: (-36) SrcErr:YES Copying /Previous Systems.localized/2010-06-22_2236/Applications/iPhoto.app/Contents/Resources/Po intOfInterest.db to (null)
    Jun 24 10:13:46 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Error: (-36) SrcErr:NO Copying /Previous Systems.localized/2010-06-22_2236/Applications/iPhoto.app/Contents/Resources/Po intOfInterest.db to /Volumes/Deep Green/Backups.backupdb/Dylan Boyd’s MacBook/2010-06-23-231048.inProgress/E3294B86-62B0-4ABF-9B2B-F5D46B82736D/Macin tosh HD/Previous Systems.localized/2010-06-22_2236/Applications/iPhoto.app/Contents/Resources
    Jun 24 10:13:46 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Stopping backup.
    Jun 24 10:13:46 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Error: (-8062) SrcErr:NO Copying /Previous Systems.localized/2010-06-22_2236/Applications/iPhoto.app/Contents/Resources/Po intOfInterest.db to /Volumes/Deep Green/Backups.backupdb/Dylan Boyd’s MacBook/2010-06-23-231048.inProgress/E3294B86-62B0-4ABF-9B2B-F5D46B82736D/Macin tosh HD/Previous Systems.localized/2010-06-22_2236/Applications/iPhoto.app/Contents/Resources
    Jun 24 10:13:57 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Copied 13360 files (1.5 GB) from volume Macintosh HD.
    Jun 24 10:13:57 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Copy stage failed with error:11
    Jun 24 10:14:03 dylan-boyds-macbook /System/Library/CoreServices/backupd[444]: Backup failed with error: 11

  • Safari crashing & bus error

    OK, the main problem with my computer is with Safari. It will crash whenever I try to open most websites. I opened the terminal and watched what happened and it says 'bus error' (when safari closes) and then 'process complete'. I'm not sure what to do.
    Rewind though. Two days ago I tried downloading the macOS 10.5 update that came through my software update. It was supposed to install the new version of safari (3.0.4) and some other programs. For some reason, the download freaked out just as it was finishing. Safari thinks it is 3.0.4 but it doesn't work. I still have MacOS X 10.4.11. I cannot redownload/install the update because my computer thinks it has been installed and does not appear in software updates (yet it does NOT appear in the 'installed updates' section. Basically, half my computer recognizes the installation and the other half doesn't. Safari is affected most (at least so far from what I can tell). I tried creating a new user and seeing if it was my safari prefs but system preferences crashes whenever I try adding a user.
    Any help would be beneficial. I cannot do most of my school work without the internet.
    Sean

    Hi,
    Try the following steps:
    1. Launch Disk Utility, select your startup disk and then 'verify disk' and 'repair permissions' if the disk is ok.
    2. Download the 10.4.11 combo update from [here|http://www.apple.com/downloads/macosx/apple/macosx_updates/macosx10411upd ateintel.html].
    3. Move Safari from /Applications and onto your Desktop (this is to make a backup of it more than anything).
    4. Run the combo updater you have downloaded.

  • SIGBUS 10 bus error

    I'm having problem with weblogic server core dumping with 'SIGBUS 10 bus error' irregularly. I'm unable to reproduce this bug as there doesn't seem to be any pattern. It would work for a few customers and then dies even though we've only had no more than 5 requests (The traffic on our website is fairly slow). Once I bounce the server, it would work again for a few more customers then core dumps again with same error. I noticed from previous discussion boards that this might be a JVM issue (Solaris_JDK_1.2.2_05a)?? Can anyone tell me if rolling back my jdk version would fix this problem? Any help would be greatly appreciated, thanks!WeblogicServer 5.10 sp6Platform (OS Version)=================Sun Sparc Solaris 7JDK Version (if applicable)=====================Solaris_JDK_1.2.2_05aERROR MESSAGE===============SIGBUS 10 bus error si_signo [10]: BUS si_errno [0]: si_code [1]: BUS_ADRALN [addr: 0xedc1fdfd]stackpointer=EADC0D70Inconsistent thread : best efforts attempt (may fail)"SeedGenerator Thread" (TID:0x17637a8, sys_thread_t:0x17636e0, state:CW, thread_t: t@31, threadID:0xe9701dc8, stack_bottom:0xe9702000, stack_size:0x20000) prio=1

    take a look at http://www.weblogic.com/platforms/sun/index.html
    it recommends using:
    export JVMARGS="inline_instrs_jit=0"
    with 1.2.2_05a
    "Thomas" <[email protected]> wrote in message
    news:3a2e8d4c$[email protected]..
    I'm having problem with weblogic server core dumping with 'SIGBUS 10 buserror' irregularly. I'm unable to reproduce this bug as there doesn't seem
    to be any pattern. It would work for a few customers and then dies even
    though we've only had no more than 5 requests (The traffic on our website is
    fairly slow). Once I bounce the server, it would work again for a few more
    customers then core dumps again with same error. I noticed from previous
    discussion boards that this might be a JVM issue (Solaris_JDK_1.2.2_05a)??
    Can anyone tell me if rolling back my jdk version would fix this problem?
    Any help would be greatly appreciated, thanks!WeblogicServer 5.10
    sp6Platform (OS Version)=================Sun Sparc Solaris 7JDK Version (if
    applicable)=====================Solaris_JDK_1.2.2_05aERROR
    MESSAGE===============SIGBUS 10 bus error si_signo [10]: BUS si_errno
    [0]: si_code [1]: BUS_ADRALN [addr:
    0xedc1fdfd]stackpointer=EADC0D70Inconsistent thread : best efforts attempt
    (may fail)"SeedGenerator Thread" (TID:0x17637a8, sys_thread_t:0x17636e0,
    state:CW, thread_t: t@31, threadID:0xe9701dc8, stack_bottom:0xe9702000,
    stack_size:0x20000) prio=1

  • SIGBUS 10 bus error" & "Inconsistent thread : best efforts attempt (may fail)

    We are using Weblogic 5.1 (no service pack installd) on SUN Solaris.
    Suddenly weblogic server was down & in log file
    we found the "SIGBUS 10 bus error" & "Inconsistent thread : best efforts
    attempt (may fail)" errors (see below for full errors in log file).
    We have executeThreadCount=100 in properties file.
    Is it known problem/bug with solaris?
    thanks,
    -ravi
    Tue Jun 06 15:30:55 PDT 2000:<E> <ServletContext-General> Cannot find
    resource 'javascript/stub.rmf' in document root
    '/qa/weblogic/p4root/website/htdocs-portal'
    SIGBUS 10 bus error
    si_signo [10]: BUS
    si_errno [0]:
    si_code [1]: BUS_ADRALN [addr: 0xd81eb71d]
    stackpointer=C99D0D80
    Inconsistent thread : best efforts attempt (may fail)
    "Thread-36" (TID:0x4e92320, sys_thread_t:0x4e92258, state:CW, thread_t:
    t@202, threadID:0xc8ae1dd8, stack_bottom:0xc8ae2000, stack_size:0x20000)
    prio=5
    [1] java.lang.Object.wait(Object.java:424)
    [2] javax.mail.EventQueue.dequeue(EventQueue.java:73)
    [3] javax.mail.EventQueue.run(EventQueue.java:93)
    [4] java.lang.Thread.run(Thread.java:478)
    Inconsistent thread : best efforts attempt (may fail)
    "SeedGenerator Thread" (TID:0x4994508, sys_thread_t:0x4994440, state:CW,
    thread_t: t@118, threadID:0xc8ab1dd8, stack_bottom:0xc8ab2000,
    stack_size:0x20000) prio=1
    [1] java.lang.Object.wait(Object.java:424)
    [2] sun.security.provider.SeedGenerator.run(SeedGenerator.java:107)
    [3] java.lang.Thread.run(Thread.java:479)
    Inconsistent thread : best efforts attempt (may fail)
    "SSLListenThread" (TID:0x4381688, sys_thread_t:0x43815c0, state:R, thread_t:
    t@114, threadID:0xc8b41dd8, stack_bottom:0xc8b42000, stack_size:0x20000)
    prio=5
    [1] java.net.PlainSocketImpl.socketAccept(Native Method)
    [2] java.net.PlainSocketImpl.accept(PlainSocketImpl.java:406)
    [3] java.net.ServerSocket.implAccept(ServerSocket.java:238)
    [4] java.net.ServerSocket.accept(ServerSocket.java:223)
    [5]
    weblogic.security.SSL.SSLServerSocket.acceptNoHandshake(SSLServerSocket.java
    :121)
    [6] weblogic.security.SSL.SSLServerSocket.accept(SSLServerSocket.java:112)
    [7] weblogic.t3.srvr.ListenThread.run(ListenThread.java:226)

    Hi Steve,
    We are also not getting that error on NT. We are not getting SIGBUS error
    at particular point/place. Randomly (approx after 30 min)
    the server will give this SIGBUS error & shutdowns.
    I tried with -native option with JAVA VM also. Still we are getting the same
    error.
    We are using ORACLE8.1.5 with Weblogic's OCI driver.
    I feel this problem may be related to "jdk1.2.2_05a" on Solaris!!
    Weblogic guys: Will weblogic supports jdk1.2.2_05a on Solaris?
    thanks
    -ravi
    Steve Rogers <[email protected]> wrote in message
    news:[email protected]...
    Ravi, I am developing on WL 4.5.1 and solaris 2.6 with SIGBUS 10 erroralso
    (I also have jdk 1.2.2_05a) I do NOT think it has anything to do withthis,
    java always runs with -native on, infact you cannot turn it off. I am
    using HTMLkona, and getting this (from the thread dump) in
    weblogic.html.OptionElement.
    Do you know where yours is coming from?
    I have been hacking at this for 3 days, and have submitted to
    [email protected] as well. I still cannot figure out why this happens. The
    really strange thing is, it WORKS on Windows NT.
    Please respond, maybe we can help each other solve this problem.
    Thanks
    Steve Rogers
    [email protected]
    "Ravi Kumar.T" <[email protected]> wrote in message
    news:[email protected]...
    We are using Weblogic 5.1 (no service pack installd) on SUN Solaris.
    Suddenly weblogic server was down & in log file
    we found the "SIGBUS 10 bus error" & "Inconsistent thread : best efforts
    attempt (may fail)" errors (see below for full errors in log file).
    We have executeThreadCount=100 in properties file.
    Is it known problem/bug with solaris?
    thanks,
    -ravi
    Tue Jun 06 15:30:55 PDT 2000:<E> <ServletContext-General> Cannot find
    resource 'javascript/stub.rmf' in document root
    '/qa/weblogic/p4root/website/htdocs-portal'
    SIGBUS 10 bus error
    si_signo [10]: BUS
    si_errno [0]:
    si_code [1]: BUS_ADRALN [addr: 0xd81eb71d]
    stackpointer=C99D0D80
    Inconsistent thread : best efforts attempt (may fail)
    "Thread-36" (TID:0x4e92320, sys_thread_t:0x4e92258, state:CW, thread_t:
    t@202, threadID:0xc8ae1dd8, stack_bottom:0xc8ae2000, stack_size:0x20000)
    prio=5
    [1] java.lang.Object.wait(Object.java:424)
    [2] javax.mail.EventQueue.dequeue(EventQueue.java:73)
    [3] javax.mail.EventQueue.run(EventQueue.java:93)
    [4] java.lang.Thread.run(Thread.java:478)
    Inconsistent thread : best efforts attempt (may fail)
    "SeedGenerator Thread" (TID:0x4994508, sys_thread_t:0x4994440, state:CW,
    thread_t: t@118, threadID:0xc8ab1dd8, stack_bottom:0xc8ab2000,
    stack_size:0x20000) prio=1
    [1] java.lang.Object.wait(Object.java:424)
    [2] sun.security.provider.SeedGenerator.run(SeedGenerator.java:107)
    [3] java.lang.Thread.run(Thread.java:479)
    Inconsistent thread : best efforts attempt (may fail)
    "SSLListenThread" (TID:0x4381688, sys_thread_t:0x43815c0, state:R,thread_t:
    t@114, threadID:0xc8b41dd8, stack_bottom:0xc8b42000, stack_size:0x20000)
    prio=5
    [1] java.net.PlainSocketImpl.socketAccept(Native Method)
    [2] java.net.PlainSocketImpl.accept(PlainSocketImpl.java:406)
    [3] java.net.ServerSocket.implAccept(ServerSocket.java:238)
    [4] java.net.ServerSocket.accept(ServerSocket.java:223)
    [5]
    weblogic.security.SSL.SSLServerSocket.acceptNoHandshake(SSLServerSocket.java
    :121)
    [6]weblogic.security.SSL.SSLServerSocket.accept(SSLServerSocket.java:112)
    [7] weblogic.t3.srvr.ListenThread.run(ListenThread.java:226)

  • System received a Bus Error exception

    Hello everbody,
    when i power off and power on again my  router, i did not start. it says the message like this:
    -Traceback= 0x4027754C 0x400886BC 0x4008CDE4 0x400BAA5C
    $0 : 00000000, AT : 42F60000, v0 : 00000303, v1 : BFA00000
    a0 : 00000303, a1 : 00000000, a2 : 00000000, a3 : 00000005
    t0 : 000F4240, t1 : 0000000B, t2 : 0000000B, t3 : FFFFFFFE
    t4 : 4AB8C413, t5 : 00000000, t6 : 43130000, t7 : 4AB8C029
    s0 : 43137F24, s1 : 00000006, s2 : 00000000, s3 : 00000000
    s4 : 438FACE0, s5 : 42F40000, s6 : BEEFBACC, s7 : 00000000
    t8 : BFA00000, t9 : 00000003, k0 : 00000020, k1 : 00000000
    gp : 42F600E0, sp : 438FAC68, s8 : 43974F28, ra : 40277540
    EPC  : 4027754C, ErrorEPC : BFCC0E8C, SREG     : 34008003
    MDLO : 000003E8, MDHI     : 00000000, BadVaddr : 00000110
    DATA_START : 0x419E4B00
    Cause 0000000C (Code 0x3): TLB (store) exception
    -Traceback= 0x4027754C 0x400886BC 0x4008CDE4 0x400BAA5C
    No warm reboot Storage
    *** System received a Bus Error exception ***
    signal= 0xa, code= 0xc, context= 0x4313c01c
    PC = 0x4008d45c, Cause = 0x20, Status Reg = 0x34008002
    i need help urgently, what should i do. thanks in advance

    Thanks Leo for help,
    my router model is 2811. Do you have any information/document to fix the hardware failure.
    what should i do.

Maybe you are looking for

  • Database Schema from database

    I need a little help. I am trying to import a mySQL database to a schema in JDeveloper 10.1.3. I keep getting an error about varchar cannot have parameters. Can somebody shed some light on this issue? Thanks, Alley Davis Dragon Creative Works

  • Nokia Lumia mp4 videos files

    Ive just transferred my micro sd card out of my Samsung tocco lite into my Nokia lumia 520 windows phone, the 520 will not play the MP4 video files on the sd card that I shot on the samsung and comes up with the error code c00d5212,the resolution of

  • Commitment carry forward

    hi gurus we just entered a new fiscal year and when we try to change orders created in the old fiscal year we get an error saying "Old FM line items 0010124941/00001 could not be found'. please advice.

  • IPad 2 gives an error message when sync'ing to iTunes on iMac

    The iMac where iTunes sits gives an error message that the iPad is sync'd to another iTunes library "do you want to erase and sync?" we can get rid of the error message saying "cancel" but it still won't sync and the screen is on all night with this

  • Photoshop CS5 - why does dragging cropped paper to layout causes it to expand to fill entire layout?

    I'm hoping someone can help me out.  I create a 12in x 12in layout for a scrappage to work on. I open up a pattern paper and crop it to 9in x 9 in. MOVE the cropped paper to my layout. The cropped paper expands to fill my 12x12 in layout.  It doesn't