zoukankan      html  css  js  c++  java
  • f-stack中ipc传递指针从应用中读取信息时挂掉

    f-stack中ipc传递指针从应用中读取信息时挂掉

    如:创建bridge0
    ./ifconfig bridge0 create
    ./ifconfig f-stack-0 down
    ./ifconfig f-stack-1 down
    ./ifconfig bridge0 addm f-stack-0 addm f-stack-1 up

    查询:
    ./ifconfig bridge0
    ifconfig: unable to get interface list: Broken pipe
    /mnt/storage/sbin #

    跟踪发现
    在bridge_interfaces@ifbridge.c中有:
    ninbuf = realloc(inbuf, len);并
    bifc.ifbic_len = len;
    bifc.ifbic_buf = inbuf = ninbuf;
    if (do_cmd(s, BRDGGIFS, &bifc, sizeof(bifc), 0) < 0)
    ...
    使用了realloc,不能跨进程读写的内存。

    解法:
    需要改为: rte_relloc
    释放相应改为 rte_free

    影响:f-stack-master (2019-1-9)

  • 相关阅读:
    飞机大战4-我的子弹
    飞机大战3-我的飞机
    飞机大战1-分析设计
    继承
    常见题
    42个例子算法
    心跳
    tomcat
    service
    URI URL
  • 原文地址:https://www.cnblogs.com/mull/p/10244617.html
Copyright © 2011-2022 走看看