Stack overflow caused by integer overflow in recording surface bbtree
If you are printing to a large (but still standard) paper size like Arch E (914 x 1219 mm or 36.0 x 48.0 in) you can cause an integer overflow in bbtree_left_or_right
which results in a stack overflow while building the bbtree.
I experimented with just promoting the calculation to int64_t
which successfully fixed the issue (see recording-bbtree-int-overflow.patch) but someone with better knowledge in dealing with integer overflow might have a better solution.
I've only tested on Windows.