With the foo.el below, running emacs -Q -batch -l foo.el gets a segv. Backtrace from a "-O0 -g" build below. I don't expect window handling stuff to actually show anything in -batch mode, but I hoped it wouldn't segfault. (Emacs 23 doesn't, didn't.) I see the backtrace says something "MOUSE_HL_INFO". The build is with gpm and with the gpm server when running, but I don't know if it ends up being used in -batch.