Windows service / A new guard page for the stack cannot be created

后端 未结 4 1541
青春惊慌失措
青春惊慌失措 2021-01-04 03:41

I have a windows service that does some intensive work every one minute (actually it is starting a new thread each time in which it syncs to different systems over http). Th

4条回答
  •  死守一世寂寞
    2021-01-04 03:47

    Based on the information that you provided, I would at least, at the minimum, do the following:

    1. Pay extra attention to any third party calls, and add additional info logging around those points.
    2. There are some circumstances in which AppDomain.CurrentDomain.UnhandledException won't help you - a StackOverflowException being one of them. I believe the CLR will simply just give you a string in this case instead of a stack trace.
    3. Pay extra attention around areas where more than one thread is introduced.

    An example of an often overlooked StackOverflowException is:

    private string myString;
    public string MyString { get { return MyString; } }  //should be myString
    

提交回复
热议问题