EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: FW: CA Server doesn't work on Linux/Intel ??
From: [email protected] (Jeff Hill)
To: "EPICS-tech-talk (E-mail)" <[email protected]>
Date: Thu, 5 Nov 1998 16:11:33 -0700
-----Original Message-----
From:	Guy Jennings [SMTP:[email protected]]
Sent:	Monday, November 02, 1998 3:18 PM
To:	Jeff Hill
Subject:	Re: CA Server doesn't work on Linux/Intel ??

Jeff,

Good news!!!   Following your analysis of the problem with the ca server
on Intel Linux I have been able to isolate the problem to a small
section of code.   It appears to be a bug in the Linux kernel, and by
upgrading to the latest 'experimental' kernel the problem is fixed.

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

int main (int argc, char** argv)
{
  struct sockaddr_in saddr;
  int yes = 1;
  int ssize;

  int s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);

  memset((void *)&saddr, 0, sizeof(saddr));

  saddr.sin_family = AF_INET;
  saddr.sin_port = 5064;
  saddr.sin_addr.s_addr = 0;
  bind (s, (struct sockaddr*) &saddr, sizeof(saddr));
  printf ("%-0.8x\n", saddr.sin_addr.s_addr);

  ssize = sizeof(saddr);
  getsockname(s, (struct sockaddr*) &saddr, &ssize);

  printf ("%-0.8x\n", saddr.sin_addr.s_addr);
}

On the Intel linux (kernel 2.0.34) the above program prints out:
00000000
0100007f

but on PPC & 68K (kernel >= 2.1.106) I get
00000000
00000000

After upgrading the linux kernel to 2.1.126 I get
00000000
00000000

I'm not sure exactly which call is at fault, maybe the 'bind'? but the
server seems to work fine now.

Many thanks for pointing me in the right direction,

Guy Jennings


Navigate by Date:
Prev: more error msg S_iosLib_TOO_MANY_OPEN_FILES Dale L. Brewe
Next: RE: Frame grabber and Portable channel access Jeff Hill
Index: 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: CA Server doesn't work on Linux/Intel ?? Jeff Hill
Next: tcl/tk interface to ca server, anyone? Guy Jennings
Index: 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·