cpp-ipc
cpp-ipc copied to clipboard
fail: send, there is no receiver on this connection.
Hi, While I use this demo code, I found if the received crashed and reopen it again, I usually get this error and can not get any message anymore, I need to reboot my device to recovery it. is it the exist issue or limitation? or anything I need to handle on the code?
[code version] commit 647f7a2efb1ffc1015770026c76e3fe66e46a074 [Step]
- launch process A
- launch process B
- process B crashed
- reopen process B
Yes, it is a defect. There is a certain probability that a working connection will be closed while cleaning up invalid connections. I'm thinking of some solutions to this problem.
Yes, it is a defect. There is a certain probability that a working connection will be closed while cleaning up invalid connections. I'm thinking of some solutions to this problem.
https://squadrick.dev/journal/ipc-locks.html 是否考虑参考这个文章改善异常退出锁释放问题?
http://man7.org/linux/man-pages/man3/pthread_mutexattr_setrobust.3.html If a mutex is initialized with the PTHREAD_MUTEX_ROBUST attribute and its owner dies without unlocking it, any future attempts to call pthread_mutex_lock on this mutex will succeed and return EOWNERDEAD to indicate that the original owner no longer exists and the mutex is in an inconsistent state. Usually after EOWNERDEAD is returned, the next owner should call pthread_mutex_consistent on the acquired mutex to make it consistent again before using it any further.
木老师,我遇到了这个问题,下次启动的时候仍然是这样,我需要怎么做才能使它正常
是因为锁异常导致的问题么? 你可以尝试下develop分支下的代码,在那个里面我尝试了robust的锁和条件变量。 如果还有问题,还请及时告知我,谢谢~
木老师,我尝试了最新的develop代码,依然跑不起来,显示同样的错误,我将/dev/shm下的所有文件删除后依然存在这个问题,可能的问题出现在哪里
木老师,我尝试了最新的develop代码,依然跑不起来,显示同样的错误,我将/dev/shm下的所有文件删除后依然存在这个问题,可能的问题出现在哪里
建议提供一下可以复现问题的最小代码。
/dev/shm下的所有文件删除后依然存在这个问题?这不应该啊…… 我估计12月可能能有时间正式开始对应这一系列严重bug。
我再次尝试了下,可以了,应该是我之前搞错了,打扰木老师了