[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Compiler/linker oddness?



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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []