Rpc - Segmentation fault (Core dumped)

谁都会走 提交于 2019-12-12 01:37:38

问题


I try to programming a new program with RPC in ubuntu , the server is executed ok but i get always that error : Segmentation fault (Core dumped) after execute the client this is my code

banque.x

const max_cin = 8;

typedef string typeCin<max_cin>;

struct client {
     typeCin cin; 
     float solde;
};

typedef struct client client;

struct cnMysql{
     char * host;
     char * user;
     char * pass;
};
typedef struct cnMysql cnMysql;


program BANQUE {
  version Client {
     string Connect(cnMysql cn) = 0;
     string AddC(client c) = 1;
     client ConC(typeCin cin) = 2;
     string AddS(client c) = 3;
 }=0;
}=20162016;

banque_server.c

char **
connect_0_svc(cnMysql *argp, struct svc_req *rqstp)
{
    static char * result;

    result = "test";

    return &result;
}

banque_client.c

   // declaration 
        CLIENT *clnt;
        char * *result_1;
        cnMysql  connect_0_arg;
        char * *result_2;
        client  addc_0_arg;
        client  *result_3;
        typeCin  conc_0_arg;
        char * *result_4;
        client  adds_0_arg;
    //end declaration 
    //main
    connect_0_arg.host = "localhost";
    connect_0_arg.user = "root";
    connect_0_arg.pass = "root";

    result_1 = connect_0(&connect_0_arg, clnt);

Video screen record here

来源:https://stackoverflow.com/questions/37240714/rpc-segmentation-fault-core-dumped

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!