【问题复现步骤】,请描述具体的操作步骤
1.read.c和write.c文件如下:
[root@openEuler ~]# cat read.c
/*
#define SLEEP_TIME 5
#define ARG_COUNT 2
int main(int argc, char *argv[])
{
if (argc != ARG_COUNT) {
return -1;
}
char *fifoName = argv[1];
int fifoFd = open(fifoName, O_RDONLY);
if (fifoFd < 0) {
printf("open fifo failed!\n");
return -1;
}
int i;
sleep(SLEEP_TIME);
while (read(fifoFd, &i, sizeof(int)) == sizeof(int)) {
printf("%d", i);
}
close(fifoFd);
return 0;
}
[root@openEuler ~]# cat write.c
/*
#define ARG_2 2
#define ARG_3 3
int main(int argc, char *argv[])
{
int forLoops = 10;
if (argc < ARG_2 || argc > ARG_3) {
return -1;
}
if (argc == ARG_3) {
forLoops = argv[ARG_2];
}
char *fifoName = argv[1];
int fifoFd = open(fifoName, O_WRONLY);
printf("open fifo succeed!\n");
if (fifoFd < 0) {
printf("open fifo failed!\n");
return -1;
}
int i = 1;
for (; i < forLoops; i++) {
write(fifoFd, &i, sizeof(int));
}
printf("write succeed: %d\n", i);
close(fifoFd);
return 0;
}
编译host侧gcc -o read read.c
编译client侧gcc -o write write.c
3.host侧执行
mkfifo dpu_server/fifo
./read dpu_server/fifo
4.client侧执行
for i in {1..10}; do ./write dpu_client/fifo;done
for i in {1..100}; do ./write dpu_client/fifo;done
*【实际结果】**,请描述出问题的结果和影响
1.client侧卡住
2.dmesg信息如下:
Hi liwencheng6769, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: sig-DPU, and any of the maintainers: @lch_lichunhui , @lic121 , @minknov , @陈孚 , @liuhaic , @angus , @邹明 , @louhongxiang , @歲月 , @luochenglcs , @ryuxin , @SuperHugePan
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
已确认是测试用例问题
并发情况下client使用完进程kill掉已处理
登录 后才可以发表评论