From: chrubis@suse.cz
To: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] rpc-tirpc-full-test-suite
Date: Tue, 11 Mar 2014 15:02:13 +0100 [thread overview]
Message-ID: <20140311140213.GA10778@rei> (raw)
In-Reply-To: <5317454D.5010505@oracle.com>
Hi!
> Hmm, I'm not 100% sure about libraries which I should link the test
> binaries with.
>
> The tirpc test binaries (tests_pack/rpc_suite/tirpc) must be linked with
> -ltirpc. For them there are no options.
>
> But for the rpc test cases (tests_pack/rpc_suite/rpc/)... If I
> understood libtirpc correctly, libtirpc should provide the same
> interfaces as "ordinary" libc does. Therefore these test cases may be
> linked either with libc or with libtirpc. And both versions will work
> the same way.
It looks like the glibc maintainers decided to get rid of the old RPC
implementation in glibc and that tirpc should be replacement for it. But
distributions had to reeanble it because tirpc wasn't completly ready to
be drop in replacement:
http://jaegerandi.blogspot.cz/2011/08/updating-glibc-to-214-with-some.html
I wonder what is the situation now, perhaps you should ask on glibc ML
(feel free to cc LTP ML as well).
> But here the problems come.
>
> For example, this suite contains a testcase like this:
> #include <rpc/rpc.h>
>
> int main(int argc, char **argv)
> {
> int fd = 0;
> SVCXPRT *svcr = NULL;
>
> svcr = svcfd_create(fd, 0, 0);
>
> printf("%p\n", svcr);
>
> svc_destroy(svcr);
>
> return 0;
> }
>
> My host is Ubuntu 12.04 i386. If I build this binary with libc I get:
> stas@Alex-notebook:/tmp$ gcc test.c -o test
> stas@Alex-notebook:/tmp$ ./test
> 0x924c008
>
> but if I try to get it linked with libtirpc I get:
> stas@Alex-notebook:/tmp$ gcc -I/usr/include/tirpc test.c -ltirpc -o test
> stas@Alex-notebook:/tmp$ ./test
> test: svc_fd_create: could not retrieve local addr
> (nil)
> Segmentation fault (core dumped)
>
> Can anybody explain why this happens? Maybe I have to do some extra
> steps for libtirpc?
I guess that the segfault happens because you passed NULL to
svc_destroy() and it dereferenced the pointer.
And the failure in svcfd_create() is caused by the fact that the code
calls getsockname() on the fd which in this case is 0 (stdin). The
return value is -1 and errno likely ENOTSOCK. See src/svc_vc.c in
libtirpc sources (note that svcfd_create() is just a wrapper for
svc_fd_create()).
On the other hand the glibc counterpart does not seem to care what type
of file descriptor it gets.
Which explains what happened but I have no idea if you can pass
arbitrary file descriptor to these function or not.
> Ok, I would switch to use libc and wouldn't care about that, but some
> test cases can't be linked with libc. For example -
> rpc_regunreg_registerrpc. If I try to link it with libc I get:
> (.text+0xa1): undefined reference to `registerrpc'
>
> I suppose that this problem is local to Ubuntu - I can build all the
> test binaries except the ones which employ registerrpc function.
> BTW, I don't observe such behavior in RHEL6.
>
> In general, I like the idea of build everything with -ltirpc. Because
> RPC support in glibc is said to be ad-hoc, and it's disabled by default.
> However, distribution vendors enable some triggers to get this support
> back in their distributions.
>
> If we build everything with -ltirpc, we will not care about this glibc
> triggers and will test libtirpc (and if libtirpc is not available on the
> host, the test suite will not be built).
I would like to know what glibc maintainers think about this.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-03-11 14:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-26 9:07 [LTP] rpc-tirpc-full-test-suite Stanislav Kholmanskikh
2013-12-26 9:07 ` [LTP] [PATCH 1/5] rpc-tirpc-full-test-suite: do not use tst_exit Stanislav Kholmanskikh
2013-12-26 9:07 ` [LTP] [PATCH 2/5] rpc-tirpc-full-test-suite: enabled build of the rpc test cases Stanislav Kholmanskikh
2014-02-11 15:42 ` chrubis
2013-12-26 9:07 ` [LTP] [PATCH 3/5] rpc-tirpc-full-test-suite: fixed the cmdline in runtest Stanislav Kholmanskikh
2014-02-11 15:46 ` chrubis
2013-12-26 9:07 ` [LTP] [PATCH 4/5] rpc-tirpc-full-test-suite: pass exit value to the wrapper Stanislav Kholmanskikh
2014-02-11 15:54 ` chrubis
2013-12-26 9:07 ` [LTP] [PATCH 5/5] rpc_stdcall_basic_lib: fixed IS_EX match Stanislav Kholmanskikh
2014-02-11 15:10 ` [LTP] rpc-tirpc-full-test-suite chrubis
[not found] ` <530C7004.3060102@oracle.com>
2014-02-26 13:47 ` chrubis
[not found] ` <530DF8C6.50600@oracle.com>
2014-02-26 15:08 ` chrubis
[not found] ` <5317454D.5010505@oracle.com>
2014-03-11 14:02 ` chrubis [this message]
[not found] ` <531F1FEE.1060001@oracle.com>
2014-03-11 15:08 ` chrubis
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=20140311140213.GA10778@rei \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=stanislav.kholmanskikh@oracle.com \
--cc=vasily.isaenko@oracle.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox