From: Fabien Ribes <fabien.ribes@cgey.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Oops in sock_poll
Date: Thu, 17 Jan 2002 16:51:17 +0000 [thread overview]
Message-ID: <3C470105.ED9DDCE@cgey.com> (raw)
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
next reply other threads:[~2002-01-17 16:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-17 16:51 Fabien Ribes [this message]
2002-01-17 21:12 ` Oops in sock_poll David S. Miller
2002-01-18 9:01 ` Fabien Ribes
2002-01-18 10:55 ` David S. Miller
2002-01-19 18:41 ` kuznet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C470105.ED9DDCE@cgey.com \
--to=fabien.ribes@cgey.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox