Re: Fix for thread+network crashes in 2.0/2.1?

A.N.Kuznetsov (
Tue, 3 Mar 1998 15:31:38 +0300 (MSK)


> > Protocols do not sleep (with one exception - netlink) on socket
> > owned by another process, so that get_fd()...put_fd()
> Well, I was thinking of a task creating a socket, then doing a fork,
> and then both tasks doing a select involving the common socket and some
> non-common files. Then the poll tables of both tasks would both refer
> the shared socket's sock->wait, won't they?

select makes fget (after 2.1.88:)), so that socket will be closed only when
the last thread leaves select.

> As with the x.25 problem: I've checked by means of printk()'s at the very end
> of x25_release(), that the socket's wait queue is empty before exiting
> and the the socket->inode->i_count is always 2. Nevertheless,
> it crashes with corrupted sock->wait wait queue in select()'s free_wait().
> The select also monitors a pty file descriptor. Maybe the problem is not
> caused by af_x25 but by somethink else. Are there certain kinds of bugs
> that are known to likly cause socket wait queue corruptions?

BTW, recently Richard Henderson observed similar phenomenon on pure
IPv4 socket. But it occured on sparc which could have arch specific problems...

Alexey Kuznetsov

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to