Skip to content

ObjectDisposedException from System.Net.Mail tests on Mono in CI #22812

Closed

Description

@stephentoub

https://helix.dot.net/api/2019-06-17/jobs/4889c660-1974-4de2-8c00-cf0917b490fa/workitems/System.Net.Mail.Functional.Tests/console

  Discovering: System.Net.Mail.Functional.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Net.Mail.Functional.Tests (found 144 of 146 test cases)
  Starting:    System.Net.Mail.Functional.Tests (parallel test collections = on, max threads = 2)

Unhandled Exception:
System.ObjectDisposedException: Safe handle has been closed.
Object name: 'SafeHandle'.
   at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
   at System.Net.Sockets.SocketPal.SetLingerOption(SafeSocketHandle handle, LingerOption optionValue)
   at System.Net.Sockets.Socket.SetLingerOption(LingerOption lref)
   at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
   at System.Net.Sockets.Socket.set_LingerState(LingerOption value)
   at System.Net.Sockets.TcpClient.set_LingerState(LingerOption value)
   at System.Net.Mail.SmtpConnection.Abort()
   at System.Net.Mail.SmtpTransport.Abort()
   at System.Net.Mail.SmtpClient.Abort()
   at System.Net.Mail.SmtpClient.TimeOutCallback(Object state)
   at System.Threading.TimerQueueTimer.<>c.<.cctor>b__23_0(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean isThreadPool)
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
[ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Safe handle has been closed.
Object name: 'SafeHandle'.
   at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
   at System.Net.Sockets.SocketPal.SetLingerOption(SafeSocketHandle handle, LingerOption optionValue)
   at System.Net.Sockets.Socket.SetLingerOption(LingerOption lref)
   at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
   at System.Net.Sockets.Socket.set_LingerState(LingerOption value)
   at System.Net.Sockets.TcpClient.set_LingerState(LingerOption value)
   at System.Net.Mail.SmtpConnection.Abort()
   at System.Net.Mail.SmtpTransport.Abort()
   at System.Net.Mail.SmtpClient.Abort()
   at System.Net.Mail.SmtpClient.TimeOutCallback(Object state)
   at System.Threading.TimerQueueTimer.<>c.<.cctor>b__23_0(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean isThreadPool)
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

cc: @akoeplinger

Activity

  1. stephentoub commented on Jan 31, 2020

    @stephentoub
    MemberAuthor

    @tmds, looks like this is one of (or the) exception we need to special-case in the code you added?

  2. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions