accept strace block

Bug #1130512 reported by tony
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netkit-ftp (Ubuntu)
New
Undecided
Unassigned

Bug Description

I used ftp (netkit-ftp-0.17) to get some files when prompt was on, the block happened.
BTW. The ftp server is 3CDeamon Version2.0 Revision10

----
local: test1.css remote: test1.css
200 PORT command successful.
150 File status OK ; about to open data connection
(#block happened. here is wating...)
----

i used strace command to find out the reason.
the block happened when socket accepted.
---
write(3, "RETR test1.css\r\n", 24) = 24
rt_sigaction(SIGINT, {0x805630f, [INT], SA_RESTART}, {0x805630f, [INT], SA_RESTART}, 8) = 0
read(3, "150 File status OK ; about to op"..., 1024) = 52
write(1, "150 File status OK ; about to op"..., 51) = 51
rt_sigaction(SIGINT, {0x805630f, [INT], SA_RESTART}, {0x805630f, [INT], SA_RESTART}, 8) = 0
rt_sigaction(SIGINT, {0x8057fdd, [INT], SA_RESTART}, {0x805630f, [INT], SA_RESTART}, 8) = 0
accept(5,
(#wating...)
----

the source is below:
------
static FILE *
dataconn(const char *lmode)
{
 struct sockaddr_in from;
 int s, tos;
 socklen_t fromlen = sizeof(from);

                      if (passivemode)
                      return (fdopen(data, lmode));

 s = accept(data, (struct sockaddr *) &from, &fromlen); --> (here is the problem which block happen.)
 if (s < 0) {
  perror("ftp: accept");
  (void) close(data), data = -1;
  return (NULL);
 }
 (void) close(data);
 data = s;
#ifdef IP_TOS
 tos = IPTOS_THROUGHPUT;
 if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)
  perror("ftp: setsockopt TOS (ignored)");
#endif
 return (fdopen(data, lmode));
}

------

i search the internet , and found accept will block the process.
is it a bug? i don't kown how to deal with it.
can somebody give me a hand to solve it???
thank you.

tony (amoshen)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.