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

no-cond-assign crashes in some cases #11611

Closed
not-an-aardvark opened this issue Apr 13, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@not-an-aardvark
Copy link
Member

commented Apr 13, 2019

This issue was detected by the fuzzer on this CI run.

Tell us about your environment

  • ESLint Version: master
  • Node Version: 10.15.3
  • npm Version: 6.4.1

What parser (default, Babel-ESLint, etc.) are you using?

default

Please show your full configuration:

Configuration

See the configuration from this CI build: https://travis-ci.org/eslint/eslint/jobs/519526960

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

See the code from this CI build: https://travis-ci.org/eslint/eslint/jobs/519526960

What did you expect to happen?

I expected the no-cond-assign rule to not crash.

What actually happened? Please include the actual, raw output from ESLint.

The rule crashed. The output from the fuzzer is reproduced below:

Fuzzer output
The fuzzer reported 1 error with a total of 1 unique stack trace.
More details can be found below.
{
    "results": [
        {
            "type": "crash",
            "text": "(((3496.29)).bkufyydt = 2e308) ? // y\r\ntwvpkh =>\n\r\n\r\n {\n  \"e¿h\"\n  \"use strict\"\r\n  \"\"\n \"Ø}ì³\"\r/*b*/\n/*xp\r\n \r\r\n u*/  for (({})[eval[null]]\r\rin false`ªÙ${arguments}${(2e308)}v`) switch (((y)) ? ((i)) : ((true)))\r\n/*cs h\f */\t{\n  /*cttscc bnyl   ai z *///e\r  default:\n    case true:\n    case h:\n\n     case \"\":\n    case \"c¹&4\":\n    case // g cn  fce pd c p\r/((?:))/uy:\n  }\n\r\rswitch (new (((.6)).l /= (/(?:z)/gmuy))(...arguments, ...\"=è\u0006\", ...(((null))), 2e308 ? /\\xe1\\uDcEc\\O|(?:)|(?!())?|\\x37^\\b'^|[\\x2a\\$-$-]/gim : (null))) {\n    case (this) ?// \r ((5988.33)) : 0x78A3BF43ACDF6:\n      try {} finally /* plqaa*/{}\n/**/      let g\r\n       debugger\r\n      switch (((arguments))) {\n    /*c*/    default:\n      }\n  \r\rcase new \"féú1\u001c\":// hip\r\n\n/* b ev  m \r\nygg \u000bso  */ /* ecaq\n ryt\flcx\f */     class s /*s\n\r a  z*/{}\n    /*  d  q*/  // qqf hvta\tp \reval: for (const y of\n\n2e308) ;\n  /*s\rr*//*  \f u  xok  cq  */  case (x, q, w, k) /*\fiic   \ffrtb*/=> {\n // up  y n\u000bj hd\fz   \r   \f \"(�,¬\"\n    \r\r \"¯�¦Â�\"\n      \"use strict\";\n      \"ç\";\n\n\n \r\n\r\n    \"\u0003jÞìm\";\n    }:\n     for (;;) ;\n\r\n\r\n   //e l y i\fz bzj \n //r   \r\nfor (;;) return\n    case class /*\fxi\tcp g\rvah *//*\ftd  p*//* sn\r\njx f   os*/{}:\n      {}\n      switch (/[\\uCD47$-\\M+-Q\\uAeFF+-]/gim) {}\n      while (this) // ub   l   lp\tux\r\n//e\r//q x     rkfi s   \nreturn\n      eval: debugger\r      let j\n//vyyeb n huea  \f \tu\r\n    default:\n//je\fqbu q z e\r\n/*\rfg  *//*\njlxu k lqe   \fmlf  */      try {} /*prm\tkqam*/finally {}\n//\n      for (;;) break\r\r\n\r\n//rd s e    rs fp\r\n\r\n\n/*jq gu c \fmd\f  \r  s */  //\r/*d*/  try {} catch (i) {}\n/*pnl z  qdhiu  \f a \t*/  // \f sfo \r\n \r\u000b/*ly zpv  mlbud*/  switch (\"\")//\u000bd\f x    gtb  fpo  \n {}\n      return;\n  // tr  j jj x  v m\n  case \"Ø\":\n    /*j \tk vagf \r  r \r \r\n */  return;// sn   \tgtkm\n\n//ma  l\r\n //   oj  pc\f\n // q\fo\n    {}\n//yhr h  \u000bg\u000b k\r  /* \r d x */    ;\n    case eval.if/*l */ /*   c \t  j p*/++:\n  /*b \u000bp     \r\nl \r\nhkin  */    ;\n\r\n\r\n    try {} finally {}\n   //zr \r\n /*f\r\ny  zimia h y\u000bfl*///\t\t   qs\u000bldi nv \r\n//m ytst \t   \t  \r\n//iucy a\tyxe ii \r\n  throw (this)\r      var t\n/*eue\f s b\u000b sn  */\n//  g qfclo\tf\n/*oq\f\f\te zvj\u000blrqccavik*/      ;/[-]/mu\n    case//imud \t \f \t ntd  n\r ((/(?=)/iy)):\n      /*  n f*/while (this) continue\n      throw 9284.98\n/*\n   \r\n \tb eq fk*///g  uuvec\r\n  case function*  v() {\n/*qo\n c \r  \u000b  kc */\r\n\r\n     \"7\";\n    }:\n  \r\n\ncase (null):\n      return;\n  }\n  while (delete ((([])))) try {} catch (j) {}\n /*nt yr   \tnzj\n*/ {\n    switch (false) {}\n\f\t\r\n\r\n}\n} : ({ncwpqk})\r\n\r\n\n function* package(let, eval, ...implements)\t\n\r\r{\n  \"\u000e�5é\";\n  \"x\u0013-Ù\"\r\n  \"üøÀcÓ\"\r\n  \"±uÝ\"\r\n  // fe    \r/*i rpqb b\fe*/\"\";\n  debugger\r\n //j  qeio d\n let {private, s} = (true), {public} /* k eg    l\n*/= (yield)[(\"Z;\")] --\n  debugger;\n}/*\r\nuhz yj\fc b ftfpxncr*/\n//nebtzaszle vjj\r\n",
            "config": {
                "rules": {
                    "no-cond-assign": [
                        2,
                        "except-parens"
                    ]
                },
                "parserOptions": {
                    "sourceType": "script",
                    "ecmaVersion": 2018
                }
            },
            "error": "TypeError: Cannot read property 'value' of null\nOccurred while linting <input>:1\n    at Object.isOpeningParenToken (/home/travis/build/eslint/eslint/lib/util/ast-utils.js:309:18)\n    at isParenthesisedTwice (/home/travis/build/eslint/eslint/lib/rules/no-cond-assign.js:89:26)\n    at testForAssign (/home/travis/build/eslint/eslint/lib/rules/no-cond-assign.js:103:24)\n    at listeners.(anonymous function).forEach.listener (/home/travis/build/eslint/eslint/lib/util/safe-emitter.js:45:58)\n    at Array.forEach (<anonymous>)\n    at Object.emit (/home/travis/build/eslint/eslint/lib/util/safe-emitter.js:45:38)\n    at NodeEventGenerator.applySelector (/home/travis/build/eslint/eslint/lib/util/node-event-generator.js:251:26)\n    at NodeEventGenerator.applySelectors (/home/travis/build/eslint/eslint/lib/util/node-event-generator.js:280:22)\n    at NodeEventGenerator.enterNode (/home/travis/build/eslint/eslint/lib/util/node-event-generator.js:294:14)\n    at CodePathAnalyzer.enterNode (/home/travis/build/eslint/eslint/lib/code-path-analysis/code-path-analyzer.js:632:23)"
        }
    ]
}

Are you willing to submit a pull request to fix this bug?

Yes, but I'm not sure when I'll have time to look into it.

@g-plane

This comment has been minimized.

Copy link
Member

commented Apr 15, 2019

Snippet:

(((3496.29)).bkufyydt = 2e308) ? foo : bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.