Whenever an application calls SmcCloseConnection() a message dialogue pops up showing the message passed to SmcCloseConnection(). When the user clicks Ok, dtsession segfaults. I backtraced the coredump and the last line in dtsession is SmWatch.c:124.
I tested on Debian 12 and gentoo. Both behave the same. The attached test program can reproduce the bug.