-
Notifications
You must be signed in to change notification settings - Fork 0
Description
| Field | Value |
|---|---|
| Bugzilla ID | 1533 |
| Reporter | Alain Dupont |
| Assigned to | DOC Center Support List (internal) |
| Product | ACE |
| Component | ACE Core |
| Version | 5.3 |
| Platform / OS | x86 / Windows 2000 |
| Priority | P2 |
| Severity | critical |
| Status | ASSIGNED |
| Resolution | |
| Created | 2003-06-11 12:15:12 -0500 |
Originally posted by Alain Dupont on 2003-06-11 12:15:13 -0500
The access viloation occured when a thread (A) is canceling an asynchrounous
operation
for an ACE_Asynch_Read_Stream object and deleting it, while another thread (B)
is the polling the event for that object by the proactor (ACE_Proactor). The
proactor will then call the handle_read_stream
hanlder with an invalid object pointer to notify that the operation has been
cancelled.
There is no method to unregister, close, or delete the ACE_Asynch_Read_Stream
object from the proactor.
The following example shows how to reproduce the problem:
void thread_A()
{
ACE_Asynch_Read_Stream* Stream = new ACE_Asynch_Read_Stream();
// Open the read stream using the ACE_Asynch_Connector
// ...
//
Stream->cancel();
delete Stream; // Proactor will call the event handler on a
deleted object
// to notify that the operation has been
cancelled.
Stream = 0;
}
// Thread B
// CProactorTask is defined as
//
class CProactorTask : public virtual ACE_Task <ACE_MT_SYNCH>
{
public:
// ...
int CProactorTask::svc(void);
}
int CProactorTask::svc(void)
{
int Error = m_Proactor->proactor_run_event_loop();
return Error;
}