Skip to content

rtsSysErrorMsgFn() for Windows GUI app calls vsnprintf() erroneously

Hi, this is a bug I noticed when reading through the code. I haven't actually experienced the bug, and don't have steps to reproduce.

In the function rtsSysErrorMsgFn() in the file rts/RtsMessages.c, there is the line:

            r = vsnprintf(buf+r, BUFSIZE-r, ": %s", syserr);

(In the ghc-8.10.2 tarball, this is line 251 of rts/RtsMessages.c.)

I'm pretty sure that line should instead be:

            r = snprintf(buf+r, BUFSIZE-r, ": %s", syserr);

because syserr is a string, not a va_list.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information