Log4net
  1. Log4net
  2. LOG4NET-265

RemoteFileAppender Tests fail on Windows 7

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.11
    • Component/s: Appenders
    • Labels:
      None
    • Environment:
      Windows 7 32bit

      Description

      Compiled the version of log4net in the repository and ran the unit tests. All of the RemotingAppenderTests fail. Enabling internal logging gives the following error.

      log4net:ERROR [RemotingAppender] ErrorCode: GenericFailure. Failed in SendBufferCallback
      System.Runtime.Serialization.SerializationException: Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed. ---> System.Security.SecurityException: Request failed.
      at System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)
      at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
      The action that failed was:
      Demand
      The type of the first permission that failed was:
      System.Security.Permissions.SecurityPermission
      The first permission that failed was:
      <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      version="1"
      Flags="Infrastructure"/>

      The demand was for:
      <PermissionSet class="System.Security.PermissionSet"
      version="1">
      <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      version="1"
      Flags="Infrastructure"/>
      </PermissionSet>

      The only permitted permissions were:
      <PermissionSet class="System.Security.PermissionSet"
      version="1">
      <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      version="1"
      Flags="SerializationFormatter"/>
      </PermissionSet>

      The method that caused the failure was:
      System.Runtime.Remoting.Channels.ServerProcessing ProcessMessage(System.Runtime.Remoting.Channels.IServerChannelSinkStack, System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Channels.ITransportHeaders, System.IO.Stream, System.Runtime.Remoting.Messaging.IMessage ByRef, System.Runtime.Remoting.Channels.ITransportHeaders ByRef, System.IO.Stream ByRef)

        Activity

        Hide
        Stefan Bodewig added a comment -

        I was at the point of "the first test always fails" without your changes, likely because of the .NET 4.0 security related changes made to trunk earlier. It turned out to be a timing issue and making the tests wait a bit longer fixed the problem.

        Tests pass for me using trunk svn revision 1166042.

        Show
        Stefan Bodewig added a comment - I was at the point of "the first test always fails" without your changes, likely because of the .NET 4.0 security related changes made to trunk earlier. It turned out to be a timing issue and making the tests wait a bit longer fixed the problem. Tests pass for me using trunk svn revision 1166042.
        Hide
        Rob Prouse added a comment -

        Further testing of my patch, it looks like it is not the FullFixTest that is the problem, it seems that the first event to get logged gets lost. If I disable the FullFixTest, then the next test fails.

        Show
        Rob Prouse added a comment - Further testing of my patch, it looks like it is not the FullFixTest that is the problem, it seems that the first event to get logged gets lost. If I disable the FullFixTest, then the next test fails.
        Hide
        Rob Prouse added a comment - - edited

        Patch that gets all of the tests passing except the FullFixTest. Needed to set the TypeFilterLevel on the server formatting provider in the test remoting receiver to TypeFilterLevel.Full.

        Show
        Rob Prouse added a comment - - edited Patch that gets all of the tests passing except the FullFixTest. Needed to set the TypeFilterLevel on the server formatting provider in the test remoting receiver to TypeFilterLevel.Full.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rob Prouse
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3h
              3h
              Remaining:
              Remaining Estimate - 3h
              3h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development