Bug 1150

Summary: blocking with oneway
Product: TAO Reporter: Nanbor Wang <bala>
Component: ORBAssignee: Simon McQueen <sm>
Status: RESOLVED DUPLICATE    
Severity: normal CC: gruetzmacher
Priority: P3    
Version: 1.2.1   
Hardware: x86   
OS: Windows NT   
Attachments: Sample

Description Nanbor Wang 2002-02-15 09:49:15 CST
TAO VERSION: 1.2.1
 ACE VERSION: 5.2.1

    HOST MACHINE and OPERATING SYSTEM: WinNT 4.0 SP 6
    COMPILER NAME AND VERSION (AND PATCHLEVEL): MSVC 6.0 SP 5

    AREA/CLASS/EXAMPLE AFFECTED:
My application is hanging in a oneway call.

    DESCRIPTION:
I've written a simple server/client set (already send to this list some
times).
Server is waiting for a client which is registering it's callback function
(oneway) which will be called endless.

    REPEAT BY:
Unpack attached example.
Open server and client project in separate Visual Studio instances.
Compile (client with debug infos).
Set WorkingDir of both applications to the same Dir (in the example the dir
with the svc.conf .
Start Server (the IOR string will be written to a file in the working dir) -
Wait for message "Ready on ORB".
Start Client (it should read the ior file and try to connect the server).
Now the server should write "Send Message XXX" and the client too - the
communication is established successfull.
Set a breakpoint somewhere in the client callback implemetation CallTest
(client.cpp).
The server keeps sending messages but only further around 1900 messages -
than the server stops.
If you now remove the breakpoint and continue the execution the server go
back to sending.
But if I stop the debugging of the client instead of continue execution the
server is unrecoverable blocked. I can restart the client and I see "Client
connected" but the server sending thread is hanging in ace\os.i:6031 :
				ACE_SOCKCALL_RETURN (::select (width,
                                 (ACE_FD_SET_TYPE *) rfds,
                                 (ACE_FD_SET_TYPE *) wfds,
                                 (ACE_FD_SET_TYPE *) efds,
                                 timep),
                       int, -1);

    SAMPLE FIX/WORKAROUND:
	see attached.
Comment 1 Nanbor Wang 2002-02-15 09:50:31 CST
Created attachment 107 [details]
Sample
Comment 2 Nanbor Wang 2002-02-16 07:34:44 CST
Just accepting the bug
Comment 3 Simon McQueen 2002-07-16 07:12:40 CDT
Taken.
Comment 4 Simon McQueen 2002-07-26 08:07:22 CDT
Accepting.
Comment 5 Simon McQueen 2002-08-08 04:33:53 CDT
This problem no longer exists following the fix to bug #1222. 

The deceptively named 'server' in the supplied example now receives an 
appropriate system exception when the 'client' (receiving the oneway calls) is 
killed. 

Thanks to Carlos O'Ryan for the tip off re this. 

One point of minor note is that using the method described in the bug report to 
close the connection (blocking the 'client' with a breakpoint and then ending 
the debug session) causes the process to exit with a horrorific exception in 
VC++ the *second* time you do it. This seems to be a peculiarity of the IDE 
debugger only as it does not occur when simulating the same situation any other 
way.

*** This bug has been marked as a duplicate of 1222 ***