[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#142312: marked as done (libc6: spurious "RPC: Can't encode arguments" - authnone, threads)



Your message dated Tue, 04 Mar 2003 12:54:52 +0900
with message-id <80fzq3bxbn.wl@oris.opensource.jp>
and subject line Bug#166419: RPC: Can't encode arguments
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 11 Apr 2002 07:24:04 +0000
>From zack@codesourcery.com Thu Apr 11 02:24:04 2002
Return-path: <zack@codesourcery.com>
Received: from egil.codesourcery.com (taltos.codesourcery.com) [66.92.14.122] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 16vYw7-0007Xo-00; Thu, 11 Apr 2002 02:24:03 -0500
Received: from zack by taltos.codesourcery.com with local (Exim 3.35 #1 (Debian))
	id 16vYw3-0004kj-00; Thu, 11 Apr 2002 00:23:59 -0700
From: Zack Weinberg <zack@codesourcery.com>
Subject: libc6: spurious "RPC: Can't encode arguments" - authnone, threads
To: submit@bugs.debian.org
X-Mailer: bug 3.3.10.1
Message-Id: <E16vYw3-0004kj-00@taltos.codesourcery.com>
Date: Thu, 11 Apr 2002 00:23:59 -0700
Delivered-To: submit@bugs.debian.org

Package: libc6
Version: 2.2.5-4
Severity: normal

I have a program which uses Sun RPC to communicate with another machine:
specifically, to attach to the debugging hooks on a network-capable
embedded board.  It's a big complicated program using both threads and
dynamic module loading (i.e. dlfcn.h).  I have not been able to dope
out a small test case.

When this program is run normally, it spits out a bunch of "RPC: Can't
encode arguments" errors.  By dint of extensive annotation with printf()
I've determined that these are caused by authnone_marshal failing, which
you would think would be impossible.

When I recompile auth_none.c from libc CVS into a shared object and
LD_PRELOAD it, the errors disappear.  The biggest difference between the
two is that libc's auth_none is compiled to be thread safe and mine isn't.
Looking at the code in auth_none.c I see that authnone_marshal is buggy
in the presence of multiple threads:

/*ARGSUSED */
static bool_t
authnone_marshal (AUTH *client, XDR *xdrs)
{
  struct authnone_private_s *ap;

  ap = (struct authnone_private_s *) authnone_private;
  if (ap == NULL)
    return FALSE;
  return (*xdrs->x_ops->x_putbytes) (xdrs, ap->marshalled_client, ap->mcnt);
}

It ignores its client parameter and uses authnone_private directly.  But
authnone_private is thread local data.  Therefore, if the RPC client
structure is created in one thread and used in another, the pointer will
be NULL in the second thread and this code will fail.

This patch should be the minimal change to fix the bug:

--- auth_none.c.orig	Thu Apr 11 00:20:50 2002
+++ auth_none.c	Thu Apr 11 00:21:44 2002
@@ -97,13 +97,10 @@
   return (&ap->no_client);
 }
 
-/*ARGSUSED */
 static bool_t
 authnone_marshal (AUTH *client, XDR *xdrs)
 {
-  struct authnone_private_s *ap;
-
-  ap = (struct authnone_private_s *) authnone_private;
+  ap = (struct authnone_private_s *) client;
   if (ap == NULL)
     return FALSE;
   return (*xdrs->x_ops->x_putbytes) (xdrs, ap->marshalled_client, ap->mcnt);

I will attempt to rebuild glibc overnight with this patch applied, and
see if it works.

A more thorough fix would be to change authnone_create to use pthread_once
instead of thread-local data.  There is no reason why each thread needs its
own copy of authnone_private.

-- System Information
Debian Release: 3.0
Kernel Version: Linux taltos 2.2.20 #3 Mon Nov 12 14:33:09 PST 2001 i686 unknown


---------------------------------------
Received: (at 142312-done) by bugs.debian.org; 4 Mar 2003 03:54:55 +0000
>From gotom@debian.or.jp Mon Mar 03 21:54:54 2003
Return-path: <gotom@debian.or.jp>
Received: from oris.opensource.jp (oris.opensource.gr.jp) [218.44.239.73] (postfix)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 18q3W1-0002eC-00; Mon, 03 Mar 2003 21:54:53 -0600
Received: from oris.opensource.jp (oris.opensource.jp [218.44.239.73])
	by oris.opensource.gr.jp (Postfix) with ESMTP
	id 11CFBC33C6; Tue,  4 Mar 2003 12:54:52 +0900 (JST)
Date: Tue, 04 Mar 2003 12:54:52 +0900
Message-ID: <80fzq3bxbn.wl@oris.opensource.jp>
From: GOTO Masanori <gotom@debian.or.jp>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	166419-done@bugs.debian.org, Zack Weinberg <zack@codesourcery.com>,
	142312-done@bugs.debian.org
Subject: Re: Bug#166419: RPC: Can't encode arguments
In-Reply-To: <20021026035935.GA22606@gondor.apana.org.au>
References: <20021026035935.GA22606@gondor.apana.org.au>
User-Agent: Wanderlust/2.9.9 (Unchained Melody) SEMI/1.14.3 (Ushinoya)
 FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.2
 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI)
MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya")
Content-Type: text/plain; charset=US-ASCII
Delivered-To: 142312-done@bugs.debian.org
X-Spam-Status: No, hits=-1.8 required=4.0
	tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01,
	      USER_AGENT
	version=2.44
X-Spam-Level: 

At Sat, 26 Oct 2002 13:59:35 +1000,
Herbert Xu wrote:
> 
> Package: libc6.1
> Version: 2.2.5-11.2
> 
> My syslog is getting flooded by messages from ypbind:
> 
> Oct 26 11:45:10 cardolan.me.apana.org.au ypbind[215]: broadcast: RPC: Can't encode arguments.
> Oct 26 11:45:50 cardolan.me.apana.org.au last message repeated 2 times
> Oct 26 11:47:10 cardolan.me.apana.org.au last message repeated 4 times
> Oct 26 11:48:30 cardolan.me.apana.org.au last message repeated 4 times
> Oct 26 11:49:50 cardolan.me.apana.org.au last message repeated 4 times
> Oct 26 11:51:10 cardolan.me.apana.org.au last message repeated 4 times
> Oct 26 11:52:31 cardolan.me.apana.org.au last message repeated 4 times
> 
> According to #142312, this is a bug in glibc.  Could you please do
> something about this as that bug has been outstanding for 6 months
> now with no comment from any glibc maintainers?

This bug is fixed in glibc 2.3.1, the patch which Zack Weinberg
sent is already applied.  I close it.

Regards,
-- gotom



Reply to: