Answered by:
Threads seem to be stuck on System.Xml.NameTable.Add

Question
-
Re-posting here from XML forum, hoping someone will help me:
Basically 4 threads in a dllhost process seem to have preemptive GC disabled and the threads are stuck forever. They all seem to be stuck on the same call:
System.Xml.NameTable.Add(Char[], Int32, Int32)
This runs in a COM+ process implemented as a C# service activator.
More details on the question:
Thanks
Friday, October 28, 2011 9:13 PM
Answers
-
Hi,
i didn't see any code to create any thread to work for XML read&write.
It seems that it is related to DOM&IIS develoment. I suggest you post in IIS Forum to get better support.
Thank you for your posting and understanding.
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, December 29, 2011 10:49 PM
Tuesday, November 1, 2011 7:39 AM -
This was moved out of the .NET forum.
You can ask this in an IIS forum (as suggested).
Or I can move it into a specific MSDN forum if you'd like.
This is regarding your call:
System.Xml.NameTable.Add(Char[], Int32, Int32)
Ed Price a.k.a User Ed, Microsoft Experience Program Manager (Blog, Twitter, Wiki)- Proposed as answer by Ed Price - MSFTMicrosoft employee Thursday, December 29, 2011 10:50 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, December 29, 2011 10:50 PM
Thursday, December 29, 2011 10:50 PM
All replies
-
Hi,
It seems that it is hard to reproduce this issue. The first thing come out to my mind is that you did not close threads in a correct way.
Could you please provide some more code snippet that how you create threads and what you did in the threads?
Thank you for your posting and understanding.
Have a nice day.
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Monday, October 31, 2011 7:57 AM -
Thanks for offering to take a look.
The call is initiated from component A which runs as a COM+ application. A is implemented in unmanaged C++:
STDMETHODIMP CTpsServerTrampoline::processRequest(BSTR id, LONG nnpi, BSTR xmlRequest, BSTR* xmlResponse)
{
// Create an instance of the TPS server implementation component
HRESULT hr, hr1;
switch (nnpi)
{
// Use the PlanAPI
case NNPI_PLANAPI:
{
// Create the object and call if successful
CComPtr<IPlanServer2> pPlanServer;
hr = pPlanServer.CoCreateInstance(id);
if (SUCCEEDED(hr))
hr1 = pPlanServer->processRequest(xmlRequest, xmlResponse);
break;
}
IPlanServer2 interface is implemented by Component B. B is also a COM+ application, but is implemented as C#.
namespace NaviMedix.NaviNet.TradingPartner.Horizon.ServiceActivator
{
/// <summary>
/// ServiceActivator needed for the time being so a next gen application can be displayed in core.
/// </summary>
[ComponentAccessControl(false)]
[Transaction(TransactionOption.Supported)]
[Guid("DBD6DDA4-D774-4DB5-9A98-96ED982FF1E6")]
public class HorizonNextGenServiceActivator : ServicedComponent, IServiceActivator, IPlanServer2
{
//...
//...
public static XmlReferenceFile PlanCentralTransformFile
{
get { return Application.GetConstant<XmlReferenceFile>("TPPlanCentralTransformFile"); }
}
public string processRequest(string xmlRequest)
{
try
{
// Load the request into a docuemnt, so we can look at it.
XmlDocument requestDoc = new XmlDocument();
requestDoc.LoadXml(xmlRequest);
string requestType = UtilityServiceConfig.GetRequestType(requestDoc);
switch(requestType)
{
case "ProcessServiceConfig":
return UtilityServiceConfig.LoadProcessServiceConfigResponse(requestDoc);
case "GetPlanCentralInfo":
return ProcessGetPlanCentralInfoRequest(requestDoc);
default:
throw new ApplicationException(string.Format("Unknown/unhandled request type: {0}", requestType));
}
}
catch (Exception exception)
{
UtilityTPBaseException.HandleActivationException(exception, new FrameData("XmlRequest", xmlRequest));
throw;
}
}
//...
protected string ProcessGetPlanCentralInfoRequest(XmlDocument requestDoc)
{
//...
XmlDocument responseDoc = GetPlanCentralInfoResponseWithPermissions(userID, officeID, officeClassification);
//...
}
private static XmlDocument GetPlanCentralInfoResponseWithPermissions(string userID, string officeID, CurrentOffice.OfficeClassificationValue officeClassification)
{
// We can now get the capabilities that this user/office is configured to have.
UserOfficeCapabilities userOfficeCapabilities = new UserOfficeCapabilities(Int32.Parse(userID), Int32.Parse(officeID));
//get transform document
XPathDocument transformDoc = PlanCentralTransformFile.Read<XPathDocument>();
//...
}
The line where the error starts -> XPathDocument transformDoc = PlanCentralTransformFile.Read<XPathDocument>();
This is the line corresponding to the line of the callstack -0156e9e8 1b672676 NaviMedix.Kernel.Xml.Type.XmlReferenceFileBase.Read[[System.__Canon, mscorlib]]()
This is the call flow - the threads essentially are spun up from component A, which has as its registration script:
ProgID = s 'NaviNetPublic.TpsServerTrampoline.1'
VersionIndependentProgID = s 'NaviNetPublic.TpsServerTrampoline'
ForceRemove 'Programmable'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Both'
}
'TypeLib' = s '{3FE621E4-1647-43AA-9060-9F54091E0662}'
Please let me know if any other code/details are required.Thanks
- Edited by raxraja Monday, October 31, 2011 1:59 PM edit
Monday, October 31, 2011 1:58 PM -
Few more details:
The original call starts on a webserver on a separate box (i.e. on a thread in IIS). This is implemented in managed code (VB.NET). This thread then uses a COM+ object on the box. This COM+ object (which is also implemented as managed VB.NET), makes a call to another COM+ object (which is unmanaged C++).
This object finally makes a remote DCOM call to the component A given in the post above. So component A actually lives on a separate box from where the original call is made.
- Edited by raxraja Monday, October 31, 2011 2:28 PM
Monday, October 31, 2011 2:27 PM -
Hi,
i didn't see any code to create any thread to work for XML read&write.
It seems that it is related to DOM&IIS develoment. I suggest you post in IIS Forum to get better support.
Thank you for your posting and understanding.
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, December 29, 2011 10:49 PM
Tuesday, November 1, 2011 7:39 AM -
This was moved out of the .NET forum.
You can ask this in an IIS forum (as suggested).
Or I can move it into a specific MSDN forum if you'd like.
This is regarding your call:
System.Xml.NameTable.Add(Char[], Int32, Int32)
Ed Price a.k.a User Ed, Microsoft Experience Program Manager (Blog, Twitter, Wiki)- Proposed as answer by Ed Price - MSFTMicrosoft employee Thursday, December 29, 2011 10:50 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, December 29, 2011 10:50 PM
Thursday, December 29, 2011 10:50 PM