[omniORB] [DIFF] SIGSEGV after CancelRequest
Andrei Zaparii
zappa at yandex-team.ru
Sat May 8 17:49:37 BST 2004
This 'cvs diff' is meant to address segmentation fault in
omniCallHandle::upcall that occurs after CancelRequest message processed.
While this changes do not lead to memory leaking i'm not sure whether
other resource management is intact. So please review this diff.
--
Regards,
Andrei Zaparii
-------------- next part --------------
Index: GIOP_S.cc
===================================================================
RCS file: /cvsroot/omniorb/omni/src/lib/omniORB/orbcore/Attic/GIOP_S.cc,v
retrieving revision 1.1.4.25
diff -u -r1.1.4.25 GIOP_S.cc
--- GIOP_S.cc 16 Jul 2003 14:22:38 -0000 1.1.4.25
+++ GIOP_S.cc 8 May 2004 11:34:34 -0000
@@ -553,7 +553,11 @@
// an upcall by another thread. Therefore it is not possible to
// cancel a request that has already been in progress.
omniORB::logs(5, "Received and ignored a CancelRequest message.");
- pd_state = ReplyCompleted;
+ // assigning to state anything but WaitingForReply will brake assertion
+ // in the beginig of SendReply
+ pd_state = WaitingForReply;
+ // We should not send reply to client
+ response_expected(0);
return 1;
}
Index: giopStrand.cc
===================================================================
RCS file: /cvsroot/omniorb/omni/src/lib/omniORB/orbcore/Attic/giopStrand.cc,v
retrieving revision 1.1.4.20
diff -u -r1.1.4.20 giopStrand.cc
--- giopStrand.cc 30 Mar 2004 14:26:36 -0000 1.1.4.20
+++ giopStrand.cc 8 May 2004 11:35:43 -0000
@@ -537,7 +537,15 @@
giop_s->giopStreamList::insert(servers);
}
- if (remove) delete giop_s;
+ // if we destroy GIOP_S instance while working in it -> servant
+ // will dump core (eg. when CancelRequest received)
+ // and we won't be able startIdleCounter if we don't destroy giop_s
+ if (remove && giop_s->state() != IOP_S::WaitingForReply)
+ {
+ delete giop_s;
+ }
+ else
+ restart_idle = 0;
if (restart_idle && !biDir) {
CORBA::Boolean success = startIdleCounter();
More information about the omniORB-list
mailing list