Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with double Dispose? #68

Closed
gfoidl opened this issue Nov 27, 2021 · 0 comments · Fixed by #69
Closed

Bug with double Dispose? #68

gfoidl opened this issue Nov 27, 2021 · 0 comments · Fixed by #69
Labels
Milestone

Comments

@gfoidl
Copy link
Owner

gfoidl commented Nov 27, 2021

In a CI run an exception is thrown:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at gfoidl.DataCompression.Internal.DeadBand.SequentialEnumerableIterator.DisposeCore() in /_/source/gfoidl.DataCompression/Compression/DeadBandCompression/SequentialEnumerableIterator.cs:line 39
   at gfoidl.DataCompression.DataPointIterator.Dispose() in /_/source/gfoidl.DataCompression/DataPointIterator.cs:line 179
   at gfoidl.DataCompression.Benchmarks.DeadBandCompression.Enumerate() in /home/vsts/work/1/s/perf/gfoidl.DataCompression.Benchmarks/DeadBandCompression.cs:line 16
   at BenchmarkDotNet.Autogenerated.Runnable_0.WorkloadActionNoUnroll(Int64 invokeCount) in /home/vsts/work/1/s/perf/gfoidl.DataCompression.Benchmarks/bin/Release/net6.0/289e03e1-c8a9-4275-afa1-ff9acba27b91/289e03e1-c8a9-4275-afa1-ff9acba27b91.notcs:line 495
   at BenchmarkDotNet.Engines.Engine.RunIteration(IterationData data)
   at BenchmarkDotNet.Engines.EngineFactory.Jit(Engine engine, Int32 jitIndex, Int32 invokeCount, Int32 unrollFactor)
   at BenchmarkDotNet.Engines.EngineFactory.CreateReadyToRun(EngineParameters engineParameters)
   at BenchmarkDotNet.Autogenerated.Runnable_0.Run(IHost host, String benchmarkName) in /home/vsts/work/1/s/perf/gfoidl.DataCompression.Benchmarks/bin/Release/net6.0/289e03e1-c8a9-4275-afa1-ff9acba27b91/289e03e1-c8a9-4275-afa1-ff9acba27b91.notcs:line 172
   --- End of inner exception stack trace ---

Looks like the double Dispose from

using DataPointIterator filtered = source.DeadBandCompression(0.1);
return Consume(filtered);

and the foreach from Consume is the culprit.

@gfoidl gfoidl added the bug label Nov 27, 2021
@gfoidl gfoidl added this to the 2.2.0 milestone Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant