Re: Windows Service hangs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Dan,
Thanks for your reply. To answer your questions I both listen and talk to
the serial port and I actually have a GUI app that uses the same code as my
Service. I never ran it long enough to make it crash though. My crash
(freeze) occurs very infrequently (recently it was 6 weeks) and only on one
particular computer. Actually in the past it was freezing every few hours
also. Maybe I should have changed the emphasis of my question to how to kill
the frozen service rather than why it freezes. If I can kill it then it will
be restarted automatically by another service. Right now I can't kill it by
using Process.Kill() nor manually from the command line nor through the Task
Manager nor can I stop it from the Services. The only way to stop it is to
reboot the computer. Apparently it is messed up big time. No exceptions are
ever being caught. Thanks again.
Kris.

"Dan Bass" wrote:

>
> Does your application "hang" when you run it as an application?
>
> Whenever I write a windows service application, there is a core section
> which exposes start and stop methods which exist in an assembly (DLL). From
> here I can apply any front end I like, whether it be windows service,
> windows dialog, or a console application.
> While doing any sort of debugging information, I flood the area I'm not sure
> about with Console.Writeline(...) calls so that the program flow can be
> easily traced, with details of relevant variables. In this case it would be
> worth checking the status of your references to your COM objects. Are you
> listening to a serial port or sending data to it?
>
> From here it seems unlikely it's the "windows service" part of the
> application that's causing the freeze.
>
> "Kris" <Kris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:6F604EB8-0697-4C2C-93F8-685110F793CE@xxxxxxxxxxxxxxxx
> >I have a Windows Service in C# talking to a serial port and using Remoting.
> > It also uses several COM objects. On customer's computer the service will
> > occassionally hang somewhere - the service still shows on a Task Manager
> > list. In Services it says it is still running. However there is no way to
> > stop it other than by rebooting the whole computer. No exception
> > (including
> > non-CLS) is ever generated. I added a separate System.Timers.Timer which
> > detects that the main thread stopped working. I was trying to stop it by
> > using System.ServiceProcess.ServiceController.Stop() which didn't work. I
> > tried to do process.Kill() which also doesn't work (and no exception). Is
> > there a bug in framework somewhere. I don't even hope to find out why it
> > hangs but if I could just kill it that would solve the problem since I
> > have
> > another Service which would bring it up. I'll be greatful for any ideas.
> > Kris.
>
>
>
.



Relevant Pages

  • Re: Windows Service hangs
    ... if it's on a windows 2000+ machine there's a handy utility called "kill". ... > the serial port and I actually have a GUI app that uses the same code as ... >>> tried to do process.Killwhich also doesn't work (and no exception). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Windows Service hangs
    ... In the past I was trying to terminate it by using kill ... from the command line which did not work. ... said there are just too many things that can go wrong - serial port, ... "Dan Bass" wrote: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Designing a protocol for the first time
    ... so waiting for an ack for the data ... you've sent will quickly kill you. ... If you put bytes into the serial port ... to pass larger chunks of data to the serial driver (ideally, ...
    (comp.arch.embedded)
  • Tiny terminal application
    ... So I can open the serial port, read data from it and log it to disk. ... My problem is now that, when I start a process on the embedded device, I ... the remote app. ... If the user wants to kill my app, ...
    (comp.os.linux.development.apps)
  • Windows service Rights question
    ... In writing a Windows service with .NET, I'm noticing that the process for ... I just wrote a test service and I can kill the process for this ...
    (microsoft.public.dotnet.languages.csharp)