Server throws AccessViolation Error when started up

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sendil kumar
    New Member
    • Sep 2007
    • 26

    Server throws AccessViolation Error when started up

    I'm a software tester. My recent task is to test the exposed methods of our C# server which is using WCF as communication layer.

    I wrote a piece of C# code to tets our server. for one of the test, I had to test whether the server is throwing up AddressAlreadyU sed exception when multiple instance of the server is started up.

    Ex, my pseudocode
    while(till count reaches a limit)
    {
    Process.Start(" server info);
    }

    During the execution, many instance of the server was started up and it throwed AddressAlreadyU sed exception as expected. But, for some server instance it throwed up an AccessViolation exception.

    ex code
    21-Jul-2009 15:26:32.71 Error: Unhandled Exception: System.AccessVi olationExceptio n: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at sFabServer.retu rnEntry(sFabSer ver* , sTString<char>* )
    at SSM.BCT.Legacy. FabServerConfig .ReturnEntry(St ring name)
    at SSM.BCT.Process Server.Server.S erverContext..c tor(ProcessServ erConfig config,

    Can any one let me know why this was thrown up and is there any un-safe code/thread in the server that spaned up but not killed?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    I would guess it has to do with one of the Servers being at a certain state when the next one called.
    Try doing a thread sleep in your loop and see if that lowers the number that produce AccessViolation s?

    Comment

    • Sendil kumar
      New Member
      • Sep 2007
      • 26

      #3
      Hi Platter,

      Thanks for your reply. I will try your suggestion.

      I have a question.

      I just wondered about what this "System.Runtime .InteropService s.SEHException: External component has thrown an exception." could be, which was thrown for this scenario). Going through the internet related to this error, I came across some people complaining about similar problem and found out that the issue was because of the CLR of the dotnet.

      link:


      I'm not sure about this because those people are using com components which is not in our case, but we are making a call to unmanaged C++ from our C#.
      So do you think that this could be a reason for this problem?

      We are using CLR version 3.5, but the problem was reported against CLR 2.0.
      Is the CLR 3.5 also contains same problem?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        unmanaged code can be considered a COM object for these purposes I think

        Comment

        • Sendil kumar
          New Member
          • Sep 2007
          • 26

          #5
          Hi Plater,

          I tried your suggestion, introduced a sleep between the subsequent calls of the server, surprisingly the problem didn't occur with this scenario.

          So, What could be the problem? Is it my code?

          Thanks,
          Sendil

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            What object you are starting, is in the middle of "starting up" when the next one tries to start. Since the first one hasn't finished "starting up", it hasn't finished releasing its startup data (which is also probably used in the next object's startup). Depending on how far the first one has gotten at starting up could change the exception you are receiving. (AccessViolatio n vs AddressInUse)
            You could maybe try to put a mutex around the data that is used in startup, but I am rather unfamiliar with how all that works

            Comment

            Working...