Errno 25 ENOTTY then SIGSEGV, socket on accept call? Help.

Errno 25 ENOTTY then SIGSEGV, socket on accept call? Help.

Post by Lee Trac » Sat, 05 Jul 2003 00:19:36



Hi All,
I have been scouring newsgroups for ages now trying to find a solution
to my problem. Have to resort to posting the question:
I am writing a basic server/multiple client program primarily in c,
utilising TCP sockets (all necessary code below - except some of the
client code).
The problem I have is that the server SIGSEGV's when "accept()" is
called.
I notice that errno is -1 into accept() and 25 out of it.
This is the first time I have attempted this, It was working
temperementally before, but now not at all. It always collapses.
I noticed that it used to only fall when a "job" was launched on
certain machines, from certain machines. But now all the time.

Can anyone spot what the problem is?

Sorry for the large amount of code, I felt is was best to post all of
it, for completeness...

Thanks Lee Tracey. All help much appreciated.

==============================================================================
Some code notes:
1) 61ci27nvrun_sections_ is the starting point, with all arguments OK.
2) Although 61ci27nvreset_ is run prior to this to open a socket and
set
   re-usability
3) I've only included the server code here. The client calls
   61ci_get_active_socket()
   When connect in that routine, the server comes out of poll and goes
into
   accept where it seg violates and has errno 25 just before hand.
==============================================================================

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stropts.h>
#include <signal.h>
#include <poll.h>
#include <sys/select.h>
#include <61ci/buffer.h>

#define FALSE 0
#define TRUE 1
#define HOSTNAMELEN 20
#define MAXMACHINES 64
#define MAXJOBS 100

#define min(A,B) ( (A) < (B) ? (A) : (B) )
#define max(A,B) ( (A) > (B) ? (A) : (B) )
#define MAXMSGLEN 10008

extern void (**jb56_signal_handlers) ( int );
static char wait_flag = FALSE;

struct pollfd fds[MAXMACHINES+1];
int jobstatus[MAXJOBS], jobsection[MAXJOBS], jobhost[MAXJOBS],
jobpid[MAXJOBS];
int numjobs, numhosts;
unsigned short int 30cs_port;
int 30cs_sock;
char remhostname[MAXMACHINES][HOSTNAMELEN];
char *solver[] = {"27nv","Q253"};
int hoststatus[MAXMACHINES];

/*        Controlling integers definition          */
/* jobstatus      : one for each job needed to run */
/*                : 0= no job                      */
/*                : 1= awaiting run                */
/*                : 1= job launched                */
/*                : 3= connected to remote machne  */
/*                : 4= completed                   */
/*                : 5= error                       */
/* jobsection     : the stream section number that */
/*                  is being run                   */
/* jobhost        : the host no. job is running on */
/* numjobs        : the unmber of jobs in total    */
/* numhosts       : the number of hosts in total   */
/* remhostname    : array of remote host names     */
/* hoststatus     : array of status's for hosts    */
/*                : 0= no machine available        */
/*                : 1= available                   */
/*                : 2= in use                      */

#define JOBNONE 0
#define JOBAWAITING 1
#define JOBLAUNCHED 2
#define JOBCONNECTED 3
#define JOBCOMPLETED 4
#define JOBERROR 5

#define HOSTNOTAVAIL 0
#define HOSTAVAIL 1
#define HOSTINUSE 2

void 61ci27nvloadprog ( int , int , int *, int * );
void 61ci27nvtidy ( void );

void 61ci27nvreset_ ( int *iret )
{
  int i, i_reuse_addr;
  const char reuse_addr='1';

  for (i=0; i<=MAXMACHINES; i++)
    {
      strcpy(remhostname[i], "");
      hoststatus[i] = HOSTNOTAVAIL;
    }
  for (i=0; i<=MAXJOBS; i++)
    {
      jobstatus[i] = JOBNONE;
      jobpid[i] = 0;
    }
  numhosts=0;
  numjobs=0;

  /* Open a socket here... */
  if ( 61ci_get_passive_socket ( &30cs_port, &30cs_sock ) < 0 ){
    *iret = 999;
    return;
  }
  /* Set up socket so we can re-bind to it without TIME_WAIT problems
*/
  setsockopt (30cs_sock, SOL_SOCKET, SO_REUSEADDR, &reuse_addr,
sizeof(reuse_addr));

}

int 61ci27nvgetnumavail ( void )
{
  int i,n;
  for (i=0,n=0; i<=MAXMACHINES; i++)
    if (hoststatus[i]==HOSTAVAIL) n++;
  return(n);

}

int 61ci27nvgetnumok ( void )
{
  int i,n;
  for (i=0,n=0; i<=MAXMACHINES; i++)
    if (hoststatus[i]==HOSTAVAIL || hoststatus[i]==HOSTINUSE) n++;
  return(n);

}

int 61ci27nvjobsongo ( void )
{
  int numjobsongo, i;
  numjobsongo = 0;
  for (i=0; i<=MAXJOBS; i++)
    {
      if (jobstatus[i]==JOBCONNECTED || jobstatus[i]==JOBLAUNCHED)
        numjobsongo++;
    }
  return(numjobsongo);

}

int 61ci27nvgetmachine ( int last )
{
  int i;
  for(i=last; i<=MAXMACHINES; i++)
    if (hoststatus[i]==HOSTAVAIL)
      return(i);
  return(-1);

}

int 61ci27nvgetnextjob( void )
{
  int i;
  for (i=0; i<=MAXJOBS; i++)
    if (jobstatus[i]==JOBAWAITING)
      return(i);
  return(-1);

}

void 61ci27nv_kill_job( i )
{
  int cmdlen;
  char *cmdlin;

  if (jobstatus[i] == JOBCONNECTED && jobpid[i] > 0)
    /* can only do this for "connected" m/c's as   */
    /* I don't have PID for "launched machines yet */
    {
      cmdlen = strlen(remhostname[jobhost[i]])+21;
      cmdlin = (char *) calloc ( (size_t) cmdlen, sizeof(char));
      sprintf ( cmdlin, "/bin/rsh %s \"kill -9 %i\"",
remhostname[jobhost[i]], jobpid[i] );
      printf("Killing stream section %i on %s\n", jobsection[i],
remhostname[jobhost[i]]);
      system(cmdlin);
      free(cmdlin);
      jobstatus[i] = JOBNONE;
      close(fds[i].fd);
      fds[i].fd=0;
    }

}

void 61ci27nvkill_remaining_jobs( void )
{
  int i, cmdlen;
  /* Loop through jobs being processed and kill them off */
  for (i=0; i<MAXJOBS; i++)
    {
      if (jobstatus[i] == JOBCONNECTED) /* can only do this for
"connected" m/c's as   */
                                        /* I don't have PID for "launched machines yet */
        61ci27nv_kill_job( i );
    }
  61ci27nvtidy();

}

void 61ci27nvtidy( void )
{
  /* close socket here */
  close(30cs_sock);

}

void 61ci27nvrun_sections_ (int *ind,int *nob,int *sec,int *n1s,int
*geom,
                            int *n1g,int *aero, int *n1a,int *n2a,int *bc,
                            int *n1b,int *prof,int *n1p,int *n2p,int *npttotarr,
                            int *nptprarr,int *intSolver,int *iret)
{
  int timeout, pollval, errno, i, length, iLoop, 61ciloop;
  int 61ci_buflen, bufpart, ierroccurred,numhostok,irun;
  int numhostavail,nextjob,intmachine,last,j,ishutdown,numjobsongo;
  char *commbuf;
  struct sockaddr_in server;

  /* loop until all jobs are completed or we run out of machines due
to errors or timeouts! */
  for (iLoop=TRUE; iLoop;){
    /* ========= LAUNCHING LOOP ========= */    
    /* ========= LAUNCHING LOOP ========= */    
    /* ========= LAUNCHING LOOP ========= */    

    /* Get number of machines available */
    numhostavail = 61ci27nvgetnumavail();
    numhostok = 61ci27nvgetnumok();
    if (numhostok<=0)
      {
        printf("There are no hosts available to run any jobs because of
previous errors. Exiting.\n");
        *iret = 999;
        break;
      }
    /* Run appropriate number of sections */
    for (i=0; i<min(numhostavail,numjobs); i++)
      {
        last = 0;
        intmachine = 61ci27nvgetmachine ( last );
        if (intmachine==-1)
            break;
        nextjob = 61ci27nvgetnextjob();
        if (nextjob==-1)
            break;
        printf("Launching %s, stream section %i on %s...",
solver[*intSolver-1], jobsection[nextjob],
               remhostname[intmachine]);
        irun=2;

        j=nextjob+1,61ci27nvsetdata_( &irun,ind,&j,nob,sec,n1s,geom,
                         n1g,aero,n1a,n2a,bc,n1b,&numjobs,prof,n1p,n2p,npttotarr,nptprarr,iret);
        61ci27nvloadprog( nextjob,intmachine,ind,iret );
        if (*iret == 0)
          printf("launched.\n");
        else
          {
            printf("failed. re-queueing.\n");
            *iret=0;
            /* remove machine from list and reset job status */
            hoststatus[intmachine] = HOSTNOTAVAIL;
            jobstatus[nextjob] = JOBAWAITING;
            61ci_delete_bl_files_( &j, ind );
          }
      }

    /* Get out of infinite loop now */
    if (61ci27nvjobsongo()>0)
      {
        /* ========= WAIT FOR RESPONSE ========= */    
        /* ========= WAIT FOR RESPONSE ========= */    
        /* ========= WAIT FOR RESPONSE ========= */    
        timeout = 5*60*1000;  /* 5 minutes */
        pollval = poll ( fds, (unsigned long) MAXMACHINES, timeout );

        *iret=999;
        if ( pollval < 0 ) {
          printf("Error %i while waiting for response. Exiting.\n",errno);
          iLoop=FALSE;
          61ci27nvkill_remaining_jobs();
          return;
        }
        else if ( pollval == 0 ){
          printf("Connection timed out, no response for %d seconds.
Exiting.\n",timeout/1000);
          iLoop=FALSE;
          61ci27nvkill_remaining_jobs();
          return;
        }
        else {
          *iret=0;
          /* loop through the revents and determines which processe(s) have
returned stuff */
          for (i=0; i<MAXMACHINES; i++)
            {
              ierroccurred = 0;
              if ((fds[i].revents & POLLERR) || (fds[i].revents & POLLHUP))
                {
                  /* there was an error: handle this */
                  printf("Section %i terminated => re-queing\n",jobsection[i]);
                  jobstatus[i] = JOBAWAITING; /* Set status to re-queue */
                  hoststatus[jobhost[i]] = HOSTNOTAVAIL;
                }
              else
                {
                  if (fds[i].revents != 0){
                    /* recieve data from 27nv */

                    61ci_buflen = 61ci27nv_recv( fds[i].fd, &ierroccurred );
                    if ( ierroccurred != 0 )
                      {
                        61ci27nv_kill_job( i );
                        fds[i].fd=0;
                        ierroccurred = 1;
                        jobstatus[i] = JOBAWAITING; /* Set status to re-queue */  
                        hoststatus[jobhost[i]] = HOSTNOTAVAIL;
                      }
                    else
                      {
                        /* check sum */
                        if (61ci_buflen != 61ci_27nvbuf_.buffer[0].d){
                          jobstatus[i] = JOBAWAITING; /* Set status to re-queue */
                          hoststatus[jobhost[i]] = HOSTNOTAVAIL;
                          printf("Checksum error with data from stream section %i -
re-queing.\n",
                                 jobsection[i]);
                          /* close socket connection here */
                          fds[i].fd=0;
                        }
                        commbuf = &61ci_27nvbuf_.buffer[1].c;
                        if ( (j=strncmp(commbuf,"OK",2))==0)
                          {
                            printf("Stream section %i confirmed
...

read more »

 
 
 

Errno 25 ENOTTY then SIGSEGV, socket on accept call? Help.

Post by Lee Trac » Sat, 05 Jul 2003 16:58:13


Oh yes, forgot to say: I'm running only 1 "server" process via a Sun
Ultra 30 on sun4_SunOS_5.5.1 .

Thanks again for any tips you people might have.

Lee Tracey

 
 
 

Errno 25 ENOTTY then SIGSEGV, socket on accept call? Help.

Post by Jens.Toerr.. » Sat, 05 Jul 2003 19:32:51



> The problem I have is that the server SIGSEGV's when "accept()" is
> called.
> I notice that errno is -1 into accept() and 25 out of it.

How do you check errno after calling accept() when the call of
accept() is segfaulting?

Quote:> This is the first time I have attempted this, It was working
> Sorry for the large amount of code, I felt is was best to post all of
> it, for completeness...

Your chances of getting helpful answers would be much higher if you
would trim your program to the smallest version that still exhibits
the problem (you might even find the cause of the segfault yourself
in the process).

I didn't want to wade through 800 lines of strangly formatted code,
so instead I just checked the places where you do memory allocation
and found that in both cases you have some problems which might or
might not be the reason for the segfault you get (SIGSEGVs usually
being related to these kinds of problems).

And please post compiable programs. Your program contains several
invalid variable and function names. They never may start with a
digit, only letters (and possibly also an underscore, but you better
avoid this in order not to invade the implemantations namespace).

Quote:> unsigned short int 30cs_port;
> int 30cs_sock;

What's that? That are never a valid variable names. How did you manage
to get the compiler not to give up immediately at these lines?

Quote:> void 61ci27nv_kill_job( i )

Invalid function name. Your compiler should tell you so.

Quote:> {
>   int cmdlen;
>   char *cmdlin;
>   if (jobstatus[i] == JOBCONNECTED && jobpid[i] > 0)
>     /* can only do this for "connected" m/c's as   */
>     /* I don't have PID for "launched machines yet */
>     {
>       cmdlen = strlen(remhostname[jobhost[i]])+21;
>       cmdlin = (char *) calloc ( (size_t) cmdlen, sizeof(char));
>       sprintf ( cmdlin, "/bin/rsh %s \"kill -9 %i\"",
> remhostname[jobhost[i]], jobpid[i] );

Undefined behavior: you probably didn't allocate enough memory
for cmdlin, forgetting that the PID also requires some space in
the string. BTW, casting the return value of malloc(), calloc()
etc. isn't recommended - you don't win anything doing it but
just keep the compiler from complaining if you forgot to include
<stdlib.h>. And sizeof(char) is 1 per defitionem. Should you try
to stay on the save side in case you ever should switch to e.g.
wide chars then use something like "sizeof *cmdlin" instead.

Quote:> void 61ci27nvloadprog ( int job, int inthost, int *index, int *iret )
> {
>    int cmdlen,i,timeout,flag,nc;
>    char *hostname,*cmdlin,*cwd;
>    char runsh1[] = "/bin/rsh "; /* add remote host here */
>    char runsh2[] = " \"setenv BLAY_PORT "; /* Add hostname_portnumber
> here */
>    char runsh3[] = " ; cd ";
>    char runsh4[] = " ; ";
>    char runsh5[] = "sun4_SunOS_5.5.1/bin/blay_load \" > /dev/null 2>
> /dev/null &";
>    char pluginname[] = "JB56";
>    char pluginpath[501] = "";

>    if (*iret!=0)
>      return;

>    /* set up environment var to xfer port number and hostname of this
> m/c */
>    hostname = (char *) calloc ( (size_t) HOSTNAMELEN, sizeof(char));
>    cwd = getcwd(NULL,64);

Calling getcwd() with a NULL pointer as the first argument is an
extension that is only supported on some implementations and thus
should be avoided for sake of portability. And if you use it you
have to deallocate the memory the function has allocated for you
or you create a memory leak.

Quote:>    gethostname ( hostname, (size_t) HOSTNAMELEN );

If the host name is longer than HOSTNAMELEN it's unspecified if the
returned name is null-terminated. If it isn't 'hostname' isn't some-
thing that you can use as a string (as you do later in your program).
And you allow only 20 chars for HOSTNAMELEN which might be too short.
Why don't you use HOST_NAME_MAX + 1, which is guaranteed to be the
longest string required for a hostname (HOST_NAME_MAX can be determined
via the sysconf() function)?

Quote:>    cmdlen = strlen(runsh1)+strlen(runsh2)+strlen(runsh3)+strlen(runsh4)+strlen(runsh5)+strlen(hostname)+
>      strlen(remhostname[inthost])+5+strlen(cwd);
>    cmdlin = (char *) calloc ( (size_t) cmdlen, sizeof(char));
>    if ( (30cs_port<=0) || (strlen(remhostname[inthost]) <= 0) ) {
>      *iret = 997;
>      return;
>    }
>    jw16_get_path_of_plugin_(pluginpath, pluginname, iret, 500, 4);
>    sczi3_(pluginpath, &nc, 500);
>    pluginpath[nc]=(char)0;
>    sprintf ( cmdlin, "%s%s%s%s_%04d%s%s%s%s%s", runsh1,
> remhostname[inthost], runsh2,
>         hostname, 30cs_port, runsh3, cwd, runsh4, pluginpath, runsh5 );

Again you probably don't allocate enough memory for cmdlin, so everything
can happen after this statement has been executed.

Quote:> int 61ci_get_passive_socket ( unsigned short int *port, int *sock )
> int 61ci_wait_connect ( int sock, int timeout )
> int 61ci_get_active_socket ( unsigned short int port, char *hostname,

Invalid function names. No self-respecting C compiler will accept them.

                                    Regards, Jens
--
      _  _____  _____

  _  | |  | |    | |
 | |_| |  | |    | |          http://www.physik.fu-berlin.de/~toerring
  \___/ens|_|homs|_|oerring

 
 
 

Errno 25 ENOTTY then SIGSEGV, socket on accept call? Help.

Post by Lee Trac » Sat, 05 Jul 2003 22:49:33


Jens.
I owe you a very big thank you. You spurred a point of enquiry based
on something I read earlier on in the day. The variable cmdlen was too
short as you suggested.
Regarding the variable/function names; I had to change them from what
they really are when posting to the public (the nature of my
employers' business), and apologise about that. I've posted some
comments about your questions below.
And another thank you.

Best regards
Lee Tracey



> > The problem I have is that the server SIGSEGV's when "accept()" is
> > called.
> > I notice that errno is -1 into accept() and 25 out of it.

> How do you check errno after calling accept() when the call of
> accept() is segfaulting?

I had attached with workshop/dbk and was able to view any variable at
segmentation time.

Quote:

> > This is the first time I have attempted this, It was working
> > Sorry for the large amount of code, I felt is was best to post all of
> > it, for completeness...

> Your chances of getting helpful answers would be much higher if you
> would trim your program to the smallest version that still exhibits
> the problem (you might even find the cause of the segfault yourself
> in the process).

> I didn't want to wade through 800 lines of strangly formatted code,
> so instead I just checked the places where you do memory allocation
> and found that in both cases you have some problems which might or
> might not be the reason for the segfault you get (SIGSEGVs usually
> being related to these kinds of problems).

> And please post compiable programs. Your program contains several
> invalid variable and function names. They never may start with a
> digit, only letters (and possibly also an underscore, but you better
> avoid this in order not to invade the implemantations namespace).

> > unsigned short int 30cs_port;
> > int 30cs_sock;

> What's that? That are never a valid variable names. How did you manage
> to get the compiler not to give up immediately at these lines?

> > void 61ci27nv_kill_job( i )

> Invalid function name. Your compiler should tell you so.

> > {
> >   int cmdlen;
> >   char *cmdlin;

> >   if (jobstatus[i] == JOBCONNECTED && jobpid[i] > 0)
> >     /* can only do this for "connected" m/c's as   */
> >     /* I don't have PID for "launched machines yet */
> >     {
> >       cmdlen = strlen(remhostname[jobhost[i]])+21;
> >       cmdlin = (char *) calloc ( (size_t) cmdlen, sizeof(char));
> >       sprintf ( cmdlin, "/bin/rsh %s \"kill -9 %i\"",
> > remhostname[jobhost[i]], jobpid[i] );

> Undefined behavior: you probably didn't allocate enough memory
> for cmdlin, forgetting that the PID also requires some space in
> the string. BTW, casting the return value of malloc(), calloc()
> etc. isn't recommended - you don't win anything doing it but
> just keep the compiler from complaining if you forgot to include
> <stdlib.h>. And sizeof(char) is 1 per defitionem. Should you try
> to stay on the save side in case you ever should switch to e.g.
> wide chars then use something like "sizeof *cmdlin" instead.

Thank you for pointing this out. I am recently new to c and will take
this advice on board.

- Show quoted text -

Quote:

> > void 61ci27nvloadprog ( int job, int inthost, int *index, int *iret )
> > {
> >    int cmdlen,i,timeout,flag,nc;
> >    char *hostname,*cmdlin,*cwd;

> >    char runsh1[] = "/bin/rsh "; /* add remote host here */
> >    char runsh2[] = " \"setenv BLAY_PORT "; /* Add hostname_portnumber
> > here */
> >    char runsh3[] = " ; cd ";
> >    char runsh4[] = " ; ";
> >    char runsh5[] = "sun4_SunOS_5.5.1/bin/blay_load \" > /dev/null 2>
> > /dev/null &";
> >    char pluginname[] = "JB56";
> >    char pluginpath[501] = "";

> >    if (*iret!=0)
> >      return;

> >    /* set up environment var to xfer port number and hostname of this
> > m/c */
> >    hostname = (char *) calloc ( (size_t) HOSTNAMELEN, sizeof(char));
> >    cwd = getcwd(NULL,64);

> Calling getcwd() with a NULL pointer as the first argument is an
> extension that is only supported on some implementations and thus
> should be avoided for sake of portability. And if you use it you
> have to deallocate the memory the function has allocated for you
> or you create a memory leak.

I was unaware it was implementation specific: I'll look into improving
this.

Quote:

> >    gethostname ( hostname, (size_t) HOSTNAMELEN );

> If the host name is longer than HOSTNAMELEN it's unspecified if the
> returned name is null-terminated. If it isn't 'hostname' isn't some-
> thing that you can use as a string (as you do later in your program).
> And you allow only 20 chars for HOSTNAMELEN which might be too short.
> Why don't you use HOST_NAME_MAX + 1, which is guaranteed to be the
> longest string required for a hostname (HOST_NAME_MAX can be determined
> via the sysconf() function)?

Again, well spotted.

- Show quoted text -

Quote:

> >    cmdlen = strlen(runsh1)+strlen(runsh2)+strlen(runsh3)+strlen(runsh4)+strlen(runsh5)+strlen(hostname)+
> >      strlen(remhostname[inthost])+5+strlen(cwd);
> >    cmdlin = (char *) calloc ( (size_t) cmdlen, sizeof(char));

> >    if ( (30cs_port<=0) || (strlen(remhostname[inthost]) <= 0) ) {
> >      *iret = 997;
> >      return;
> >    }
> >    jw16_get_path_of_plugin_(pluginpath, pluginname, iret, 500, 4);
> >    sczi3_(pluginpath, &nc, 500);
> >    pluginpath[nc]=(char)0;
> >    sprintf ( cmdlin, "%s%s%s%s_%04d%s%s%s%s%s", runsh1,
> > remhostname[inthost], runsh2,
> >            hostname, 30cs_port, runsh3, cwd, runsh4, pluginpath, runsh5 );

> Again you probably don't allocate enough memory for cmdlin, so everything
> can happen after this statement has been executed.

This is where the _real_ problem was. I owe you for mentioning this.

- Show quoted text -

Quote:

> > int 61ci_get_passive_socket ( unsigned short int *port, int *sock )
> > int 61ci_wait_connect ( int sock, int timeout )
> > int 61ci_get_active_socket ( unsigned short int port, char *hostname,

> Invalid function names. No self-respecting C compiler will accept them.

>                                     Regards, Jens

 
 
 

1. Solstice X.25 sockets calling a PAD host

Hi,

I've got the following problem with my application that uses the
Solstice X.25 9.1 socket interface to talk to a PAD host.

The initial connect() call works fine to the PAD host. The PAD host
then sends a specific PAD command back to my Solstice X.25 software
which is passed on through the sockets to my application.
This is wrong, the X.25 software should recognise it as PAD data and
treat it accordingly. In this case it should return an acknowledgement
to the PAD host and not sent the PAD data to my application...

Has anybody got experience with this kind of X.25
software/configuration??
What should I do to make my application which uses the socket
interface talk to a PAD host?

G'day and thanks,

Rene Oude Vrielink

2. L2TP and PPTP SW

3. x.25 socket and tcp/ip socket

4. filesystem layout with "newfs"

5. pico

6. Number of file in a directory. Is there a limit ?

7. Unexpected errno from socket call on SPARC 1000 server

8. (U) Failing sockets calls, bad errno with threads

9. sendmail not accepting connections on port 25?

10. Sendmail: accepting connect on port 25

11. EFAULT error in accept socket call