Using xdr_string(..) causes segmentation fault

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

 



Hello list,

this post is not strictly NFS but RPC related; I post it here for a lack 
of knowing about a better place. If it was totally wrong to post it here, 
would somebody please point me to a better place? Thanks!

I'm trying to do some very basic RPC calls both for testing stuff and out 
of interest. I'd like to, in this example, issue a RPC mount call. 
However, I'm getting a segmentation fault which I traced back to 
xdr_string of <rpc/rpc.h>:

---%<---
char *mountpoint;
asprintf(&mountpoint, "%s\0", argv[2]);

mountres3 *mnt3res = malloc(sizeof(mountres3));
struct timeval timeout = {
    .tv_sec = 60,
    .tv_usec = 0
};
enum clnt_stat stat = clnt_call(mount_clnt, MOUNTPROC3_MNT, 
        (xdrproc_t) xdr_dirpath, (caddr_t) mountpoint,
        (xdrproc_t) xdr_mountres3, (caddr_t) mnt3res, 
        timeout);
--->%---

I've used the mount.x file with rpcgen to get xdr_dirpath and the likes. 

Could somebody please point out the mistake I'm obviously doing here?

Thanks alot in advance,
                Eric

--
Eric MSP Veith <eric.veith@xxxxxxxxxx>
Hechtsheimer Str. 2
DE-55131 Mainz
Germany

IBM Deutschland GmbH
Vorsitzender des Aufsichtsrats: Erich Clementi
Geschäftsführung: Martin Jetter (Vorsitzender), Reinhard Reschke, 
Christoph Grandpierre, Matthias Hartmann, Michael Diemer, Martina 
Koederitz
Sitz der Gesellschaft: Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 14562
WEEE-Reg.-Nr. DE 99369940
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux