tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
rpcgen(1) bugs
Hello,
while trying to use rpcgen(1) on a -current system I noticed the
following fault:
$ cd /tmp
$ rpcgen -h
/*
* Please do not edit this file.
* It was generated using rpcgen.
*/
Segmentation fault (core dumped)
$
cc1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.NetBSD.org/Misc/send-pr.html> for instructions.
A possible fix for this problem (taken from FreeBSD's rpcgen) is
attached.
Furthermore, rpcgen seems to produce code which fails to compile:
$ cat msg.x
program MESSAGEPROG {
version MESSAGEVERS {
int PRINTMESSAGE(string) = 1;
} = 2;
} = 0x20150901;
$ rpcgen -a -C msg.x
$ ls
msg.h msg_client.c msg_server.c
msg.x msg_clnt.c msg_svc.c
$ gcc -Wall -o server msg_svc.c msg_server.c
msg_svc.c: In function 'closedown':
msg_svc.c:60: error: storage size of 'tinfo' isn't known
msg_svc.c:62: warning: implicit declaration of function 't_getinfo'
msg_svc.c:62: error: 'T_CLTS' undeclared (first use in this function)
msg_svc.c:62: error: (Each undeclared identifier is reported only once
msg_svc.c:62: error: for each function it appears in.)
msg_svc.c:60: warning: unused variable 'tinfo'
msg_svc.c: In function 'main':
msg_svc.c:137: error: 'FMNAMESZ' undeclared (first use in this function)
msg_svc.c:139: error: 'I_LOOK' undeclared (first use in this function)
msg_svc.c:153: error: 'I_POP' undeclared (first use in this function)
msg_svc.c:153: error: 'I_PUSH' undeclared (first use in this function)
msg_svc.c:158: warning: implicit declaration of function 't_getstate'
msg_svc.c:158: error: 'T_DATAXFER' undeclared (first use in this function)
msg_svc.c:137: warning: unused variable 'mname'
I haven't really looked at this problem, but FreeBSD's rpcgen builds
fine on NetBSD and seems to produce valid code (and even a makefile):
$ rm *.[ch]
$ ~/temp/rpcgen.fbsd/obj/rpcgen -a -C msg.x
$ ls
makefile.msg msg.x msg_clnt.c msg_svc.c
msg.h msg_client.c msg_server.c
$ gcc -Wall -o server msg_svc.c msg_server.c
$ ls -l server
-rwxr-xr-x 1 jukka jukka 8449 Feb 27 19:41 server*
Any hints?
Regards, Jukka
--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~
diff -rup usr.bin/rpcgen/rpc_main.c /tmp/rpcgen/rpc_main.c
--- usr.bin/rpcgen/rpc_main.c 2008-01-15 21:36:48.000000000 +0100
+++ /tmp/rpcgen/rpc_main.c 2008-02-27 18:42:04.000000000 +0100
@@ -532,7 +532,10 @@ h_output(infile, define, extend, outfile
outfilename = extend ? extendfile(infile, outfile) : outfile;
open_output(infile, outfilename);
add_warning();
- guard = generate_guard(outfilename ? outfilename : infile);
+ if (outfilename || infile){
+ guard = generate_guard(outfilename ? outfilename : infile);
+ } else
+ guard = "STDIN_";
f_print(fout, "#ifndef _%s\n#define _%s\n\n", guard,
guard);
Home |
Main Index |
Thread Index |
Old Index