This is interesting. I'm not quite sure what causes this, and haven't yet reproduced it, but I suspect something involving signal handling and/or longjmp(), and possibly unfortunate interactions with stdio buffers in fgets(). We may want to setvbuf() when reading passwords with fgets(). Places to look at: util/ss/listen.c and lib/krb5/os/read_pwd.c or lib/krb5/os/prompter.c (on the trunk).