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

20010328: nwx



>From: 10 <address@hidden>
>Organization: UCAR/Unidata
>Keywords: 200103281509.f2SF9ZL07014

>I notcied two more problems with nwx on Solaris SPARC.  Printing
>still does not work even after I uploaded your binary (my printer
>table file is correct) and NWX core dumps when you try to display
>SPC/Current Svr Tstm Torn Watches.
>
>Thanks,
>Robert Mullenax
>
>


Robert,

I did find on our solaris machine here that the print file that nwx created
ad called the print command with was deleted before the print spooler could
read it.

I have updated Gemenviron for:
setenv LP "lp -c"

This will copy the data file to the spool area so that the program does not
delete the file prematurely.


Also looking at the SPC dump problem, I believe that the problem is due to
large arrays being used witch exceed your stacksize. You might check your 
limits.

Here is a fix for $NAWIPS/nwx/source/nwx/fosd.c which mallocs the space
rather than allocates it as an array. In routine fosd_wbox(),
change reparr to an array of pointers and malloc/free as needed:

/*
        char            reparr[MAX_WATCHES][REPMAX];
*/
        static char     *reparr[MAX_WATCHES];

/*---------------------------------------------------------------------*/

        for(i=0;i<MAX_WATCHES;i++) reparr[i] = NULL;

        iret = 0;

        srchInfo.sflag = 0;
        srchInfo.srchstr[0] = '\0';

        nw = 0;

        while ( iret == 0 )  {
            fosd_getdata ( (nwxTable->dtyp_info), &srchInfo,
                           reportText, &iret);

            if  ( iret == 0 )  {
                reparr[nw] = (char *)malloc(REPMAX);
                strcpy ( reparr[nw], reportText );

                srchInfo.sflag = -1;
                nw++;
            }

        }

        numwtch = 0;

        for ( i = nw-1; i >= 0; i-- )  {

            wbox_decode ( reparr[i], numwtch, &plotData );
            strcpy ( wtchText[numwtch], reparr[i] );
            free(reparr[i]);

            numwtch++;

        }


Steve Chiswell