To reproduce the crash caused by this problem, it's sufficient to call `recompile' when the compilation buffer has running process inside (which sometimes occurs when compiling TeX documents, for example). I've attached the GDB backtrace; the top of the stack gave me the hint that this problem is nearly the same as in bug #778.