Opened 3 months ago

Closed 3 months ago

#2992 closed defect (done)

External Evaluation leads to Exceptions during Object Graph Traversal

Reported by: abeham Owned by: abeham
Priority: medium Milestone: HeuristicLab 3.3.16
Component: Common Version:
Keywords: Cc:

Description

Instances from System.Net.Sockets are part of the object graph. The following exception is thrown when an algorithm is stopped

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Net.Sockets.IPPacketInformation.GetHashCode()
   at System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
   at System.Collections.Generic.HashSet`1.InternalGetHashCode(T item)
   at System.Collections.Generic.HashSet`1.Contains(T item)
   at HeuristicLab.Common.ObjectExtensions.<GetChildObjects>d__3.MoveNext() in C:\...\HeuristicLab.Common\3.3\ObjectExtensions.cs:line 136
   at HeuristicLab.Common.ObjectExtensions.GetObjectGraphObjects(Object obj, HashSet`1 excludedMembers, Boolean excludeStaticMembers) in C:\...\HeuristicLab.Common\3.3\ObjectExtensions.cs:line 56
   at HeuristicLab.Optimization.Algorithm.OnStopped() in C:\...\HeuristicLab.Optimization\3.3\Algorithms\Algorithm.cs:line 303
   at HeuristicLab.Core.Executable.OnStopped() in C:\...\HeuristicLab.Core\3.3\Executable.cs:line 138
   at HeuristicLab.Core.Engine.Start(CancellationToken cancellationToken) in C:\...\HeuristicLab.Core\3.3\Engine.cs:line 100
   at HeuristicLab.Optimization.EngineAlgorithm.Start(CancellationToken cancellationToken) in C:\...\HeuristicLab.Optimization\3.3\Algorithms\EngineAlgorithm.cs:line 172
   at System.Threading.Tasks.Task.Execute()

The error exists at least since 3.3.13, however, no exception window has been shown in earlier versions when object graph traversal failed. Probably some changes in 3.3.15 regarding Sync/Async has led to these exceptions being properly raised.

Attachments (1)

ObjectExtensions.cs.patch (590 bytes) - added by abeham 3 months ago.
Patch by ddorfmei

Download all attachments as: .zip

Change History (5)

Changed 3 months ago by abeham

Patch by ddorfmei

comment:1 Changed 3 months ago by abeham

  • Status changed from new to accepted

comment:2 Changed 3 months ago by abeham

  • Owner changed from abeham to gkronber
  • Status changed from accepted to reviewing

r16648: exclude types from System.Net.Sockets in object graph traversal

Another option would be to just disregard the socket field in the EvaluationTCPChannel class (HeuristicLab.Problems.ExternalEvaluation-3.4) with the ExcludeFromObjectGraphTraversal attribute (see #2626, r14032). However, I think we can safely ignore everything from System.Net.Sockets.

comment:3 Changed 3 months ago by gkronber

  • Owner changed from gkronber to abeham
  • Status changed from reviewing to readytorelease

Reviewed r16648. Thanks.

comment:4 Changed 3 months ago by abeham

  • Resolution set to done
  • Status changed from readytorelease to closed

r16650: merged to stable

Note: See TracTickets for help on using tickets.