A geek moment

If you’re not a Linux geek, feel free to ignore this post.

I started OpenOffice today, and soon found that it was pegging my CPU. This had happened a previous time I started it, but I just killed it and didn’t investigate. I needed to get my paper written this time, so I investigated. I attached to the offending thread with strace, and saw that it was in a busy loop of connecting to port 631 (ipp) on localhost, sending a request, and immediately failing on a Broken Pipe. A quick check of /etc/services revealed that this port belongs to the Internet Printing Protocol (IPP). I have no printing installed on my machine, so this seemed strange, along with the fact that this is only the second time I’ve seen this happen. I found the process listening on that port with “lsof -i :631”. It turned out to be rpc.mountd, which I then recalled was also showing activity at the same time. This didn’t make sense, as this process helps with NFS, not printing. I hypothesized that this was one of the RPC protocols that allocated a random port at startup, and it just happened to pick that one this time around. (I recently had to reboot my machine.) I thought auto port numbers started at 1024, though, so I wasn’t sure. Regardless, I caused it to reallocate its port by invoking “/etc/rc.d/rc.nfsd restart” (Slackware). Sure enough, it picked a different port this time, and OpenOffice now works fine.

This was a rather strange coincidental conflict between two disparate programs that just happened to have both undesirable and noticable consqeuences. I’d say it’s the fault of both programs: RPC services should pick unreserved ports above 1024 to avoid collisions, and OpenOffice shouldn’t be busy-looping on a network connection.

This entry was posted in xanga. Bookmark the permalink.

7 Responses to A geek moment

  1. Compeccator says:

    Wait,I know nothing about this concept, but it seems to me that you didn’t fix the problem, per say, because there’s a random chance it will happen next time you start up… Is that right?

  2. Tapinger says:

    Non-root processes cannot listen on ports below 1024 (by default), but root ones certainly can. I don’t know about the auto-allocation, though… it might intentionally allocate one below 1024 to assure clients connecting to it that they have the real NFS server instead of a user-privileged faker.

    I think there is a knob like /proc/sys/net/ipv4/ip_local_port_range, maybe, to control the auto-allocation. But, it seems to default to 32768 through 61000 on my machine, so I’m guessing it wouldn’t help in this case. Long story short, OpenOffice is really in the wrong for behaving that way. Maybe you could firewall connections from localhost to port 631 to work around it?

  3. TimPeterson says:

    Isaiah: That’s correct. It’s still perfectly possible for it to happen again, but I tend to doubt it will, seeing as I’ve been using OpenOffice for years with no problem. It could, however, be related to the fact that I updated OpenOffice not too long ago. Then again, I can’t have restarted more than 3-4 times since then, so it may not have had time to exhibit how often the problem will manifest itself. On the upside, I now know how to easily fix it, so it won’t be a big problem if it does.

    Tap: In the olden days, at least, 1024 was also where auto-allocation started. I show the same setting as you do on that, so I guess they’ve since changed it in Linux. Running “nc -vl” as either root or a normal user gives me a port in that 32K range, so that does seem to be the case. RPC must handle its own auto-allocation somehow, though I haven’t found anything on that yet.

  4. HawkeyeAZ1 says:

    Yeah, 1024 is the start of ‘auto assign’, but little holds a program to it. Many ports below 1024 are program specific, and some of the programs will never be run in a Linux environment, so the ports are technically free. But then again, only a few ports are statically assigned and required/expected to be that port number.

  5. We have Open Office on our computer too.  The only annoying thing that I found about it is that you have to save the files you want to share in a PDF format, otherwise the other computers in the world don’t know what to do with it!

    I noticed that you visited the Campfire, and I stopped in to say that it is great to see you and you are welcome back anytime!

    Cowboy

  6. I happened to be on at the moment.

  7. Thank you for the information.  I would love to talk to one of those people, if you could give me their email I would greatly appreciate it.  Also, I’m looking at Geneseo and they have an InterVarsity.  I was wondering how good it is biblically and what it’s main focus is.  Do they actually use the bible?  What happens at a typical meeting?  Any information would be very helpful.  THANK YOU!

Leave a Reply

Your email address will not be published. Required fields are marked *