figured I’d share this for any other plugin developers that may be hitting their heads against their desks as Rack crashes when creating threads inside of plugins:
be very careful of your thread stack size, or Rack will crash if you attempt to do something too large.
in my case, I had the audacity to move a bunch of FFT work into a thread, and any FFT calculations crossing the 64k memory line would crash immediately (but not when used outside of the thread).
default thread stack size is 524288
, and you need at least 4x that for any FFT work using PFFFT (the FFT implementation that Rack provides) that goes above 65536
.
learn from my frustration, and crank your stack size up to at least 100x what you’d realistically expect you need, PFFFT is a hungry hungry beast.
pthread_attr_t thread_attr;
pthread_attr_init(&thread_attr);
pthread_attr_setstacksize(&thread_attr, 262144 * 100);
pthread_t thread_id;
pthread_create(&thread_id, &thread_attr, yourThread, NULL);