Message Queuing Application May Fail in Mqoa.dll with an Access Violation

This article has been archived. It is offered "as is" and will no longer be updated.
SYMPTOMS
A Microsoft Message Queuing (also known as MSMQ) component that uses the EnableNotification method call and is written in Microsoft Visual Basic may result in an access violation.
CAUSE
This access violation occurs because of a race condition between threads in the Mqoa.dll file. When this problem occurs, the running program thread calls the MSMQQueue.EnableNotification method. The message is peeked immediately and is dispatched to the MSMQEvent event handler. Because the MSMQEvent event handler is in a multithreaded apartment (MTA), the call is dispatched to a worker thread. This worker thread will execute the event handler code and may take some time to complete.

The race condition starts when the program thread exits and runs its destructor. Because the MSMQEvent event handler is an apartment thread, the release event is dispatched to the MSMQEvent event handler, and the MSMQEvent object is released from memory. In the meantime, the event handler worker thread still tries to finish processing the event message. When the worker thread tries to reference the MSMQEvent object, an access violation occurs because the MSMQEvent object has been released from memory.For additional information about race conditions, click the following article number to view the article in the Microsoft Knowledge Base:
317723 INFO: What Are Race Conditions and Deadlocks?
For additional information about multithreaded apartments (MTA), click the following article number to view the article in the Microsoft Knowledge Base:
150777 INFO: Descriptions and Workings of OLE Threading Models
RESOLUTION

Hotfix Information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

No prerequisites are required.

Restart Requirement

You must restart your computer after you apply this hotfix.

Hotfix Replacement Information

This hotfix does not replace any other hotfixes.

File Information

The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version            Size    File name   --------------------------------------------------------------   21-Oct-2003  14:03  5.0.0.778         281,360  Mq1repl.dll         20-Sep-2003  17:23  5.0.0.778          14,096  Mq1sync.exe         02-Oct-2003  19:21  5.0.0.785          76,016  Mqac.sys   21-Oct-2003  14:03  5.0.0.783         217,360  Mqads.dll           20-Sep-2003  17:23  5.0.0.761          25,360  Mqbkup.exe          21-Oct-2003  14:03  5.0.0.785          76,560  Mqdscli.dll         21-Oct-2003  14:03  5.0.0.773          42,256  Mqdssrv.dll         20-Sep-2003  17:23  5.0.0.759          98,064  Mqmig.exe           21-Oct-2003  14:03  5.0.0.759         265,488  Mqmigrat.dll        21-Oct-2003  14:03  5.0.0.787         222,480  Mqoa.dll            21-Oct-2003  14:03  5.0.0.784          10,000  Mqperf.dll          21-Oct-2003  14:03  5.0.0.786         433,936  Mqqm.dll            21-Oct-2003  14:03  5.0.0.778         102,672  Mqrt.dll            21-Oct-2003  14:03  5.0.0.776          70,928  Mqsec.dll           21-Oct-2003  14:03  5.0.0.783         400,656  Mqsnap.dll          21-Oct-2003  14:03  5.0.0.762          23,824  Mqupgrd.dll         21-Oct-2003  14:03  5.0.0.782         110,864  Mqutil.dll          21-Oct-2003  14:03  5.0.0.748          64,784  Msmq.cpl   09-Oct-2003  00:18  5.4.1.0             6,656  Spmsg.dll           09-Oct-2003  00:19  5.4.1.0           140,800  Spuninst.exe        09-Oct-2003  00:19  5.4.1.0            22,016  Spcustom.dll     
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.
msmq mqoa AV failure fail
Properties

Article ID: 830475 - Last Review: 10/26/2013 20:02:23 - Revision: 2.6

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Advanced Server
  • kbnosurvey kbarchive kbautohotfix kbhotfixserver kbqfe kbbug kbfix kbqfe kbwin2000presp5fix KB830475
Feedback