Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: pchapman@fury.bio.dfo.ca
To: axp-list@redhat.com
Subject: Compiler/linker oddness?
Date: Thu, 2 Mar 2000 11:58:09 -0400 (AST)	[thread overview]
Message-ID: <200003021558.LAA18287@fury.bio.dfo.ca> (raw)

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



             reply	other threads:[~2000-03-02 16:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-02 15:58 pchapman [this message]
2000-03-06 15:14 ` Compiler/linker oddness? pchapman
2000-03-06 17:40   ` W Bauske
2000-03-07 16:24     ` pchapman
2000-03-08  2:39     ` Richard Henderson
2000-03-08 20:28       ` W Bauske
2000-03-09 17:38         ` Richard Henderson
2000-03-08 21:15       ` linker works [Was: Re: Compiler/linker oddness?] Andrei A. Dergatchev
2000-03-10  2:47         ` Richard Henderson
2000-03-11  3:05           ` Jeffrey Sturm
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox