Bug 3914 - Fix to bug 3913 causes an exception when running the Quoter sample
Summary: Fix to bug 3913 causes an exception when running the Quoter sample
Status: NEW
Alias: None
Product: CIAO
Classification: Unclassified
Component: DAnCE (show other bugs)
Version: 0.8.2
Hardware: x86 other
: P3 normal
Assignee: DOC Center Support List (internal)
URL:
Depends on:
Blocks:
 
Reported: 2010-10-15 14:21 CDT by manjula
Modified: 2010-10-28 13:29 CDT (History)
2 users (show)

See Also:


Attachments
The log file. (153.44 KB, application/octet-stream)
2010-10-15 14:21 CDT, manjula
Details
The log file after setting debug levels to 10 (208.29 KB, application/octet-stream)
2010-10-15 17:14 CDT, manjula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description manjula 2010-10-15 14:21:49 CDT
Created attachment 1326 [details]
The log file.

The given patch in bug 3913 fixes that issue. But at the end of the applications it causes an unexpected termination in the locality manager during the teardown phase. Attached is the log.
Comment 1 Will Otte 2010-10-15 14:24:50 CDT
Does this occur without your interceptor installed?
Comment 2 manjula 2010-10-15 15:01:45 CDT
This doesn't occur when interceptor is not installed. Actually this occurs when ::CORBA::ORB_init() is there in the interceptor. 

According to the following log portion problem occurs when StockDistributor stop publishing Quotes.


The application as a whole is now started. Lets subscribe and unsubscribe some stock
Start the Stock Distributor by invoking 'StockDistributorDriver -o -r 1'
Start up the Distribution service
Now subscribe to MSFT by invoking 'StockBrokerDriver -s MSFT'
StockBroker_exec_i::stock_subscribe - subscribe to <MSFT>
Subscribe successful!
Now subscribe to IBM by invoking 'StockBrokerDriver -s IBM'
StockBroker_exec_i::stock_subscribe - subscribe to <IBM>
Subscribe successful!
Now subscribe to invalid stock by invoking 'StockBrokerDriver -s CIAO'
StockBroker_exec_i::stock_subscribe - <CIAO> not found. Throw Invalid_Stock exception.
Invalid stock exception.
Now UNsubscribe to IBM by invoking 'StockBrokerDriver -u IBM'
StockBroker_exec_i::stock_unsubscribe - unsubscribe <IBM>
Unsubscribe successful!
Stop the Distributor by invoking 'StockDistributorDriver -f'
Stop the Distribution service
ERROR: C:\research\cuts-thirdparty\doc-middleware\Latest_Micro\ACE_wrappers\TAO\CIAO/tutorials/Quoter/Simple/lib/StockDistributorDriver timedout
We're done. Stop the application now by invoking the plan_launcher again
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Invoking executor - stop the application -
Comment 3 Johnny Willemsen 2010-10-15 15:19:16 CDT
Why should an interceptor do an init, wouldn't expect that in an interceptor
Comment 4 Will Otte 2010-10-15 15:23:11 CDT
From an out-of-band email from James:

In short, we are trying to plugin into the ACE logging facilities and intercept log messages so we can store them in a offline server. To do this, we have a server that run on another machine and we use CORBA as the communication medium for sending messages to the logging server. When the ACE-based service is loaded by the service configurator, it initializes an ORB based on the services parameters provided in svc.conf. Some of the parameters include the location of the logging service, number of threads to use in the ORB, delay time for sending messages to server, and number of messages to include when communicating with the logging server.

In the past, we have used a separate ORB to handle the needs of the ACE logging interceptor so as not to disturb the main ORB that application is using.
Comment 5 Will Otte 2010-10-15 15:40:48 CDT
It wouldn't surprise me if the interceptor installed by the user is being destroyed too late in the game.  In prior versions of DAnCE, there were lots of memory leaks and things weren't cleaned up properly.  Now that we're cleaning up better, it may be that the ORB pointer being held by the interceptor is invalid when the service object is cleaned up by ACE.  

Would it be possible for you to get a stack trace Manjula?
Comment 6 manjula 2010-10-15 16:06:25 CDT
The stack trace does not contain high level calls. But it is a problem with the memory cleanup. 

>	msvcr90d.dll!_NMSG_WRITE(int rterrnum=10)  Line 198	C
 	msvcr90d.dll!abort()  Line 59 + 0x7 bytes	C
 	msvcr90d.dll!terminate()  Line 130	C++
 	dance_locality_manager.exe!__CxxUnhandledExceptionFilter(_EXCEPTION_POINTERS * pPtrs=0x01cff0e8)  Line 70	C++
 	kernel32.dll!764c2c2a() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	msvcr90d.dll!_getptd_noexit()  Line 618	C
 	msvcr90d.dll!66975bf7() 	
 	00000001()	
 	KernelBase.dll!75c39617() 	
 	KernelBase.dll!75c39617() 	
 	KernelBase.dll!75c39617() 	
 	ACEd.dll!ACE_OS::memcpy(void * t=0x00000000, const void * s=0x668dbb8c, unsigned int len=0)  Line 42 + 0x11 bytes	C++
 	TAOd.dll!CORBA::MARSHAL::~MARSHAL() 	Unknown
Comment 7 Will Otte 2010-10-15 16:28:58 CDT
That would tend to validate my theory.  I'm inclined to believe that this isn't a bug in DAnCE, but is a problem in the interceptor code.  

Could you provide a log of just a single node, with ORB Debug and DAnCE debug set at 10?
Comment 8 manjula 2010-10-15 17:14:07 CDT
Created attachment 1327 [details]
The log file after setting debug levels to 10

The log file for node distributor is attached. This is after setting the log levels to 10.
Comment 9 Will Otte 2010-10-15 17:17:45 CDT
Please also set DANCE_LOG_LEVEL=10, in addition to the ORB debugging.  
Comment 10 manjula 2010-10-15 17:34:50 CDT
That log was generated after creating DANCE_DEBUG_LEVEL to 10.
Comment 11 Will Otte 2010-10-16 01:21:28 CDT
Ahh.  I see.  

That log seems to indicate that the locality manager process crashes during 'application' run-time, and not when things are tearing down.  
Comment 12 manjula 2010-10-16 06:46:33 CDT
Yeah. I corrected this in my second comment. Seems to me the problem occurs when any of the application's ORB destroying. Actually I ran the application after commenting out the destroy_orb() statements of applications but problem was still there. I also commented out destroy_orb() in localitiy_manager but no success.
Comment 13 Johnny Willemsen 2010-10-28 13:29:27 CDT
can you check all code whether there is a try/catch around each corba call, seems a corba exception is thrown but never caught