a deadlock case with qt
after a long time using tcmalloc, I find a case which may cause the deadlock
after `fork` or `clone` for creating a new process, without `exec` or `pthread_create`, and after that parent process and child process both request memory
when the front-end memory was run-out , both of two process may request memory from middle-end, but this step has spinlock, this may cause deadlock
the typical usage is in Qt application, in some thread called `QProcess::startDetached`, in this usage, child process call `new` operation, but the child process shared the memory with parent's memory, if front-end runs out, they may request middle-end memory, and they may cause deadlock
this case occurs very frequently, in 1000 times running, at least 1-2 times happens.
does some idea to avoid this happen?
关闭于 2025-08-05 2 条评论