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

RE: LDM 5.0.8 and pqing segmentation fault. (fwd)




===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================

---------- Forwarded message ----------
Date: Tue, 7 Dec 1999 15:46:01 -0500
From: Dan Vietor <address@hidden>
To: 'Robb Kambic' <address@hidden>,
     'Michael W Dross' <address@hidden>
Subject: RE: LDM 5.0.8 and pqing segmentation fault.

> Currently a define flag needs to be set in the LDM compile for the P
> option to be available. This can be done by:
>
> % setenv CC "cc -DNET"
>
> Then build the LDM from a clean distribution or one will get old
> configuration type problems.

When I compile 5.0.8, the NET option seemed to be there by default.
This enabled -P use.

The seg fault comes from modifying a const integer.  In pqing.c, around
line 408:

   *((int *)&server_port) = atoi(optarg); /* cast away const */

This causes a core dump on Linux and I believe Intel Solaris as well.
The const declaration of server_port appears to be the culprit.  If you
remove the const declarator in feed.h/feed.c, the code runs:

extern int server_port; /* global in feed.h */

int server_port = 0; /* set in main in feed.c */

> I noticed in the man page for pqing that the P option was no longer
> available. I don't know what this means, it appears the code is still
> included in pqing.c but does it work?

It appeared the man pages were rather old (dated 1996) and the -P option
wasn't there.  When you make these changes, the -P option for reading
from a socket works great.

________________________________________________________
Daniel Vietor               Mail: address@hidden
Unisys Corp                 Title: Engineer/Meteorologist
221 Gale Lane               Phone: 610-444-2407
Kennett Square PA 19348     Fax: 610-444-2420