What's causing this wait chain lock? - com

I have an application which calls a com library.
For certain reason the com library stops working. It doesn't hang, it just seems to be waiting for something.
My Application is waiting for the com library to respond too.
I checked the wait chain:
Can anyone tell me what might be causing this issue ?
Why the App.exe has no thread ID ?
Thank you

Related

VB.net windows service works fine when ran as an exe but does nothing when installed as service

I've created an SNMP listener application for one of our servers that runs as a service and passively listens for any SNMP message alerts sent from another server, and when one is received is sends out a page/email to appropriate staff. I followeda few online tutorials for setting up the application as a windows service since it needs to run constantly and won't require input/interaction from a user, or interaction with any GUI/desktop applications.
For some reason, when I install the application as a service, it installs correctly, but doesn't actually seem to be working. When SNMP messages are sent to the server nothing happens. However, in my app.publish folder there's an SNMPTrapper.exe application,and if I run that exe on its own, then everything works fine. For the time being I'm using a workaround so that the Onstart section of the code for the service basically just launches the SNMPTrapper.exe application, and when the service is stopped, it finds and kills the SNMPTrapper.exe process. At this point though, the service itself doesn't seem to be working/doing anything. It's essentially just a way to get the SNMPTrapper.exe application launched.
Does anyone know what the issue may be? In some of the tutorials I've read through they outline how to setup polling intervals for the service, but I don't think that would be applicable since this service will essentially just run constantly to listen for new messages, it won't need to check for anything at a regular interval.
Right now pretty much all of my code is executed in Sub Main() except for a few function calls.
Any help would be greatly appreciated.
You don’t state how you’re doing any of this. For a windows service you get two messages from the system: OnStart and OnStop. The job of OnStart is to set up all the required code to do the job, then exit. It doesn’t take part in the work so you need a Task or Thread setting up to do that. The Task or Thread should loop until it gets a message, passed by OnStop, that we’re done. If you want a service that you can test from the command line then your Main routine needs to do exactly the same setup, then wait for a key to be pressed before sending an OnStop.
(As an aside, you ARE remembering to start the service once you have installed it?)

weblogic stop writing logs and shutdown

Maybe someone had the same problem.
I use Weblogic at work. So, we have two small applications on it. And today it stopped writing logs(all logs stopped writing at the same time). Then, after three hours it writes in log “JVM called WLS shutdown hook. The server will force shutdown now” and shutdown. After start everything works fine.
But I want to understand, why this situation happened
Thanks
This happens when System.exit(int) is called. Check if some of the deployed components call System.exit instead of throwing an Exception. This also can be due to the JVM taking up the OS signals.Set the -Xrs option in the startup scripts in JAVA_OPTIONS if you are using Sun JDK.It reduces use of operating-system signals by the JVM.

Dll injection not working in suspended process

I'm using CreateRemoteThread api to inject a dll into a process. This works when the process is running state. But If I launch a process in suspended state using CreateProcess api and try to inject a dll into it, then dll injection is not working. But If I use createprocess without suspended flag, then I can able to inject the dll.
Can anyone tell me the solution of this problem?
I meet the similar case. Not know the exact root cause, I suggest you to try to use QueueUserAPC api to do the injection.
It can not work because creating a process with suspended flag,it loads only ntdll.dll.
kernal32.dll is not loaded yet, so you can not use createprocess to call LoadLibrary(in the kernal32.dll) in the remote suspended process.
but you can use LdrLoadDll(in the ntdll.dll) instead.
you can also use QueueUserAPC with LdrLoadDll ,too. it will works well~

HttpWebRequest.EndGetResponse hangs periodically when debugger attached to Unity editor

For various reasons I need to use HttpWebRequest instead of the built-in WWW class to call out to web services in our Unity project. I'm finding that Request.EndGetResponse hangs under certain circumstances. The issue is exacerbated when the debugger is attached--it does happen from time to time without the debugger, but happens close to 100% of the time when the debugger is attached. It is only happening when I'm calling a web service using HTTPS.
I plugged in Wireshark to look at the two traces. Oddly, the trace when the debugger is attached includes a "Handshake Failure" where the trace without the debugger does not. The other interesting thing is that the trace that works includes two [FIN, ACK] messages presumably from other failed attempts.
Ultimately I think I'm running into some known issues with the Mono 2.6 threadpool. That said, I don't understand what EndGetResponse is doing that could cause it to hang--I thought this was a synchronous operation. I also don't understand how attaching the debugger could affect the issue.
If there are any mono experts out there, I'd appreciate any insight!

AccessViolationException and Faulting module: What is causing this exception? Is it the faulting module?

If an AccessViolationException occurs, does the faulting module related to it mean that it's a bug in that module, which in our case happens to be one of our third-party DLLs? Or is this much more complicated problem? We have contacted the makers of this module but they haven't found any bug, just suggesting possible stack corruption what ever that means. However, according to the event log a particular faulting module is always associated with the AccessViolationException. So what's truth about this? Is it a buggy third-party DLL module or something else?
Background
We're using a mutex-protected VB6 STA COM object in a .NET WCF web service running on IIS 7. Lately we have detected random System.AccessViolationException errors (caused by this object) crashing the web service completely and we're pretty helpless at the moment as we've done everything to make this COM object work with the web service. The service itself has been set to run in STA mode using the following guide: (http://scottseely.com/2009/07/17/calling-an-sta-com-object-from-a-wcf-operation/
Thanks
This is possibly related to VB6 run-time leaking upon thread termination. VB6 ActiveX DLL projects have options for "Unattended execution" and "Retain in memory" that try to mitigate these issues by keeping the run-time on a STA thread as long as possible. Ask your vendor if these options are applicable to their component.
In either case best would be to keep those STA threads from terminating, implementing a pool of them (or serializing on a single STA thread), so that VB6 run-time does not try to tear-down it's internal structures at any time (and leak handles/memory/TLS doing it).
Search for using VB6 components under COM+/MTS, might find valuable advice. And best of luck!