* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") [not found] <3A5B0A59.1EB60A88@uow.edu.au> @ 2001-01-09 14:03 ` Paul Cassella 2001-01-11 16:45 ` Paul Cassella 0 siblings, 1 reply; 10+ messages in thread From: Paul Cassella @ 2001-01-09 14:03 UTC (permalink / raw) To: Andrew Morton, Andi Kleen; +Cc: linux-kernel, linux-net, David S. Miller On Tue, 9 Jan 2001, Andrew Morton wrote: > is this still reproducible? If so can I send you a debugging > patch to diagnose a bit further? Yes to both. If I get a patch in the next hour or so, I can have it running before I go to work. Otherwise I won't be able to try it until this evening. With the appended patch, I got these logged, and the application produces the expected error, all with the same timestamp: tcp.c:1165:tcp_sendmsg: err is unexpectedly -375. tcp.c:963:tcp_sendmsg: err is unexpectedly -375. tcp_sendmsg:991: copy = -375, mss_now = 512, skb->len = 887, skb_tailroom(skb) = 521, seglen = 37. The second message is misleading; err is not -375 at this point, copied is. I'm looking at how these were produced, and they seem to be in the opposite order that the code produces them? If you're trying to find these in an unpatched file, The first (line 1165 above) printk() is in the err = copied case of do_fault2. The second is in the if(err) goto do_fault2 check. The last is right after this in tcp_sendmsg. if(copy > seglen) copy = seglen; This is kind of frightening; the printk on line 991 is effectively inside if(mss_now - skb->len > 0) and mss_now seems to be less than skb->len when the printk happens. My copy of K&R is at work; could that comparison be being done unsigned because of skb->len? I wouldn't think so, but the alternative seems somewhat worse... Most of this patch is to tcp_sendmsg. diff -ru linux-2.4.0-ac3/net/ipv4/tcp.c linux-2.4.0-ac3-debugging/net/ipv4/tcp.c --- linux-2.4.0-ac3/net/ipv4/tcp.c Mon Jan 8 22:41:14 2001 +++ linux-2.4.0-ac3-debugging/net/ipv4/tcp.c Mon Jan 8 23:02:03 2001 @@ -451,6 +451,23 @@ #define TCP_PAGES(amt) (((amt)+TCP_MEM_QUANTUM-1)/TCP_MEM_QUANTUM) +#define CHECK_TCP_RET() check_tcp_ret(err, __FILE__, __LINE__, __FUNCTION__) + +void check_tcp_ret(int ret, char *file, int line, char *func) { + if(ret < 0) { + switch(-ret) { + case EAGAIN: case EBADF: case EPIPE: case ENOSPC: case EIO: case ECONNRESET: + case EINTR: case ETIMEDOUT: case EFAULT: case EINVAL: case EMSGSIZE: case ENOMEM: + case ENOBUFS: case ENOTCONN: case ECONNREFUSED: case ERESTARTSYS: case EHOSTUNREACH: + break; + + default: + printk(KERN_ERR "%s:%d:%s: err is unexpectedly %d.\n", file, line, func, ret); + } + } +} + + int tcp_mem_schedule(struct sock *sk, int size, int kind) { int amt = TCP_PAGES(size); @@ -883,6 +900,8 @@ } current->state = TASK_RUNNING; remove_wait_queue(sk->sleep, &wait); + if(timeo < 0) + printk(KERN_ERR "wait_for_tcp_memory: timeo == %ld\n", timeo); return timeo; } @@ -916,8 +935,10 @@ /* Wait for a connection to finish. */ if ((1 << sk->state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) - if((err = wait_for_tcp_connect(sk, flags, &timeo)) != 0) - goto out_unlock; + if((err = wait_for_tcp_connect(sk, flags, &timeo)) != 0) { + CHECK_TCP_RET(); + goto out_unlock; + } /* This should be in poll */ clear_bit(SOCK_ASYNC_NOSPACE, &sk->socket->flags); @@ -938,8 +959,11 @@ while (seglen > 0) { int copy, tmp, queue_it; - if (err) - goto do_fault2; + if (err) { + if(copied) check_tcp_ret(copied, __FILE__, __LINE__, __FUNCTION__); + else CHECK_TCP_RET(); + goto do_fault2; + } /* Stop on errors. */ if (sk->err) @@ -948,7 +972,7 @@ /* Make sure that we are established. */ if (sk->shutdown & SEND_SHUTDOWN) goto do_shutdown; - + /* Now we need to check if we have a half * built packet we can tack some data onto. */ @@ -964,6 +988,7 @@ copy = skb_tailroom(skb); if(copy > seglen) copy = seglen; + if(copy < 0) printk(KERN_ERR "tcp_sendmsg:%d: copy = %d, mss_now = %d, skb->len = %d, skb_tailroom(skb) = %d, seglen = %d.\n", __LINE__ copy, mss_now, skb->len, skb_tailroom(skb), seglen); if(last_byte_was_odd) { if(copy_from_user(skb_put(skb, copy), from, copy)) @@ -975,6 +1000,7 @@ csum_and_copy_from_user( from, skb_put(skb, copy), copy, skb->csum, &err); + CHECK_TCP_RET(); } /* * FIXME: the *_user functions should @@ -1042,6 +1068,7 @@ } if (signal_pending(current)) { err = sock_intr_errno(timeo); + CHECK_TCP_RET(); goto do_interrupted; } timeo = wait_for_tcp_memory(sk, timeo); @@ -1078,8 +1105,11 @@ skb->csum = csum_and_copy_from_user(from, skb_put(skb, copy), copy, 0, &err); - if (err) - goto do_fault; + if (err) { + if(copied) check_tcp_ret(copied, __FILE__, __LINE__, __FUNCTION__); + else CHECK_TCP_RET(); + goto do_fault; + } from += copy; copied += copy; @@ -1092,6 +1122,7 @@ } } err = copied; + CHECK_TCP_RET(); out: __tcp_push_pending_frames(sk, tp, mss_now, tp->nonagle); out_unlock: @@ -1100,14 +1131,20 @@ return err; do_sock_err: - if (copied) + if (copied) { err = copied; - else + CHECK_TCP_RET(); + + } else { err = sock_error(sk); + CHECK_TCP_RET(); + } goto out; do_shutdown: - if (copied) + if (copied) { err = copied; + CHECK_TCP_RET(); + } else { if (!(flags&MSG_NOSIGNAL)) send_sig(SIGPIPE, current, 0); @@ -1115,14 +1152,18 @@ } goto out; do_interrupted: - if (copied) + if (copied) { err = copied; + CHECK_TCP_RET(); + } goto out_unlock; do_fault: __kfree_skb(skb); do_fault2: - if (copied) + if (copied) { err = copied; + CHECK_TCP_RET(); + } else err = -EFAULT; goto out; @@ -1283,6 +1324,8 @@ remove_wait_queue(sk->sleep, &wait); __set_current_state(TASK_RUNNING); + if(timeo < 0) + printk(KERN_ERR "tcp_data_wait: timeo == %ld.\n", timeo); return timeo; } @@ -2026,8 +2069,10 @@ if (sk->state != TCP_LISTEN) break; err = sock_intr_errno(timeo); - if (signal_pending(current)) + if (signal_pending(current)) { + CHECK_TCP_RET(); break; + } err = -EAGAIN; if (!timeo) break; -- Paul Cassella - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") 2001-01-09 14:03 ` 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") Paul Cassella @ 2001-01-11 16:45 ` Paul Cassella 2001-01-11 17:18 ` David S. Miller 0 siblings, 1 reply; 10+ messages in thread From: Paul Cassella @ 2001-01-11 16:45 UTC (permalink / raw) To: Andrew Morton, Andi Kleen; +Cc: linux-kernel, linux-net, David S. Miller On Tue, 9 Jan 2001, Paul Cassella wrote: > and mss_now seems to be less than skb->len when the printk happens. My > copy of K&R is at work; could that comparison be being done unsigned > because of skb->len? I wouldn't think so, but the alternative seems > somewhat worse... That'll teach me to post about integral promotions ... > + printk(KERN_ERR "%s:%d:%s: err is unexpectedly %d.\n", file, line, func, ret); ... and hand-edit patches before breakfast. I'm not familiar enough with the tcp code to know if this patch (against -ac6) is a solution, band-aid, or, in fact, wrong, but I've run with it (on -ac3) and haven't seen the errors for over twelve hours, which is three times longer than it had been able to go without it coming up. --- tcp.c.orig Thu Jan 11 08:54:50 2001 +++ tcp.c Thu Jan 11 08:56:42 2001 @@ -954,7 +954,7 @@ */ skb = sk->write_queue.prev; if (tp->send_head && - (mss_now - skb->len) > 0) { + (signed int)(mss_now - skb->len) > 0) { copy = skb->len; if (skb_tailroom(skb) > 0) { int last_byte_was_odd = (copy % 4); Or would this be better? + (unsigned int)mss_now > skb->len) { Or making mss_now unsigned in the first place? -- Paul Cassella - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") 2001-01-11 16:45 ` Paul Cassella @ 2001-01-11 17:18 ` David S. Miller 2001-01-12 10:52 ` 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH:"No " Andrew Morton 0 siblings, 1 reply; 10+ messages in thread From: David S. Miller @ 2001-01-11 17:18 UTC (permalink / raw) To: pwc; +Cc: andrewm, ak, linux-kernel, linux-net Date: Thu, 11 Jan 2001 10:45:13 -0600 (CST) From: Paul Cassella <pwc@speakeasy.net> I'm not familiar enough with the tcp code to know if this patch (against -ac6) is a solution, band-aid, or, in fact, wrong, but I've run with it (on -ac3) and haven't seen the errors for over twelve hours, which is three times longer than it had been able to go without it coming up. See the fix I put in 2.4.1-pre2, which is: diff -u --recursive --new-file v2.4.0/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c --- v2.4.0/linux/net/ipv4/tcp.c Tue Nov 28 21:53:45 2000 +++ linux/net/ipv4/tcp.c Wed Jan 10 14:12:12 2001 @@ -954,7 +954,7 @@ */ skb = sk->write_queue.prev; if (tp->send_head && - (mss_now - skb->len) > 0) { + (mss_now > skb->len)) { copy = skb->len; if (skb_tailroom(skb) > 0) { int last_byte_was_odd = (copy % 4); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH:"No such process") 2001-01-11 17:18 ` David S. Miller @ 2001-01-12 10:52 ` Andrew Morton 0 siblings, 0 replies; 10+ messages in thread From: Andrew Morton @ 2001-01-12 10:52 UTC (permalink / raw) To: pwc; +Cc: linux-kernel, linux-net "David S. Miller" wrote: > > Date: Thu, 11 Jan 2001 10:45:13 -0600 (CST) > From: Paul Cassella <pwc@speakeasy.net> > > I'm not familiar enough with the tcp code to know if this patch > (against -ac6) is a solution, band-aid, or, in fact, wrong, but > I've run with it (on -ac3) and haven't seen the errors for over > twelve hours, which is three times longer than it had been able to > go without it coming up. > > See the fix I put in 2.4.1-pre2, which is: The -pre2 fix exists exclusively because of Paul's exhaustive debugging efforts. Thanks! - - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process")
@ 2001-01-08 5:55 Paul Cassella
2001-01-08 5:58 ` David S. Miller
2001-01-08 6:35 ` Andi Kleen
0 siblings, 2 replies; 10+ messages in thread
From: Paul Cassella @ 2001-01-08 5:55 UTC (permalink / raw)
To: linux-kernel, linux-net
[1.] One line summary of the problem:
write() returns -1 and sets errno non-sensically. 2.4.0{,-ac[23]}
[2.] Full description of the problem/report:
write() sometimes returns -1 and sets errno to one of
1 (EPERM: "Operation not permitted")
3 (ESRCH: "No such process")
8 (ENOEXEC: "Exec format error")
1 seems to be the most common.
I have verified that at least the ESRCH case is caused by the kernel.
With the following patch to sys_write(),
--- fs/read_write.c~ Sat Nov 11 18:07:38 2000
+++ fs/read_write.c Sun Jan 7 14:00:25 2001
@@ -146,6 +146,8 @@
ssize_t ret;
struct file * file;
+extern struct file_operations socket_file_ops;
+
ret = -EBADF;
file = fget(fd);
if (file) {
@@ -165,6 +167,18 @@
DN_MODIFY);
fput(file);
}
+ if(ret < 0 && file && file->f_op == &socket_file_ops ) {
+ switch(-ret) {
+ case EAGAIN: case EBADF: case EPIPE: case ENOSPC: case EIO: case ECONNRESET:
+ case EINTR: case ETIMEDOUT: case EFAULT: case EINVAL: case EMSGSIZE: case ENOMEM:
+ case ENOBUFS: case ENOTCONN:
+ break;
+
+ default:
+ printk(KERN_ERR "sys_write: ret is unexpectedly %d.\n", ret);
+ }
+ }
+
return ret;
}
and socket_file_ops made non-static, I eventually got this logged:
Jan 7 22:15:29 localhost kernel: sys_write: ret is unexpectedly -3.
And this user code:
r = write(fd_that_is_a_tcp_socket, ...);
if (r > 0) { ...
} else if(r == 0) { ...
} else if (errno == EAGAIN || errno == EINTR) { ...
} else if (errno == EPIPE || errno == ENOSPC || errno == EIO || errno == ECONNRESET || errno == ETIMEDOUT) { ...
} else {
g_error("node_write: write failed with unexpected errno: %d (%s)\n", errno, g_strerror(errno));
}
at the same time produced
** ERROR **: node_write: write failed with unexpected errno: 3 (No such process)
aborting...
This socket is O_NONBLOCK'd, as well as SO_KEEPALIVE'd and SO_REUSEADDR'd,
and was an outgoing connection.
TCP ECN is on. Syncookies are compiled in but turned off.
This app has previously failed with the same thing for errno's 1 and 8,
but without the kernel change to verify that those values are actually
coming from the kernel.
That had happened on 2.4.0, 2.4.0-ac2, and 2.4.0-ac3. I didn't notice it
on 2.4.0-test11-pre2, which was the last kernel I'd been running. But
the problem's not particularly deterministic, and I may not have been
running it long enough. At least two other people are seeing the same
thing on 2.4 kernels.
My guess is that something mistakenly thinks it's returning a positive
number.
[3.] Keywords (i.e., modules, networking, kernel):
networking
[4.] Kernel version (from /proc/version):
Linux version 2.4.0-ac3 (fortytwo@manetheren) (gcc version 2.95.2 20000220 (Debian GNU/Linux)) #4 Sun Jan 7 16:18:26 CST 2001
The machine and kernel are UP.
[6.] A small shell script or example program which triggers the
problem (if possible)
This happens after the app runs usually for several hours with lots of
outgoing and incoming TCP connections to lots of different hosts.
[7.1.] Software (add the output of the ver_linux script here)
Linux manetheren 2.4.0-ac3 #4 Sun Jan 7 16:18:26 CST 2001 i686 unknown
Kernel modules 2.3.23
Gnu C 2.95.2
Gnu Make 3.79.1
Binutils 2.10.1.0.2
Linux C Library > libc.2.2
Dynamic linker ldd (GNU libc) 2.2
Procps 2.0.6
Mount 2.10q
Net-tools 2.05
Console-tools 0.2.3
Sh-utils 2.0.11
Modules Loaded parport_pc lp parport rtc usbcore
[7.2.] Processor information (from /proc/cpuinfo):
[7.3.] Module information (from /proc/modules):
[7.5.] PCI information ('lspci -vvv' as root)
[7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
These doesn't seem particularly relevant, so I'm putting them, as well as
.config, at
http://manetheren.eigenray.com/~fortytwo/bad_write_info
Don't hesitate to ask me for more info or to try a patch or something.
[7.7.] Other information that might be relevant to the problem
(please look in /proc and include all information that you
think to be relevant):
In 2.4.0 and -ac2, I was getting the reset_xmit_timer() messages that -ac3
fixed. I'm also getting TCP peer shrinks window messages, but had none
this boot before this error.
--
Paul Cassella
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") 2001-01-08 5:55 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No " Paul Cassella @ 2001-01-08 5:58 ` David S. Miller 2001-01-08 7:16 ` Paul Cassella 2001-01-08 6:35 ` Andi Kleen 1 sibling, 1 reply; 10+ messages in thread From: David S. Miller @ 2001-01-08 5:58 UTC (permalink / raw) To: pwc; +Cc: linux-kernel, linux-net Date: Sun, 7 Jan 2001 23:55:28 -0600 (CST) From: Paul Cassella <pwc@speakeasy.net> [1.] One line summary of the problem: write() returns -1 and sets errno non-sensically. 2.4.0{,-ac[23]} What you describe I can only say is "impossible". There are only four cases when _ANY_ part of the ipv4 networking stack can return ESRCH. These four cases are: 1) Adding a route 2) Deleting a route 3) Adding a FIB routing rule 3) Removing a FIB routing rule None of them can occur via TCP socket writes (only netlink socket operations or socket control calls). Therefore I suspect you are perhaps getting rather some form of memory corruption or similar, really, please search the networking code for ESRCH value usage, you will see. Later, David S. Miller davem@redhat.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") 2001-01-08 5:58 ` David S. Miller @ 2001-01-08 7:16 ` Paul Cassella 2001-01-08 7:05 ` David S. Miller 0 siblings, 1 reply; 10+ messages in thread From: Paul Cassella @ 2001-01-08 7:16 UTC (permalink / raw) To: David S. Miller; +Cc: linux-kernel, linux-net On Sun, 7 Jan 2001, David S. Miller wrote: > Date: Sun, 7 Jan 2001 23:55:28 -0600 (CST) > From: Paul Cassella <pwc@speakeasy.net> > > [1.] One line summary of the problem: > > write() returns -1 and sets errno non-sensically. 2.4.0{,-ac[23]} > > What you describe I can only say is "impossible". Right. That's why the code g_error()'s there. :) > None of them can occur via TCP socket writes (only netlink socket > operations or socket control calls). I didn't imagine that a TCP write could return any of these errors, which is why I guessed that something's returning a value it thinks is positive, but turns out to be negative in this case, for example, "return a - b;" where due to, maybe, (but I guess not,) the peer shrunk window thing, a < b. > Therefore I suspect you are perhaps getting rather some form of memory > corruption or similar, really, please search the networking code for > ESRCH value usage, you will see. I believe that the tcp_sendmsg() path never tries to return -ESRCH, but I don't see how userland memory corruption could cause the app to (1) open such a socket instead of a TCP socket, and (2) get ESRCH or ENOEXEC instead of EPERM or whatever a non-root process would get when it tried such a thing. I have seen no signs of bad memory on this machine, and of a fairly small sample set, one (I was wrong when I said several) person is seeing the same thing, with 2.4.0-test13-pre4, and I didn't see it with 2.4.0-test11-pre2. The change I made to linux/fs/read_write.c:sys_write() checks file->f_op == &socket_file_ops and then finds ret == -3; presumably this is the same 3 that my app gets. Would it be more helpful if I were to check something like socki_lookup(file->f_dentry->f_inode)->ops == tcp_prot instead? Or do the check in tcp_sendmsg()? -- Paul Cassella - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") 2001-01-08 7:16 ` Paul Cassella @ 2001-01-08 7:05 ` David S. Miller 0 siblings, 0 replies; 10+ messages in thread From: David S. Miller @ 2001-01-08 7:05 UTC (permalink / raw) To: pwc; +Cc: linux-kernel, linux-net Date: Mon, 8 Jan 2001 01:16:27 -0600 (CST) From: Paul Cassella <pwc@speakeasy.net> Would it be more helpful if I were to check something like socki_lookup(file->f_dentry->f_inode)->ops == tcp_prot instead? No, helpful would be for you to present us with a test case program and the network device configuration you are using. Are you using netfilter? Are you using tunneling, these sorts of things. Basically, the things we would need need to know to be able to duplicate your precise setup here locally in hopes of triggering the problem ourselves. Later, David S. Miller davem@redhat.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") 2001-01-08 5:55 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No " Paul Cassella 2001-01-08 5:58 ` David S. Miller @ 2001-01-08 6:35 ` Andi Kleen 2001-01-08 7:54 ` Paul Cassella 1 sibling, 1 reply; 10+ messages in thread From: Andi Kleen @ 2001-01-08 6:35 UTC (permalink / raw) To: Paul Cassella; +Cc: linux-kernel, linux-net On Sun, Jan 07, 2001 at 11:55:28PM -0600, Paul Cassella wrote: > [1.] One line summary of the problem: > > write() returns -1 and sets errno non-sensically. 2.4.0{,-ac[23]} Would it be possible to provide a compiling test case that shows these errors ? Also over what interface do you run it? -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") 2001-01-08 6:35 ` Andi Kleen @ 2001-01-08 7:54 ` Paul Cassella 0 siblings, 0 replies; 10+ messages in thread From: Paul Cassella @ 2001-01-08 7:54 UTC (permalink / raw) To: Andi Kleen, davem; +Cc: linux-kernel, linux-net On Mon, 8 Jan 2001, Andi Kleen wrote: > On Sun, Jan 07, 2001 at 11:55:28PM -0600, Paul Cassella wrote: > > write() returns -1 and sets errno non-sensically. 2.4.0{,-ac[23]} > Would it be possible to provide a compiling test case that shows these > errors ? The CVS version (perhaps even version 0.12) of gtk-gnutella should do it, though it's not exactly what I'm running. After the crash I posted about, I've been running it for another three and a half hours under similar load, and it hasn't crashed again yet; nor have I seen any other unexpected ret's (besides those noted below) get logged. http://gtk-gnutella.sourceforge.net/cvs/ Though I don't think gtk-gnutella is special. It doesn't do anything programmatically unusual with sockets, it just has a bunch of connections to a bunch of different machines, which are probably running a bunch of different os's, etc. And it aborts when write() returns unexpected values. I've appended the actual kernel diffs that I'm using; I'd just pasted them from an xterm before. I probably should have added ECONNREFUSED and ERESTARTSYS to the list. > Also over what interface do you run it? eth0 (tulip): 01:08.0 Ethernet controller: Lite-On Communications Inc LNE100TX (rev 21) In answer to David's questions, I don't think I'm doing anything out of the ordinary. I'm running over DSL with the above card on an external DSL router. No netfilter, no tunneling, just IP. CONFIG_PACKET=m CONFIG_PACKET_MMAP=y CONFIG_NETLINK=y CONFIG_RTNETLINK=y CONFIG_NETLINK_DEV=m # CONFIG_NETFILTER is not set # CONFIG_FILTER is not set CONFIG_UNIX=y CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set CONFIG_INET_ECN=y CONFIG_SYN_COOKIES=y CONFIG_IPV6=m # CONFIG_IPV6_EUI64 is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_LLC is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set CONFIG_DUMMY=m CONFIG_TULIP=y I have these set, but I haven't used them: CONFIG_PPP=m # CONFIG_PPP_MULTILINK is not set CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m eth0 Link encap:Ethernet HWaddr 00:A0:CC:3E:E6:63 inet addr:64.81.146.215 Bcast:64.81.146.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:674842 errors:0 dropped:0 overruns:0 frame:0 TX packets:791977 errors:0 dropped:0 overruns:0 carrier:0 collisions:490 txqueuelen:100 Interrupt:11 Base address:0xd800 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:3856 Metric:1 RX packets:1138 errors:0 dropped:0 overruns:0 frame:0 TX packets:1138 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 Destination Gateway Genmask Flags Metric Ref Use Iface 64.81.146.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 64.81.146.1 0.0.0.0 UG 0 0 0 eth0 Is there a list somewhere of network options I should report (such as filtering and tunneling)? Should one of linux-kernel or linux-net be pruned from the Cc: list? -- Paul Cassella --- fs/read_write.c~ Sat Nov 11 18:07:38 2000 +++ fs/read_write.c Sun Jan 7 14:00:25 2001 @@ -146,6 +146,8 @@ ssize_t ret; struct file * file; +extern struct file_operations socket_file_ops; + ret = -EBADF; file = fget(fd); if (file) { @@ -165,6 +167,18 @@ DN_MODIFY); fput(file); } + if(ret < 0 && file && file->f_op == &socket_file_ops ) { + switch(-ret) { + case EAGAIN: case EBADF: case EPIPE: case ENOSPC: case EIO: case ECONNRESET: + case EINTR: case ETIMEDOUT: case EFAULT: case EINVAL: case EMSGSIZE: case ENOMEM: + case ENOBUFS: case ENOTCONN: + break; + + default: + printk(KERN_ERR "sys_write: ret is unexpectedly %d.\n", ret); + } + } + return ret; } --- net/socket.c~ Mon Jan 8 01:26:55 2001 +++ net/socket.c Sun Jan 7 13:58:55 2001 @@ -111,7 +111,7 @@ * in the operation structures but are done directly via the socketcall() multiplexor. */ -static struct file_operations socket_file_ops = { +struct file_operations socket_file_ops = { llseek: sock_lseek, read: sock_read, write: sock_write, - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2001-01-12 10:46 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <3A5B0A59.1EB60A88@uow.edu.au>
2001-01-09 14:03 ` 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No such process") Paul Cassella
2001-01-11 16:45 ` Paul Cassella
2001-01-11 17:18 ` David S. Miller
2001-01-12 10:52 ` 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH:"No " Andrew Morton
2001-01-08 5:55 2.4.0-ac3 write() to tcp socket returning errno of -3 (ESRCH: "No " Paul Cassella
2001-01-08 5:58 ` David S. Miller
2001-01-08 7:16 ` Paul Cassella
2001-01-08 7:05 ` David S. Miller
2001-01-08 6:35 ` Andi Kleen
2001-01-08 7:54 ` Paul Cassella
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®