bash 4.0 vs. typing C-c (SIGINT)

Will show -bash: echo: write error: (ipc/mig) wrong reply message ID unter certain conditions.

After having noticed that this error doesn't occur if starting bash with --norc, I isolated it to the following command in .bashrc:

case $TERM in
  xterm* | rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"';;
esac

... and indeed:

tschwinge@flubber:~ $ echo "$TERM" -- "$PROMPT_COMMAND"
xterm -- echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"
tschwinge@flubber:~ $ ^C
-bash: echo: write error: (ipc/mig) wrong reply message ID
tschwinge@flubber:~ $ PROMPT_COMMAND=
tschwinge@flubber:~ $ ^C
tschwinge@flubber:~ $ 

bash-4.0$ PROMPT_COMMAND='echo >&2 -n foo\ '
foo bash-4.0$ ^C

bash-4.0$ PROMPT_COMMAND='echo >&1 -n foo\ '
foo bash-4.0$ ^C
bash: echo: write error: (ipc/mig) wrong reply message ID

bash-4.0$ PROMPT_COMMAND='/bin/echo >&1 -n foo\ '
foo bash-4.0$ ^C
bash: start_pipeline: pgrp pipe: (ipc/mig) wrong reply message ID

So, there's something different with stdout in / after the SIGINT handler.

IRC, freenode, #hurd, 2013-01-13

Perhaps completely unrelated to the issue above, perhaps not.

<tschwinge> bash: xmalloc: ../../../bash/lib/sh/strtrans.c:60: cannot
  allocate 261 bytes (323584 bytes allocated)
<tschwinge> 1.5 GiB RAM were free.
<tschwinge> This happened when I did a rever history search (C-r [...]),
  and then pressed C-c.