免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1436 | 回复: 0
打印 上一主题 下一主题

[C] gsoap 出现core了 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-09-15 13:17 |只看该作者 |倒序浏览
本帖最后由 taotao_112206_cu 于 2013-09-15 13:17 编辑

        struct soap soap;
        struct _ns1__jhqqResponse jhRES;
        struct _ns1__jhqq *aaa;
        int ret = 0;
        int hFileID = 0;
//      FILE *fp = NULL;
        char buffer[5*10240];
        memset(buffer, 0x00, sizeof(buffer));
        printf("active soap\n");
        const char * endPoints = "http://172.160.132.89:8081";

        hFileID = open("SG1016120130513091146.xml", O_RDONLY);
        if( hFileID == 0)
        {
                printf("open file failed[%s, %d]\n", strerror(errno), errno);
                return -1;
        }
        ret = read( hFileID, buffer, 7*10240);
//      printf("uuuuuuuuuuu= %s\n", buffer);
        soap_init(&soap);
        aaa = ( struct _ns1__jhqq *)malloc(7*10240+100);
        strcpy(aaa->in0,  buffer);
//      aaa->in0 = buffer;
        printf("aaa = %s\n", aaa->in0);
        if(soap_call___ns1__jhqq(&soap, endPoints, NULL, aaa, &jhRES) ==  SOAP_OK )
        {
                printf("SUCCRSS !!!!!\n");
        }
        soap_print_fault(&soap, stderr);
        printf("Failed !!!!!\n");
        printf("nnnnnnnnn[%s]\n", jhRES.out);
        free(aaa);
        soap_destroy(&soap);
        soap_end(&soap);
        soap_done(&soap);
        return 0;

warning: core file may not match specified executable file.
Core was generated by `./ServPWDServiceClient'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x006364a6 in strcpy () from /lib/tls/libc.so.6
(gdb) where
#0  0x006364a6 in strcpy () from /lib/tls/libc.so.6
#1  0x0804915e in main () at main.c:33
struct _ns1__jhqq
{
        char *in0;      /* required element of type xsd:string */
};
就是  strcpy(aaa->in0,  buffer);
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP