raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.org
Subject: weird /proc/net/unix issue on CentOS 5.7 / 2.6.18-274.7.1.el5
Date: Wed, 20 Jun 2012 17:44:02 -0700	[thread overview]
Message-ID: <20120621004402.GA7450@dcvr.yhbt.net> (raw)
In-Reply-To: <20120621004402.GA7450@dcvr.yhbt.net>

Hey all, I encountered a strange bug on CentOS 5.7 servers running the
2.6.18-274.7.1.el5 kernel.  I'm not sure if/which newer versions fix
this and will report back if/when I find this.  I can't reproduce the
issue on a vanilla 3.4.2 Linux kernel nor on older CentOS 5.4 machines.

(Pointers to repositories appreciated, RH doesn't it seem to make it
easy to find their kernel git repositories (if they're public at all))

The regression is caused by attempting to read unix listener stats.
Here's the relevant strace output:

 open("/proc/net/unix", O_RDONLY) = 9
 fstat(9, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
 fstat(9, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
 ioctl(9, SNDCTL_TMR_TIMEBASE or TCGETS, 0x40d2a6a0) = -1 ENOTTY (Inappropriate ioctl for device)
 fstat(9, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
 lseek(9, 0, SEEK_CUR)       = 0
 read(9, "Num       RefCount Protocol Flag"..., 8192) = 4023
 ppoll([{fd=9, events=POLLIN}], 1, NULL, NULL, 8
 /* hangs forever */

This is on Ruby 1.9.3-p194 on x86_64

I've also tried different versions of Ruby and forcing select()
(instead of ppoll()):
  ruby -e 'IO.select([File.open("/proc/net/unix")],nil,nil,0.1)

Ruby returned nil after timing out with select, too.

It's arguable Ruby is being dumb about calling ppoll() (or select()) on
a file in /proc/, especially since we haven't hit EAGAIN, but really,
select/ppoll/poll/pselect/epoll_wait should all return immediately on
"regular" files


       reply	other threads:[~2012-06-21  0:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-21  0:44 Eric Wong [this message]
2012-06-21  1:13 ` Eric Wong
2012-06-23  3:10   ` Eric Wong

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

  List information: https://yhbt.net/raindrops/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120621004402.GA7450@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=raindrops@librelist.org \
    --subject='Re: weird /proc/net/unix issue on CentOS 5.7 / 2.6.18-274.7.1.el5' \
    /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

Code repositories for project(s) associated with this inbox:

	../../raindrops.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).