mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Tastky <tastky@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: nfs-utils broken with musl: "select: Bad file descriptor"
Date: Mon, 17 Aug 2015 23:00:21 -0400	[thread overview]
Message-ID: <20150818030021.GG32742@brightrain.aerifal.cx> (raw)
In-Reply-To: <55D298BD.2030903@gmail.com>

On Tue, Aug 18, 2015 at 04:30:21AM +0200, Tastky wrote:
> As by this OpenWRT bugreport:
> https://dev.openwrt.org/ticket/20038
> 
> On various architectures – at least a mips and powerpc one –
> nfs-utils is broken with musl, yielding a never ending stream of
> "my_svc_run() - select: Bad file descriptor" in the system log.
> 
> The message originates in the this file:
> http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=utils/statd/svc_run.c
> 
> "Downgrading" to uClibc has the issue vanish.
> 
> I verified this myself with recent git versions of both musl and the
> utils on a fresh ar71xx OpenWRT compilation.

Here's my quick guess at what's going wrong. This file:

http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=utils/statd/system.h;h=a1739c491474179c16a64f7a2bbfde8f651085c6;hb=HEAD

contains nonsense to define SVC_FDSET as int rather than using fd_set
on "systems which don't have fd_set" (which don't exist).
Unfortunately, it's checking #ifdef FD_SETSIZE without including the
header that defines it, sys/select.h. If this is the problem, adding:

#include <sys/select.h>

to the top of that file should fix the error.

Note that compiling with -Werror=implicit-function-declaration would
catch such bogus code right away.

If this turns out not to be the problem, can you send an strace of the
failing program up to the first failure message?

Rich


  reply	other threads:[~2015-08-18  3:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18  2:30 Tastky
2015-08-18  3:00 ` Rich Felker [this message]
2015-08-18 16:50   ` Tastky
2015-08-18 17:49     ` Rich Felker
2015-08-18 18:07       ` Tastky
2015-08-18 18:08         ` Tastky
2015-08-18 18:20       ` Felix Janda
2015-08-18 19:18         ` Szabolcs Nagy
2015-08-18 20:51           ` Rich Felker
2015-08-19  9:34           ` Natanael Copa
2015-08-19  1:05 Chuck Lever

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=20150818030021.GG32742@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=tastky@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).