OverlappedAsyncResult what class uses this?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Muscha

    #1

    OverlappedAsyncResult what class uses this?

    Hello,

    I have the following exception in my app, have been chasing it up for the
    past few days none to avail. Help does anyone know what this may be?

    Unhandled Exception: System.IO.IOExc eption: Unable to read data from the
    transpo
    rt connection. ---> System.ObjectDi sposedException : Cannot access a disposed
    obj
    ect.
    at System.Threadin g.ManualResetEv ent.Reset()
    at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
    --- End of inner exception stack trace ---
    at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
    at System.Net.Lazy AsyncResult.Inv okeCallback()
    at System.Net.Lazy AsyncResult.Inv okeCallback(Boo lean
    completedSynchr onously,
    Object result)
    at System.Net.Sock ets.OverlappedA syncResult.Comp letionPortCallb ack(UInt32
    err
    orCode, UInt32 numBytes, NativeOverlappe d* nativeOverlappe d)

    thanks,

    /m


  • Muscha

    #2
    Re: OverlappedAsync Result what class uses this?

    Got it. Post it here so if other people search for it will be found.

    I am using XmlDocument.Loa dXml(...) this apparently validate the DTD and
    tried to download the DTD as well. My gut feel is that since the nature of
    our applicatoin has hundreds of thousands of objects created in a short
    amount of time, the validating of DTD is using an ansynchrounous process or
    some sort. And internally it's using weak reference thus when the result
    came back it throws the ObjectDisposedE xception.

    Hmmph not sure if this is true or not, like I said this is just a gut feel
    :) I didn't know c# well enough :) Anyway I disable the checking of the DTD
    and this exception dissapear.


    /m


    "Muscha" <muscha@no.spam .net> wrote in message
    news:%23F75g3Zr DHA.1880@TK2MSF TNGP09.phx.gbl. ..[color=blue]
    > Hello,
    >
    > I have the following exception in my app, have been chasing it up for the
    > past few days none to avail. Help does anyone know what this may be?
    >
    > Unhandled Exception: System.IO.IOExc eption: Unable to read data from the
    > transpo
    > rt connection. ---> System.ObjectDi sposedException : Cannot access a[/color]
    disposed[color=blue]
    > obj
    > ect.
    > at System.Threadin g.ManualResetEv ent.Reset()
    > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
    > --- End of inner exception stack trace ---
    > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
    > at System.Net.Lazy AsyncResult.Inv okeCallback()
    > at System.Net.Lazy AsyncResult.Inv okeCallback(Boo lean
    > completedSynchr onously,
    > Object result)
    > at[/color]
    System.Net.Sock ets.OverlappedA syncResult.Comp letionPortCallb ack(UInt32[color=blue]
    > err
    > orCode, UInt32 numBytes, NativeOverlappe d* nativeOverlappe d)
    >
    > thanks,
    >
    > /m
    >
    >[/color]


    Comment

    • Daniel O'Connell

      #3
      Re: OverlappedAsync Result what class uses this?

      To add to your response.
      Overlapped IO is a win32 async IO model, in this case it appears to be using
      Completion Ports, which is a type of async commuincation model often used in
      networking apps(although they can work on files, IIRC). The exception
      appears to be occuring in a CompletionPort callback where a ManualResetEven t
      somewehre is being disposed before the loading is complete. If you need
      validation, you may want to read the entire stream into memory yourself (via
      StreamReader or something) and then loading it into the XmlDocument from the
      local stream.
      This code most likely exists in most, if not all System.Net calls, its odd
      that this is occuring in your case, can you repo it in another case?

      "Muscha" <muscha@no.spam .net> wrote in message
      news:%23F75g3Zr DHA.1880@TK2MSF TNGP09.phx.gbl. ..[color=blue]
      > Hello,
      >
      > I have the following exception in my app, have been chasing it up for the
      > past few days none to avail. Help does anyone know what this may be?
      >
      > Unhandled Exception: System.IO.IOExc eption: Unable to read data from the
      > transpo
      > rt connection. ---> System.ObjectDi sposedException : Cannot access a[/color]
      disposed[color=blue]
      > obj
      > ect.
      > at System.Threadin g.ManualResetEv ent.Reset()
      > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
      > --- End of inner exception stack trace ---
      > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
      > at System.Net.Lazy AsyncResult.Inv okeCallback()
      > at System.Net.Lazy AsyncResult.Inv okeCallback(Boo lean
      > completedSynchr onously,
      > Object result)
      > at[/color]
      System.Net.Sock ets.OverlappedA syncResult.Comp letionPortCallb ack(UInt32[color=blue]
      > err
      > orCode, UInt32 numBytes, NativeOverlappe d* nativeOverlappe d)
      >
      > thanks,
      >
      > /m
      >
      >[/color]


      Comment

      • Muscha

        #4
        Re: OverlappedAsync Result what class uses this?

        > To add to your response.[color=blue]
        > Overlapped IO is a win32 async IO model, in this case it appears to be[/color]
        using[color=blue]
        > Completion Ports, which is a type of async commuincation model often used[/color]
        in[color=blue]
        > networking apps(although they can work on files, IIRC). The exception
        > appears to be occuring in a CompletionPort callback where a[/color]
        ManualResetEven t[color=blue]
        > somewehre is being disposed before the loading is complete. If you need
        > validation, you may want to read the entire stream into memory yourself[/color]
        (via[color=blue]
        > StreamReader or something) and then loading it into the XmlDocument from[/color]
        the[color=blue]
        > local stream.
        > This code most likely exists in most, if not all System.Net calls, its odd
        > that this is occuring in your case, can you repo it in another case?[/color]

        Hmm not really, this is where it happens at the moment. The way I do this
        XmlDocument loading is like this:

        - download the document.
        - store the document
        - load from store
        - load string into XmlDocument object.

        I know XmlDocument can load using the stream, but for our case we needed the
        document to be downloaded first, stored and then reload it as XmlDocument.

        /m

        [color=blue]
        >
        > "Muscha" <muscha@no.spam .net> wrote in message
        > news:%23F75g3Zr DHA.1880@TK2MSF TNGP09.phx.gbl. ..[color=green]
        > > Hello,
        > >
        > > I have the following exception in my app, have been chasing it up for[/color][/color]
        the[color=blue][color=green]
        > > past few days none to avail. Help does anyone know what this may be?
        > >
        > > Unhandled Exception: System.IO.IOExc eption: Unable to read data from the
        > > transpo
        > > rt connection. ---> System.ObjectDi sposedException : Cannot access a[/color]
        > disposed[color=green]
        > > obj
        > > ect.
        > > at System.Threadin g.ManualResetEv ent.Reset()
        > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
        > > --- End of inner exception stack trace ---
        > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
        > > at System.Net.Lazy AsyncResult.Inv okeCallback()
        > > at System.Net.Lazy AsyncResult.Inv okeCallback(Boo lean
        > > completedSynchr onously,
        > > Object result)
        > > at[/color]
        > System.Net.Sock ets.OverlappedA syncResult.Comp letionPortCallb ack(UInt32[color=green]
        > > err
        > > orCode, UInt32 numBytes, NativeOverlappe d* nativeOverlappe d)
        > >
        > > thanks,
        > >
        > > /m
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Daniel O'Connell

          #5
          Re: OverlappedAsync Result what class uses this?


          "Muscha" <muscha@no.spam .net> wrote in message
          news:Ofngx68rDH A.4092@tk2msftn gp13.phx.gbl...[color=blue][color=green]
          > > To add to your response.
          > > Overlapped IO is a win32 async IO model, in this case it appears to be[/color]
          > using[color=green]
          > > Completion Ports, which is a type of async commuincation model often[/color][/color]
          used[color=blue]
          > in[color=green]
          > > networking apps(although they can work on files, IIRC). The exception
          > > appears to be occuring in a CompletionPort callback where a[/color]
          > ManualResetEven t[color=green]
          > > somewehre is being disposed before the loading is complete. If you need
          > > validation, you may want to read the entire stream into memory yourself[/color]
          > (via[color=green]
          > > StreamReader or something) and then loading it into the XmlDocument from[/color]
          > the[color=green]
          > > local stream.
          > > This code most likely exists in most, if not all System.Net calls, its[/color][/color]
          odd[color=blue][color=green]
          > > that this is occuring in your case, can you repo it in another case?[/color]
          >
          > Hmm not really, this is where it happens at the moment. The way I do this
          > XmlDocument loading is like this:
          >
          > - download the document.
          > - store the document
          > - load from store
          > - load string into XmlDocument object.
          >
          > I know XmlDocument can load using the stream, but for our case we needed[/color]
          the[color=blue]
          > document to be downloaded first, stored and then reload it as XmlDocument.
          >[/color]

          Ahh, I see. Does the document have a schema reference that an XmlResolver
          may be trying to resolve?
          [color=blue]
          > /m
          >
          >[color=green]
          > >
          > > "Muscha" <muscha@no.spam .net> wrote in message
          > > news:%23F75g3Zr DHA.1880@TK2MSF TNGP09.phx.gbl. ..[color=darkred]
          > > > Hello,
          > > >
          > > > I have the following exception in my app, have been chasing it up for[/color][/color]
          > the[color=green][color=darkred]
          > > > past few days none to avail. Help does anyone know what this may be?
          > > >
          > > > Unhandled Exception: System.IO.IOExc eption: Unable to read data from[/color][/color][/color]
          the[color=blue][color=green][color=darkred]
          > > > transpo
          > > > rt connection. ---> System.ObjectDi sposedException : Cannot access a[/color]
          > > disposed[color=darkred]
          > > > obj
          > > > ect.
          > > > at System.Threadin g.ManualResetEv ent.Reset()
          > > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
          > > > --- End of inner exception stack trace ---
          > > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
          > > > at System.Net.Lazy AsyncResult.Inv okeCallback()
          > > > at System.Net.Lazy AsyncResult.Inv okeCallback(Boo lean
          > > > completedSynchr onously,
          > > > Object result)
          > > > at[/color]
          > > System.Net.Sock ets.OverlappedA syncResult.Comp letionPortCallb ack(UInt32[color=darkred]
          > > > err
          > > > orCode, UInt32 numBytes, NativeOverlappe d* nativeOverlappe d)
          > > >
          > > > thanks,
          > > >
          > > > /m
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Muscha

            #6
            Re: OverlappedAsync Result what class uses this?

            > > Hmm not really, this is where it happens at the moment. The way I do
            this[color=blue][color=green]
            > > XmlDocument loading is like this:
            > >
            > > - download the document.
            > > - store the document
            > > - load from store
            > > - load string into XmlDocument object.
            > >
            > > I know XmlDocument can load using the stream, but for our case we needed[/color]
            > the[color=green]
            > > document to be downloaded first, stored and then reload it as[/color][/color]
            XmlDocument.[color=blue][color=green]
            > >[/color]
            >
            > Ahh, I see. Does the document have a schema reference that an XmlResolver
            > may be trying to resolve?[/color]

            Yes it does, however it escapes me how it can throw object disposed
            exception .. ?

            /,

            [color=blue]
            >[color=green]
            > > /m
            > >
            > >[color=darkred]
            > > >
            > > > "Muscha" <muscha@no.spam .net> wrote in message
            > > > news:%23F75g3Zr DHA.1880@TK2MSF TNGP09.phx.gbl. ..
            > > > > Hello,
            > > > >
            > > > > I have the following exception in my app, have been chasing it up[/color][/color][/color]
            for[color=blue][color=green]
            > > the[color=darkred]
            > > > > past few days none to avail. Help does anyone know what this may be?
            > > > >
            > > > > Unhandled Exception: System.IO.IOExc eption: Unable to read data from[/color][/color]
            > the[color=green][color=darkred]
            > > > > transpo
            > > > > rt connection. ---> System.ObjectDi sposedException : Cannot access a
            > > > disposed
            > > > > obj
            > > > > ect.
            > > > > at System.Threadin g.ManualResetEv ent.Reset()
            > > > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
            > > > > --- End of inner exception stack trace ---
            > > > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
            > > > > at System.Net.Lazy AsyncResult.Inv okeCallback()
            > > > > at System.Net.Lazy AsyncResult.Inv okeCallback(Boo lean
            > > > > completedSynchr onously,
            > > > > Object result)
            > > > > at
            > > > System.Net.Sock ets.OverlappedA syncResult.Comp letionPortCallb ack(UInt32
            > > > > err
            > > > > orCode, UInt32 numBytes, NativeOverlappe d* nativeOverlappe d)
            > > > >
            > > > > thanks,
            > > > >
            > > > > /m
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Daniel O'Connell

              #7
              Re: OverlappedAsync Result what class uses this?


              "Muscha" <muscha@no.spam .net> wrote in message
              news:eZmg9SIsDH A.3468@TK2MSFTN GP11.phx.gbl...[color=blue][color=green][color=darkred]
              > > > Hmm not really, this is where it happens at the moment. The way I do[/color][/color]
              > this[color=green][color=darkred]
              > > > XmlDocument loading is like this:
              > > >
              > > > - download the document.
              > > > - store the document
              > > > - load from store
              > > > - load string into XmlDocument object.
              > > >
              > > > I know XmlDocument can load using the stream, but for our case we[/color][/color][/color]
              needed[color=blue][color=green]
              > > the[color=darkred]
              > > > document to be downloaded first, stored and then reload it as[/color][/color]
              > XmlDocument.[color=green][color=darkred]
              > > >[/color]
              > >
              > > Ahh, I see. Does the document have a schema reference that an[/color][/color]
              XmlResolver[color=blue][color=green]
              > > may be trying to resolve?[/color]
              >
              > Yes it does, however it escapes me how it can throw object disposed
              > exception .. ?
              >[/color]

              Well, the exact reasoning is not clear to me either, if you dig down into
              the framework with Reflector you might be able to determine it, but it may
              be a framework issue. It is possible that somewhere down deep in the system
              there is a bug that is referencing a disposed object on the return of an
              async call, however it is potentially due to user error(however, logically,
              that kind of error should probably be handled in the class and thrown as a
              more descriptive error).
              [color=blue]
              > /,
              >
              >[color=green]
              > >[color=darkred]
              > > > /m
              > > >
              > > >
              > > > >
              > > > > "Muscha" <muscha@no.spam .net> wrote in message
              > > > > news:%23F75g3Zr DHA.1880@TK2MSF TNGP09.phx.gbl. ..
              > > > > > Hello,
              > > > > >
              > > > > > I have the following exception in my app, have been chasing it up[/color][/color]
              > for[color=green][color=darkred]
              > > > the
              > > > > > past few days none to avail. Help does anyone know what this may[/color][/color][/color]
              be?[color=blue][color=green][color=darkred]
              > > > > >
              > > > > > Unhandled Exception: System.IO.IOExc eption: Unable to read data[/color][/color][/color]
              from[color=blue][color=green]
              > > the[color=darkred]
              > > > > > transpo
              > > > > > rt connection. ---> System.ObjectDi sposedException : Cannot access[/color][/color][/color]
              a[color=blue][color=green][color=darkred]
              > > > > disposed
              > > > > > obj
              > > > > > ect.
              > > > > > at System.Threadin g.ManualResetEv ent.Reset()
              > > > > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
              > > > > > --- End of inner exception stack trace ---
              > > > > > at System.Net.Conn ection.ReadCall back(IAsyncResu lt asyncResult)
              > > > > > at System.Net.Lazy AsyncResult.Inv okeCallback()
              > > > > > at System.Net.Lazy AsyncResult.Inv okeCallback(Boo lean
              > > > > > completedSynchr onously,
              > > > > > Object result)
              > > > > > at
              > > > >[/color][/color][/color]
              System.Net.Sock ets.OverlappedA syncResult.Comp letionPortCallb ack(UInt32[color=blue][color=green][color=darkred]
              > > > > > err
              > > > > > orCode, UInt32 numBytes, NativeOverlappe d* nativeOverlappe d)
              > > > > >
              > > > > > thanks,
              > > > > >
              > > > > > /m
              > > > > >
              > > > > >
              > > > >
              > > > >
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              Working...