StackOverflowException when pressing a specific button on certain computers
-
G'day people, I was wondering if I could get a point in the right direction on how to squash a bug. The app I am writing is basically a control panel type thing, and it brings up notification boxes if something needs to be actioned. On certain computers, if the user clicks "Snooze All" in the notification box, the application crashes with a StackOverflowException. All the "Snooze All" button is doing is manipulating DataTables and closing the notification box. I was originally wondering if it was a DLL issue, but I can't see why it would happen whilst running - not opening or closing any forms at all! The error information is listed below.
Problem Event Name: CLR20r3
Problem Signature 01: afns gui 3.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4fe2c742
Problem Signature 04: System.Windows.Forms
Problem Signature 05: 4.0.0.0
Problem Signature 06: 4da3cf4e
Problem Signature 07: 3e23
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 3081
Additional Information 1: c51c
Additional Information 2: c51c01e8afa2e7706a621e0a166b392d
Additional Information 3: a841
Additional Information 4: a841e87d6b8fde0994c2a1134b39ab43 -
G'day people, I was wondering if I could get a point in the right direction on how to squash a bug. The app I am writing is basically a control panel type thing, and it brings up notification boxes if something needs to be actioned. On certain computers, if the user clicks "Snooze All" in the notification box, the application crashes with a StackOverflowException. All the "Snooze All" button is doing is manipulating DataTables and closing the notification box. I was originally wondering if it was a DLL issue, but I can't see why it would happen whilst running - not opening or closing any forms at all! The error information is listed below.
Problem Event Name: CLR20r3
Problem Signature 01: afns gui 3.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4fe2c742
Problem Signature 04: System.Windows.Forms
Problem Signature 05: 4.0.0.0
Problem Signature 06: 4da3cf4e
Problem Signature 07: 3e23
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 3081
Additional Information 1: c51c
Additional Information 2: c51c01e8afa2e7706a621e0a166b392d
Additional Information 3: a841
Additional Information 4: a841e87d6b8fde0994c2a1134b39ab43Without knowing more about exactly what is happening, you and I are in the same boat - it could be anything. I would start by looking at the computers: is there anything specific to the computers it crashes on, that is not applicable to those it doesn't? Does it happen every time? If not, when does it happen? Occasionally? Often? Very rarely? To a particular user? OS? Network segment? Basically, you need more info. If you can get it to happen reliably, then insert logging code to try to track the path it is taking, and look for oddities in the log. I know all this is basic stuff, and I'm probably teaching my Granny to suck eggs, but with the information so far, all I can suggest is generalities.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
Without knowing more about exactly what is happening, you and I are in the same boat - it could be anything. I would start by looking at the computers: is there anything specific to the computers it crashes on, that is not applicable to those it doesn't? Does it happen every time? If not, when does it happen? Occasionally? Often? Very rarely? To a particular user? OS? Network segment? Basically, you need more info. If you can get it to happen reliably, then insert logging code to try to track the path it is taking, and look for oddities in the log. I know all this is basic stuff, and I'm probably teaching my Granny to suck eggs, but with the information so far, all I can suggest is generalities.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
Basically in one room the office is shared by 8 computers. On 7/8 computers the application crashes when the snooze button is hit. This doesn't write anything back to the SQL Server, only to local DataTables. Only one of them works correctly, all are up to date with Windows Updates. It appears to be computer related, as when I use my local user account (I haven't tried my domain administrator account) it carries the same error. I use the same login on my Developer PC (I know, not a good test) and it works fine. I have a rough idea of where it fails, but I have no experience with StackOverflowExceptions, so where do I go from there?
-
Basically in one room the office is shared by 8 computers. On 7/8 computers the application crashes when the snooze button is hit. This doesn't write anything back to the SQL Server, only to local DataTables. Only one of them works correctly, all are up to date with Windows Updates. It appears to be computer related, as when I use my local user account (I haven't tried my domain administrator account) it carries the same error. I use the same login on my Developer PC (I know, not a good test) and it works fine. I have a rough idea of where it fails, but I have no experience with StackOverflowExceptions, so where do I go from there?
If you can't use visual studio I would wrap the method call in your button click with a try { }catch (StackOverflowException e){\\log the error message and stacktrace } (if any try catch blocks are inside the method calls log there also) If you can use visual studios to debug and replicate the exception then go to the menu "debug>exceptions" and in the window that comes up expand "Common Language Runtime Exceptions" and then expand "System" and find StackOverflowException and then check the check box under "thrown". This will take you right to the line throwing the exception when using the debugger. Before you stop the debugger you can look at your locals window to see current values of any variables. Hope that helps...
-
Basically in one room the office is shared by 8 computers. On 7/8 computers the application crashes when the snooze button is hit. This doesn't write anything back to the SQL Server, only to local DataTables. Only one of them works correctly, all are up to date with Windows Updates. It appears to be computer related, as when I use my local user account (I haven't tried my domain administrator account) it carries the same error. I use the same login on my Developer PC (I know, not a good test) and it works fine. I have a rough idea of where it fails, but I have no experience with StackOverflowExceptions, so where do I go from there?
If it is that easy to duplicate, then you need to know what is using the stack. Add logging code which just adds to a DB or a file saying which method has been entered - start with the ones directly called by the snooze button. You are looking for a repeating pattern: MethodA calls MethodB calls Method A indirectly, or similar. That is the most common way to get stack overflow - recursive calls without a termination check. (There are other ways, by they are a lot harder to organise).
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
-
G'day people, I was wondering if I could get a point in the right direction on how to squash a bug. The app I am writing is basically a control panel type thing, and it brings up notification boxes if something needs to be actioned. On certain computers, if the user clicks "Snooze All" in the notification box, the application crashes with a StackOverflowException. All the "Snooze All" button is doing is manipulating DataTables and closing the notification box. I was originally wondering if it was a DLL issue, but I can't see why it would happen whilst running - not opening or closing any forms at all! The error information is listed below.
Problem Event Name: CLR20r3
Problem Signature 01: afns gui 3.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4fe2c742
Problem Signature 04: System.Windows.Forms
Problem Signature 05: 4.0.0.0
Problem Signature 06: 4da3cf4e
Problem Signature 07: 3e23
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 3081
Additional Information 1: c51c
Additional Information 2: c51c01e8afa2e7706a621e0a166b392d
Additional Information 3: a841
Additional Information 4: a841e87d6b8fde0994c2a1134b39ab43Why don't you look at (and/or show us) the relevant code, starting at the button's Click handler that starts the trouble? The most popular way to create a StackOverflowException is by having a property call itself, i.e. doing something like:
private int counter;
public int Counter {
get {
if (some_error_condition) MessageBox.Show("Can't comply, however the counter's value equals "+Counter);
return counter;
}The mistake here is the upper-case Counter inside the Show method. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
Why don't you look at (and/or show us) the relevant code, starting at the button's Click handler that starts the trouble? The most popular way to create a StackOverflowException is by having a property call itself, i.e. doing something like:
private int counter;
public int Counter {
get {
if (some_error_condition) MessageBox.Show("Can't comply, however the counter's value equals "+Counter);
return counter;
}The mistake here is the upper-case Counter inside the Show method. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
It was PEBCAK. Somehow I ended up with this.Close in the FormClosing event - And for some reason even stranger, it worked on some computers and not others!
OK, I never had that one before, but it basically is the same (although one might hope Windows would include a safeguard against that). The difference amongst systems might be due to timing differences (they don't play by the book exactly when the process is exiting anyway); or just perhaps some Service Pack just added a safeguard! If you ever find out, please let us know. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum