From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 25673 invoked from network); 2 Mar 2000 16:20:38 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Mar 2000 16:20:38 -0000 Received: from turbot.dfo.ca (cod.mar.dfo-mpo.gc.ca [142.176.61.253]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id LAA08084 for ; Thu, 2 Mar 2000 11:20:37 -0500 From: pchapman@fury.bio.dfo.ca Received: id MAA11349; Thu, 2 Mar 2000 12:03:31 -0400 Received: by gateway id LAA18287 for ; Thu, 2 Mar 2000 11:58:09 -0400 Message-Id: <200003021558.LAA18287@fury.bio.dfo.ca> Date: Thu, 2 Mar 2000 11:58:09 -0400 (AST) Subject: Compiler/linker oddness? To: axp-list@redhat.com MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Hi, I'm building a big-and-ugly piece of software and have come across an odd problem. Here's the story: I finally got the thing to compile yesterday, and it cored immediately on execution. No surprises there; I wasn't expecting it to work properly first time around. I aimed ladebug at it, and discovered to my surprise that it's coring in XtVaAppInitialize(), which is the first line of the program that really does anything: -------- main(int argc, char *argv[]) { Arg args[20]; Display *display; int i,j, screen_num, rside, status; unsigned int scr_width, scr_height; Dimension h1,h2,h3; XtIntervalId Id; Widget wForm, wMenuBar; printf("Starting xscan..\n"); fflush(stdout); /*------------- Special SGI : permet de mettre RECL en byte ----*/ #ifdef _OldRecl f77vms_flag_[OLD_RL] = 1; #endif /*------------- Special SGI : permet de mettre RECL en byte ----*/ StrCurrentProcessing=(char *)malloc(200*sizeof(char)); if (StrCurrentProcessing == NULL ) { printf("Erreur Allocation de StrCurrentProcessing\n"); } gZoomSelect=False; gwOldRadio=NULL; /*------------------------- create the top widget ----------------------*/ gwTop = XtVaAppInitialize (&app_context, "xscan.rc", NULL , (Cardinal)0, &argc, (String *)argv, (String *)fallback_resources, NULL); (etc) -------- Cutting and pasting this into a new file (and adding the globals that aren't declared in this snippet) results in something that compiles and runs without error. Ladebug shows all of the arguments to XtVaAppInitialize to be sensible. Changing optimization and compiler (gcc <--> ccc) doesn't make any difference to either. I can only assume that I've found a linker or loader bug. The program is quite big (binary is ~3 megs), and is a combination of Fortran 90 and C. I've been using the Compaq fortran compiler for the fortran and switching between gcc and ccc for the C. It dies long before it gets to any fortran, though. The build process also creates some libraries along the way (using ar cq), which are then linked into the final program. I'm running Red Hat 6.1 on a 164UX system, egcs-2.91.66 and the latest compilers from Compaq. Has anyone seen any behaviour like this before? Any help would be greatly appreciated! Thanks, -Paul Chapman pchapman@fury.bio.dfo.ca