public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Oops in sock_poll
@ 2002-01-17 16:51 Fabien Ribes
  2002-01-17 21:12 ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Fabien Ribes @ 2002-01-17 16:51 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

Hi all,

I have a kernel Oops on ppc kernel 2.4.5 with an application listenning
to a high throughput of incoming messages on a netlink socket. The
application is running select() on the netlink socket file descriptor
followed with  recvmsg() call (in a forever loop).

The Oops (not saved, and hard to reproduce) showed a crash in the
sock_poll function (kernel/net/socket.c); after investigations, crash is
due to a NULL pointer in f_dentry member of the file structure. This
pointer is set to NULL in the fput (kernel/fs/file_table.c) function.
The backtraces show that the calling function is the sys_recvmsg
(kernel/net/socket.c).

My understanding of the problem is the following:

- When everything goes right:

A/ When netlink socket is opened, its associated file structure is
initialised with f_count to 1, and a dentry;

B/ When select is executed, f_count is increased to 2;

C/ When select ends, f_count is decreased to 1;

D/ When recvmsg is executed, f_count is increased to 2;

E/ When recvmsg ends, f_count is decreased to 1;

F/ Loop forever to B/

- When the problem occurs:

A/ When netlink socket is opened, its associated file structure is
initialised with f_count to 1, and a dentry;

B/ When select is executed, f_count is increased to 2;

C/ When select ends, f_count is decreased to 1;

D/ When recvmsg is executed, f_count is increased to 2;

????/ SOMETHING decreases f_count to 1;

E/ When recvmsg ends, f_count is decreased to 0, AND THEREFORE f_dentry
member of file is set to NULL (since file is considered as not used) ;

F/ When select is executed, f_count is incremented to 1, but f_dentry is
NULL and therefore following code crashes in sock_poll function:
 sock = socki_lookup(file->f_dentry->d_inode);

Do you have an idea of the event that could have decreased the f_count
member between D/ and E/ ?
Could you give me elements to continue my investigation ?

Thanks a lot for you help,
Fabien

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-01-19 18:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-17 16:51 Oops in sock_poll Fabien Ribes
2002-01-17 21:12 ` David S. Miller
2002-01-18  9:01   ` Fabien Ribes
2002-01-18 10:55     ` David S. Miller
2002-01-19 18:41       ` kuznet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox