This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Various] Digested Articles



Hi,

we've received the appended bug report together with a patch.  I don't
know enough about the code to say whether it's correct.

Can somebody please look into this and tell me if the patch is ok to
commit?

Thanks,
Andreas

2000-05-15  Andreas Jaeger  <aj@suse.de>

	* sunrpc/rpc_svcout.c (write_real_program): Add result argument
	with rpcgen -M.

	* sunrpc/rpc_hout.c (pargdef): Create correct prototype.
	Patches by Svein Olav Bjerkeset
	<svein.olav.bjerkeset@oslo.online.no>, fixes PR libc/1731.

Subject: Topics

Topics:
   libc/1731: glibc 2.1.3: rpcgen -N generates incorrect prototypes
   RE: libc/1731: glibc 2.1.3: rpcgen -N generates incorrect prototy




>Number:         1731
>Category:       libc
>Synopsis:       rpcgen -N generates incorrect prototype in glibc 2.1.3
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Thu May 11 11:20:01 EDT 2000
>Last-Modified:
>Originator:     Svein Olav Bjerkeset
>Organization:
Bravida Norge
>Release:        libc-2.1.3
>Environment:
RedHat Linux 6.1
Host type: i386-redhat-linux-gnu
System: Linux sobpc 2.2.15 #1 Thu May 4 10:11:23 CEST 2000 i686 unknown
Architecture: i686
Addons: c_stubs crypt glibc-compat linuxthreads
Build CFLAGS: -g -O3
Build CC: egcs
Compiler version: egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Kernel headers: 2.3.99-pre6
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

>Description:
 rpcgen -N myrpc.x will generate a prototype (in myrpc.h) that does not
match
 the function definition (in myrpc_xdr.c) when using RPC functions with
multiple
 arguments. The second argument to the XDR function should be a pointer,
like
 it is the myrpc_xdr.c file.

>How-To-Repeat:
 Given the file myrpc.x:

  /* myrpc.x */
  program MYRPC {
   version MYRPCV1 {
   bool MYRPCPROC (string, int) = 1;
  } = 1;
  } = 0x3FFFFFF;

 # rpcgen -C -N myrpc.x
 # gcc -o myrpc_xdr.o -c myrpc_xdr.c
 myrpc_xdr.c:10: conflicting types for `xdr_myrpcproc_1_argument'
 myrpc.h:42: previous declaration of `xdr_myrpcproc_1_argument'

>Fix:
 The following patch is adopted from a patch that fixed a similar bug in

 NetBSD. I do not know the rpcgen code well enough to state that this
 patch is 100% correct, but I have tested that it solved the problem
 described in this report.


 *** rpc_hout.c.orig Tue Dec  1 12:23:36 1998
 --- rpc_hout.c Thu May 11 16:35:32 2000
 ***************
 *** 189,195 ****
      }
    f_print (fout, "};\n");
    f_print (fout, "typedef struct %s %s;\n", name, name);
 !    storexdrfuncdecl (name, 0);
    f_print (fout, "\n");
  }
       }
 --- 189,195 ----
      }
    f_print (fout, "};\n");
    f_print (fout, "typedef struct %s %s;\n", name, name);
 !    storexdrfuncdecl (name, 1);
    f_print (fout, "\n");
  }
       }


I hope this patch (or a similar patch that will fix the rpcgen bug) can
find it's way into the
next glibc release

Regards
Svein Olav Bjerkeset

>Audit-Trail:
>Unformatted:
From: svein-olav.bjerkeset@bravida.no
To: bugs@gnu.org
Subject: rpcgen -N generates incorrect prototype (glibc 2.1.3)







The following reply was made to PR libc/1731; it has been noted by GNATS.

From: svein-olav.bjerkeset@bravida.no
To: bugs@gnu.org
Cc:  Subject: RE: libc/1731: glibc 2.1.3: rpcgen -N generates incorrect prototy
	pes
Date: Fri, 12 May 2000 14:51:03 +0200

  
 
 -----Original Message-----
 From: bugs@gnu.org
 To: svein-olav.bjerkeset@bravida.no
 Sent: 5/11/00 5:20 PM
 Subject: Re: libc/1731: glibc 2.1.3: rpcgen -N generates incorrect
 prototypes
 
 Thank you very much for your problem report.
 It has the internal identification `libc/1731'.
 The individual assigned to look at your
 report is: libc-gnats. 
 
 >Category:       libc
 >Responsible:    libc-gnats
 >Synopsis:       rpcgen -N generates incorrect prototype in glibc 2.1.3
 >Arrival-Date:   Thu May 11 11:20:01 EDT 2000
 
 
 When playing some more with rpcgen (from glibc 2.1.3) I found two other
 bugs related to the problem described in bug report libc/1731.
 (1) Incorrect prototype is generated in header file when using -N option
     and one argument is a pointer.
 (2) When using -M option, the result argument is missing in function call 
     in myrpc_svc.c (first function in file).
 
 Below is a patch that seems to fix the two problems described in this mail +
 the problem described in the original bug report.
 
 
 
 
 
 --- rpc_hout.c.orig	Tue Dec  1 12:23:36 1998
 +++ rpc_hout.c	Fri May 12 12:57:19 2000
 @@ -189,7 +189,7 @@
  	    }
  	  f_print (fout, "};\n");
  	  f_print (fout, "typedef struct %s %s;\n", name, name);
 -	  storexdrfuncdecl (name, 0);
 +	  storexdrfuncdecl (name, 1);
  	  f_print (fout, "\n");
  	}
      }
 @@ -413,7 +413,7 @@
        for (dl = proc->args.decls; dl != NULL; dl = dl->next)
  	{
  	  ptype (dl->decl.prefix, dl->decl.type, 1);
 -	  if (!newstyle)
 +	  if (!newstyle || dl->decl.rel == REL_POINTER)
  	    f_print (fout, "*");	/* old style passes by reference */
  
  	  f_print (fout, ", ");
 --- rpc_svcout.c.orig	Tue Dec  1 12:24:21 1998
 +++ rpc_svcout.c	Fri May 12 14:25:11 2000
 @@ -415,7 +415,7 @@
  	      for (l = proc->args.decls; l != NULL; l = l->next)
  		f_print (fout, "argp->%s, ", l->decl.name);
  	    }
 -	  f_print (fout, "%s));\n}\n", RQSTP);
 +      f_print (fout, "%s%s));\n}\n", mtflag ? "result, " : "", RQSTP);
  	}
      }
  }





-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]