question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReference in Stryker.Core.Instrumentation.EndingReturnEngine.InjectReturn

See original GitHub issue

Describe the bug NullReference in Stryker.Core.Instrumentation.EndingReturnEngine.InjectReturn when generating mutants.

Logs logs.zip

Expected behavior Not crashing while generating mutants.

Desktop (please complete the following information):

  • OS: Windows 10
  • Type of project: netstandard2.0
  • Framework Version core 3.1
  • Stryker Version 0.22.5

Additional context I am not entirely sure how to read the logs, but the last created mutant [DBG] Mutant 696 created "value.Sign < 0" -> "value.Sign <= 0" using "Stryker.Core.Mutators.BinaryExpressionMutator" (310d25d3) seems to be a mutation of this method ( that i can share because it is from an open sourced BigRational impl):

    public static explicit operator Double( BigRational value ) {
      // The Double value type represents a double-precision 64-bit number with
      // values ranging from -1.79769313486232e308 to +1.79769313486232e308
      // values that do not fit into this range are returned as +/-Infinity
      if ( value.Numerator.InDoubleRange() && value.Denominator.InDoubleRange() ) {
        return (double)value.Numerator / (double)value.Denominator;
      }

      // scale the numerator to preseve the fraction part through the integer division
      BigInteger denormalized = ( value.Numerator * s_bnDoublePrecision ) / value.Denominator;
      if ( denormalized.IsZero )
        **return ( value.Sign < 0 ) ? BitConverter.Int64BitsToDouble( unchecked ( (long)0x8000000000000000 ) )
          : 0d; // underflow to -+0**

      // Note that it does not handle subnormals.
      // and +/- infinity detection might be done with " simple" comparison with their BigRational representation ?
      double result = 0;
      bool isDouble = false;
      int scale = DoubleMaxScale;

      while ( scale > 0 ) {
        if ( !isDouble ) {
          if ( denormalized.InDoubleRange() ) {
            result = (double)denormalized;
            isDouble = true;
          }
          else {
            denormalized = denormalized / 10;
          }
        }

        result = result / 10;
        scale--;
      }

      if ( !isDouble )
        return ( value.Sign < 0 ) ? Double.NegativeInfinity : Double.PositiveInfinity;
      else
        return result;
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
richardwerkmancommented, Jun 30, 2021

Stryker version 0.22.6 should be available in a few minutes with the fix!

Closing issue

0reactions
dupdobcommented, Jun 30, 2021

Just opened a PR for this 😃

Envoyé de mon iPhone

Le 30 juin 2021 à 18:11, Richard Werkman @.***> a écrit :

@petertiedemann it seems like you are the first one to use stryker in combination with ConversionOperator. What a scoop! I will release the fix immediately as this is a breaking bug.

Thank you for using Stryker 🚀

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or unsubscribe.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CORE™ 2 Console
(CORE) 2 Console is intended for use in the cutting, ... Refer to the Symbol Definition Chart REF 0036- ... Refer to Instruction...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found