[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ldm-5.1.2beta1 and pqing segmentation fault.
- Subject: Re: ldm-5.1.2beta1 and pqing segmentation fault.
- Date: Wed, 16 Aug 2000 09:50:24 -0600 (MDT)
Mike,
Thanks for the reminder, I added the changes to the code.
Robb...
On Tue, 15 Aug 2000, Michael W Dross wrote:
>
>
> I compiled the ldm-5.1.2beta1 on our Linux machine which is feed via a socket
> connection from our NOAAPORT system and pqing would segmentation fault when
> you
> specify the '-P', socket connection parameter. We had the same problem under
> 5.0.8, thankfully Dan Vietor provided a fix. This fix also
> seems to work for ldm-5.1.2beta1. This problem also occurs with our AIX 4.3
> machine. Below is the fix Dan provided. Is this something
> that Unidata can work into the next ldm release?
>
> Thanks...
>
> Mike
>
> ----- Forwarded by Michael W Dross/Cust/DukePower on 08/15/00 06:25 PM -----
> |--------+----------------------->
> | | "Dan Vietor" |
> | | <address@hidden|
> | | ys.com> |
> | | |
> | | 12/07/99 |
> | | 03:46 PM |
> | | |
> |--------+----------------------->
>
> >----------------------------------------------------------------------------|
> |
> |
> | To: "'Robb Kambic'" <address@hidden>, Michael W |
> | Dross/Cust/DukePower@DukePower
> |
> | cc: address@hidden, "'support-ldm'" |
> | <address@hidden> |
> | bcc:
> |
> | 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
>
>
>
>
===============================================================================
Robb Kambic Unidata Program Center
Software Engineer III Univ. Corp for Atmospheric Research
address@hidden WWW: http://www.unidata.ucar.edu/
===============================================================================