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

DisassemblyDiagnoser crashes on overloaded benchmark #562

Closed
JosephTremoulet opened this Issue Sep 28, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@JosephTremoulet

JosephTremoulet commented Sep 28, 2017

Trying to use the DisassemblyDiagnoser on the benchmark referenced here, I'm getting

Failed to disassemble with following exception:
Sequence contains more than one matching element
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at BenchmarkDotNet.Disassembler.Program.Disassemble(Settings settings, ClrRuntime runtime, State state)
   at BenchmarkDotNet.Disassembler.Program.Handle(Settings settings)
   at BenchmarkDotNet.Disassembler.Program.Main(String[] args)

Presumably that's coming from this code:

// benchmarks in BenchmarkDotNet are always parameterless, so check by name is enough as of today
state.Todo.Enqueue(new MethodInfo(typeWithBenchmark.Methods.Single(method => method.Name == settings.MethodName), 0));

so maybe, while only one overload can be the [Benchmark] we're looking for, the presence of other, non-[Benchmark] overloads cause a problem, and the test needs to also verify that it's getting a parameterless method? The benchmark in question includes this:

        [Benchmark]
        public bool LoopReturn()
        {
            return LoopReturn(test1, test2);
        }

        public bool LoopReturn(String strA, String strB)
        {

and renaming one of the methods allows disassembly to succeed.

@adamsitnik

This comment has been minimized.

Show comment
Hide comment
@adamsitnik

adamsitnik Sep 30, 2017

Member

@JosephTremoulet thanks for another good bug report!

You are one step away from writing your first PR to BenchmarkDotNet ;)

Member

adamsitnik commented Sep 30, 2017

@JosephTremoulet thanks for another good bug report!

You are one step away from writing your first PR to BenchmarkDotNet ;)

@adamsitnik adamsitnik self-assigned this Sep 30, 2017

@adamsitnik adamsitnik added this to the v0.10.10 milestone Sep 30, 2017

alinasmirnova added a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment