I encountered a bad thread concurrency issue using PD in a multi instance/multi thread context. The behavior of the increment and decrement of the static variable *stackcount* is undefined and results mostly in stack overflow. The simplest solution seems to set the variable a TLS with PERTHREAD. Here is a PR that solves the issue: https://github.com/pure-data/pure-data/pull/288.
Cheers, Pierre