Knowledge Base

BUG: ReadFile Timeout on Mailslot Causes Memory Leak

Article ID: 177329

Article Last Modified on 11/21/2006


APPLIES TO


This article was previously published under Q177329

SYMPTOMS

If a mailslot is created using CreateMailslot() API with a timeout value greater than zero, the ReadFile() API leaks memory when the timeout expires and the function returns FALSE. After many calls to the ReadFile() API, the system becomes unstable and subsequent ReadFile() API calls whose timers expire will start returning TRUE. As a result, the system will no longer be able to execute other DOS applications.

RESOLUTION

To work around this, create the mailslot with either a zero or MAILSLOT_WAIT_FOREVER timeout value. This means that a ReadFile() API call will block until there is data to be read from the mailslot.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Keywords: kbbug KB177329