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)