The use of debugpline() in tty_curs() got me wondering what would happen if debugpline() was called while pline() is in progress. I don't know how to trigger the bad coordinate situation, so I put an unconditional debugpline() in the NHW_MESSAGE case of tty_putstr() and used DEBUGFILES=wintty.c to enable it. Instant segfault, and the backtrace was short and not useful so the stack might have been clobbered. I didn't spend any time trying to figure where or why the segfault occurred. Change pline() so that if it is called while the previous pline() hasn't finished yet (ie, recursively), use raw_print() and return early. The raw_print message isn't very useful--it pops up wherever the cursor happens to be, just like the cursor position bug that has been an issue recently--but does get delivered without any segualt and isn't completely useless if DUMPLOG is enabled and you save or quit before the message buffer gets recycled. Message readability situation could be improved but avoiding the segfault was my goal. Putting any debugpline() into *_raw_print() would be inadvisable....
52 KiB
52 KiB