Home All Groups Group Topic Archive Search About
Author
25 Jun 2009 6:50 PM
Frank Uray
Hi all

I have a little problem with debugging ...
I have build a application (MDI Container) with plugins,
and now, for some reason, after about 1h the applications
hangs, without error message ...

I have tried to debug in visual studio (attach process)
and I have seen the application is still running,
it seams just the GUI is blocked ...
But also when debugging, there is no exception rised ... ???

How can I find out what is happening ??
Any ideas?

Thanks for any comments

Frank Uray

Author
26 Jun 2009 3:12 AM
jp2msft
What do the plug-ins do? Are they COM objects? Maybe they are the cause.
Does your app have issues if the plug-in section of the code is commented
out?

Show quoteHide quote
"Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message
news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com...
> Hi all
>
> I have a little problem with debugging ...
> I have build a application (MDI Container) with plugins,
> and now, for some reason, after about 1h the applications
> hangs, without error message ...
>
> I have tried to debug in visual studio (attach process)
> and I have seen the application is still running,
> it seams just the GUI is blocked ...
> But also when debugging, there is no exception rised ... ???
>
> How can I find out what is happening ??
> Any ideas?
>
> Thanks for any comments
>
> Frank Uray
Are all your drivers up to date? click for free checkup

Author
26 Jun 2009 8:06 AM
Frank Uray
Hi

No, the PlugIns do not use COM,
but some of them are using Form.Invoke .

I am guessing there is a problem in one of the PlugIns,
but the question is, how can I find such errors ???

Best regards
Frank Uray

Show quoteHide quote
"jp2msft" wrote:

> What do the plug-ins do? Are they COM objects? Maybe they are the cause.
> Does your app have issues if the plug-in section of the code is commented
> out?
>
> "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message
> news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com...
> > Hi all
> >
> > I have a little problem with debugging ...
> > I have build a application (MDI Container) with plugins,
> > and now, for some reason, after about 1h the applications
> > hangs, without error message ...
> >
> > I have tried to debug in visual studio (attach process)
> > and I have seen the application is still running,
> > it seams just the GUI is blocked ...
> > But also when debugging, there is no exception rised ... ???
> >
> > How can I find out what is happening ??
> > Any ideas?
> >
> > Thanks for any comments
> >
> > Frank Uray
>
>
>
Author
27 Jun 2009 6:45 PM
jp2msft
My best advice would be to start dropping try...catch routines all through
your code:

try {
  // code
} catch (Exception err) {
  MessageBox.Show(err.ToString(), "Error at Line X"); // fill in the X
}

The ToString() method should tell you the line number (if you are in debug
mode) where the error occurred.

Start by making your try...catch routines encompass large sections of your
code, then narrow them down to smaller and smaller sections as you get your
bugs eliminated.

Personally, I even keep a try...catch block covering my main function:

[STAThread]
static void Main() {
  Application.EnableVisualStyles();
  Application.SetCompatibleTextRenderingDefault(false);
  try {
    Application.Run(new Form1());
  } catch (Exception err) {
    MessageBox.Show(err.ToString(), "Main() Error");
  }
}


Show quoteHide quote
"Frank Uray" wrote:

> Hi
>
> No, the PlugIns do not use COM,
> but some of them are using Form.Invoke .
>
> I am guessing there is a problem in one of the PlugIns,
> but the question is, how can I find such errors ???
>
> Best regards
> Frank Uray
>
> "jp2msft" wrote:
>
> > What do the plug-ins do? Are they COM objects? Maybe they are the cause.
> > Does your app have issues if the plug-in section of the code is commented
> > out?
> >
> > "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message
> > news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com...
> > > Hi all
> > >
> > > I have a little problem with debugging ...
> > > I have build a application (MDI Container) with plugins,
> > > and now, for some reason, after about 1h the applications
> > > hangs, without error message ...
> > >
> > > I have tried to debug in visual studio (attach process)
> > > and I have seen the application is still running,
> > > it seams just the GUI is blocked ...
> > > But also when debugging, there is no exception rised ... ???
> > >
> > > How can I find out what is happening ??
> > > Any ideas?
> > >
> > > Thanks for any comments
> > >
> > > Frank Uray
> >
> >
> >
Author
30 Jun 2009 8:54 AM
Frank Uray
Hello

Thanks again for your answer.

I have tried this try-catch within the main,
but it does not help, still the same problem ... :-((

The GUI is blocked, but I am able to debug (attach to process)
the application ... ??

Best regards
Frank Uray


Show quoteHide quote
"jp2msft" wrote:

> My best advice would be to start dropping try...catch routines all through
> your code:
>
> try {
>   // code
> } catch (Exception err) {
>   MessageBox.Show(err.ToString(), "Error at Line X"); // fill in the X
> }
>
> The ToString() method should tell you the line number (if you are in debug
> mode) where the error occurred.
>
> Start by making your try...catch routines encompass large sections of your
> code, then narrow them down to smaller and smaller sections as you get your
> bugs eliminated.
>
> Personally, I even keep a try...catch block covering my main function:
>
> [STAThread]
> static void Main() {
>   Application.EnableVisualStyles();
>   Application.SetCompatibleTextRenderingDefault(false);
>   try {
>     Application.Run(new Form1());
>   } catch (Exception err) {
>     MessageBox.Show(err.ToString(), "Main() Error");
>   }
> }
>
>
> "Frank Uray" wrote:
>
> > Hi
> >
> > No, the PlugIns do not use COM,
> > but some of them are using Form.Invoke .
> >
> > I am guessing there is a problem in one of the PlugIns,
> > but the question is, how can I find such errors ???
> >
> > Best regards
> > Frank Uray
> >
> > "jp2msft" wrote:
> >
> > > What do the plug-ins do? Are they COM objects? Maybe they are the cause.
> > > Does your app have issues if the plug-in section of the code is commented
> > > out?
> > >
> > > "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message
> > > news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com...
> > > > Hi all
> > > >
> > > > I have a little problem with debugging ...
> > > > I have build a application (MDI Container) with plugins,
> > > > and now, for some reason, after about 1h the applications
> > > > hangs, without error message ...
> > > >
> > > > I have tried to debug in visual studio (attach process)
> > > > and I have seen the application is still running,
> > > > it seams just the GUI is blocked ...
> > > > But also when debugging, there is no exception rised ... ???
> > > >
> > > > How can I find out what is happening ??
> > > > Any ideas?
> > > >
> > > > Thanks for any comments
> > > >
> > > > Frank Uray
> > >
> > >
> > >
Author
1 Jul 2009 2:37 AM
jp2msft
Hi Frank,

How exactly are you debugging? When I see "the GUI is blocked, but I am able
to debug" ...I get lost.

Are you stepping through your code in Visual Studio or are you using some
other programming tool?

Show quoteHide quote
"Frank Uray" wrote:

> Hello
>
> Thanks again for your answer.
>
> I have tried this try-catch within the main,
> but it does not help, still the same problem ... :-((
>
> The GUI is blocked, but I am able to debug (attach to process)
> the application ... ??
>
> Best regards
> Frank Uray
>
>
> "jp2msft" wrote:
>
> > My best advice would be to start dropping try...catch routines all through
> > your code:
> >
> > try {
> >   // code
> > } catch (Exception err) {
> >   MessageBox.Show(err.ToString(), "Error at Line X"); // fill in the X
> > }
> >
> > The ToString() method should tell you the line number (if you are in debug
> > mode) where the error occurred.
> >
> > Start by making your try...catch routines encompass large sections of your
> > code, then narrow them down to smaller and smaller sections as you get your
> > bugs eliminated.
> >
> > Personally, I even keep a try...catch block covering my main function:
> >
> > [STAThread]
> > static void Main() {
> >   Application.EnableVisualStyles();
> >   Application.SetCompatibleTextRenderingDefault(false);
> >   try {
> >     Application.Run(new Form1());
> >   } catch (Exception err) {
> >     MessageBox.Show(err.ToString(), "Main() Error");
> >   }
> > }
> >
> >
> > "Frank Uray" wrote:
> >
> > > Hi
> > >
> > > No, the PlugIns do not use COM,
> > > but some of them are using Form.Invoke .
> > >
> > > I am guessing there is a problem in one of the PlugIns,
> > > but the question is, how can I find such errors ???
> > >
> > > Best regards
> > > Frank Uray
> > >
> > > "jp2msft" wrote:
> > >
> > > > What do the plug-ins do? Are they COM objects? Maybe they are the cause.
> > > > Does your app have issues if the plug-in section of the code is commented
> > > > out?
> > > >
> > > > "Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message
> > > > news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com...
> > > > > Hi all
> > > > >
> > > > > I have a little problem with debugging ...
> > > > > I have build a application (MDI Container) with plugins,
> > > > > and now, for some reason, after about 1h the applications
> > > > > hangs, without error message ...
> > > > >
> > > > > I have tried to debug in visual studio (attach process)
> > > > > and I have seen the application is still running,
> > > > > it seams just the GUI is blocked ...
> > > > > But also when debugging, there is no exception rised ... ???
> > > > >
> > > > > How can I find out what is happening ??
> > > > > Any ideas?
> > > > >
> > > > > Thanks for any comments
> > > > >
> > > > > Frank Uray
> > > >
> > > >
> > > >
Author
30 Jun 2009 10:21 AM
Adam Benson
Not too sure what your app does so this may or may not be useful, but given
the symptoms you describe check for threads other than the UI thread trying
to perform UI operations.

If you can get a stack trace of all your threads and you see threads other
than the UI thread stuck in a UI call that's a dead give away. This can be
caused, for example, by an event handler enabling \ disabling a button or
control on the front end. If the handler is called, let's say, in response
to a network event then it will be raised on a non-UI thread. If it doesn't
marshall itself to the UI thread your app's going to hang.

HTH,

Adam.

Show quoteHide quote
"Frank Uray" <FrankU***@discussions.microsoft.com> wrote in message
news:5A407FF4-F6B8-426C-A176-4D58B958FDA2@microsoft.com...
> Hi all
>
> I have a little problem with debugging ...
> I have build a application (MDI Container) with plugins,
> and now, for some reason, after about 1h the applications
> hangs, without error message ...
>
> I have tried to debug in visual studio (attach process)
> and I have seen the application is still running,
> it seams just the GUI is blocked ...
> But also when debugging, there is no exception rised ... ???
>
> How can I find out what is happening ??
> Any ideas?
>
> Thanks for any comments
>
> Frank Uray

Bookmark and Share