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

Karma chrashes with: Fatal error: Wrong length [0.13.16 regression] #1768

Closed
egoroof opened this issue Dec 25, 2015 · 28 comments
Closed

Karma chrashes with: Fatal error: Wrong length [0.13.16 regression] #1768

egoroof opened this issue Dec 25, 2015 · 28 comments

Comments

@egoroof
Copy link

egoroof commented Dec 25, 2015

I've just updated from 0.13.15 where everything was fine to 0.13.16 and run tests. Karma has crashed with IE runner (with chrome and firefox there are no problems):

> karma start --single-run

25 12 2015 10:42:06.907:DEBUG [config]: autoWatch set to false, because of singleRun
25 12 2015 10:42:06.914:DEBUG [plugin]: Loading karma-* from E:\Dropbox\repo\browser-id3-writer\node_modules
25 12 2015 10:42:06.918:DEBUG [plugin]: Loading plugin E:\Dropbox\repo\browser-id3-writer\node_modules/karma-chai.
25 12 2015 10:42:06.920:DEBUG [plugin]: Loading plugin E:\Dropbox\repo\browser-id3-writer\node_modules/karma-chrome-launcher.
25 12 2015 10:42:06.931:DEBUG [plugin]: Loading plugin E:\Dropbox\repo\browser-id3-writer\node_modules/karma-coverage.
25 12 2015 10:42:07.270:DEBUG [plugin]: Loading plugin E:\Dropbox\repo\browser-id3-writer\node_modules/karma-firefox-launcher.
25 12 2015 10:42:07.274:DEBUG [plugin]: Loading plugin E:\Dropbox\repo\browser-id3-writer\node_modules/karma-ie-launcher.
25 12 2015 10:42:07.321:DEBUG [plugin]: Loading plugin E:\Dropbox\repo\browser-id3-writer\node_modules/karma-mocha.
25 12 2015 10:42:07.399:DEBUG [preprocessor.coverage]: Processing "E:/Dropbox/repo/browser-id3-writer/src/browser-id3-writer.js".
25 12 2015 10:42:07.508:INFO [karma]: Karma v0.13.16 server started at http://localhost:9876/
25 12 2015 10:42:07.517:INFO [launcher]: Starting browser IE
25 12 2015 10:42:07.518:DEBUG [temp-dir]: Creating temp dir at C:\Users\12C2~1\AppData\Local\Temp\karma-54524961
25 12 2015 10:42:07.523:DEBUG [launcher]: C:\Program Files\Internet Explorer\iexplore.exe http://localhost:9876/?id=54524961
25 12 2015 10:42:07.858:DEBUG [web-server]: serving: E:\Dropbox\repo\browser-id3-writer\node_modules\karma\static/client.html
25 12 2015 10:42:07.890:DEBUG [web-server]: serving: E:\Dropbox\repo\browser-id3-writer\node_modules\karma\static/karma.js
25 12 2015 10:42:08.021:DEBUG [karma]: A browser has connected on socket SBAFIfzlxXRz6LWaAAAA
25 12 2015 10:42:08.035:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=SBAFIfzlxXRz6LWaAAAA
25 12 2015 10:42:08.082:INFO [IE 11.0.0 (Windows 10 0.0.0)]: Connected on socket SBAFIfzlxXRz6LWaAAAA with id 54524961
25 12 2015 10:42:08.085:DEBUG [launcher]: IE (id 54524961) captured in 0.576 secs
25 12 2015 10:42:08.095:DEBUG [web-server]: serving: E:\Dropbox\repo\browser-id3-writer\node_modules\karma\static/context.html
IE 11.0.0 (Windows 10 0.0.0): Executed 1 of 1 SUCCESS (0.018 secs / 0 secs)
25 12 2015 10:42:08.230:DEBUG [karma]: Run complete, exiting.
25 12 2015 10:42:08.236:DEBUG [launcher]: Disconnecting all browsers
25 12 2015 10:42:08.239:ERROR [karma]: [RangeError: Wrong length!]
RangeError: Wrong length!
    at RangeError (native)
    at strictToLength (E:\Dropbox\repo\browser-id3-writer\node_modules\core-js\modules\_typed-array.js:94:36)
    at E:\Dropbox\repo\browser-id3-writer\node_modules\core-js\modules\_typed-array.js:404:44
    at new Uint8Array (E:\Dropbox\repo\browser-id3-writer\node_modules\core-js\modules\es6.typed.uint8-array.js:3:12)
    at allocate (buffer.js:98:17)
    at new Buffer (buffer.js:49:12)
    at BufferPool.reset (E:\Dropbox\repo\browser-id3-writer\node_modules\ws\lib\BufferPool.js:57:26)
    at Receiver.endPacket (E:\Dropbox\repo\browser-id3-writer\node_modules\ws\lib\Receiver.js:247:68)
    at Receiver.opcodes.1.finish (E:\Dropbox\repo\browser-id3-writer\node_modules\ws\lib\Receiver.js:483:12)
    at Receiver.expectHandler (E:\Dropbox\repo\browser-id3-writer\node_modules\ws\lib\Receiver.js:451:33)
    at Receiver.add (E:\Dropbox\repo\browser-id3-writer\node_modules\ws\lib\Receiver.js:95:24)
    at Socket.realHandler (E:\Dropbox\repo\browser-id3-writer\node_modules\ws\lib\WebSocket.js:800:20)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
25 12 2015 10:42:08.253:DEBUG [launcher]: Disconnecting all browsers
25 12 2015 10:42:08.258:DEBUG [coverage]: Writing coverage to E:/Dropbox/repo/browser-id3-writer/coverage
25 12 2015 10:42:08.457:DEBUG [launcher]: Killed extra IE process 3724
25 12 2015 10:42:08.457:DEBUG [launcher]: Process IE exited with code 0
25 12 2015 10:42:08.458:DEBUG [temp-dir]: Cleaning temp dir C:\Users\12C2~1\AppData\Local\Temp\karma-54524961
25 12 2015 10:42:08.462:DEBUG [launcher]: Finished all browsers

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
npm ERR! node v5.3.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: `karma start --single-run`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script 'karma start --single-run'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the browser-id3-writer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     karma start --single-run
npm ERR! You can get their info via:
npm ERR!     npm owner ls browser-id3-writer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\Dropbox\repo\browser-id3-writer\npm-debug.log
@mistadikay
Copy link

the same with Firefox on Mac OS:

25 12 2015 10:38:15.898:ERROR [karma]: [RangeError: Wrong length!]
RangeError: Wrong length!
    at RangeError (native)
    at strictToLength (*PROJECT_PATH*/node_modules/karma/node_modules/core-js/modules/_typed-array.js:94:36)
    at *PROJECT_PATH*/node_modules/karma/node_modules/core-js/modules/_typed-array.js:404:44
    at new Uint8Array (*PROJECT_PATH*/node_modules/karma/node_modules/core-js/modules/es6.typed.uint8-array.js:3:12)
    at allocate (buffer.js:98:17)
    at new Buffer (buffer.js:49:12)
    at BufferPool.reset (*PROJECT_PATH*/node_modules/ws/lib/BufferPool.js:57:26)
    at Receiver.endPacket (*PROJECT_PATH*/node_modules/ws/lib/Receiver.js:247:68)
    at Receiver.opcodes.1.finish (*PROJECT_PATH*/node_modules/ws/lib/Receiver.js:483:12)
    at Receiver.expectHandler (*PROJECT_PATH*/node_modules/ws/lib/Receiver.js:451:33)
    at Receiver.add (*PROJECT_PATH*/node_modules/ws/lib/Receiver.js:95:24)
    at Socket.realHandler (*PROJECT_PATH*/node_modules/ws/lib/WebSocket.js:800:20)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
25 12 2015 10:38:15.900:DEBUG [launcher]: Disconnecting all browsers
25 12 2015 10:38:16.033:DEBUG [launcher]: Process Firefox exited with code 0
25 12 2015 10:38:16.033:DEBUG [temp-dir]: Cleaning temp dir /var/folders/81/kv16vyjs3r9gyfc1dp6qhtjc0000gn/T/karma-18684574
25 12 2015 10:38:16.057:DEBUG [launcher]: Finished all browsers

npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/*USER*/.nvm/versions/node/v5.3.0/bin/node" "/Users/*USER*/.nvm/versions/node/v5.3.0/bin/npm" "run" "task" "tdd"
npm ERR! node v5.3.0
npm ERR! npm  v3.5.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] task: `babel-node node_modules/.bin/start tasks/ "tdd"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] task script 'babel-node node_modules/.bin/start tasks/ "tdd"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the page-manager package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel-node node_modules/.bin/start tasks/ "tdd"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs page-manager
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls page-manager
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     *PROJECT_PATH*/npm-debug.log

npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/*USER*/.nvm/versions/node/v5.3.0/bin/node" "/Users/*USER*/.nvm/versions/node/v5.3.0/bin/npm" "run" "tdd"
npm ERR! node v5.3.0
npm ERR! npm  v3.5.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] tdd: `npm run task tdd`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] tdd script 'npm run task tdd'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the page-manager package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run task tdd
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs page-manager
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls page-manager
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     *PROJECT_PATH*/npm-debug.log

@mistadikay
Copy link

It's probably because of upgrading core-js to 2.0.0

@zloirock
Copy link

core-js 2.0 converts typed arrays for conformity with ES6. By ES6, you will have this error, for example, on new Uint8Array(1.5) or new Uint8Array(undefined) (but instead of first example it's TypeError). Looks like the problem in ws module in BufferPool (Buffer inherited from Uint8Array).

@ruslansagitov
Copy link

In Firefox 31.0.0 on Linux (Travis CI) also.

@falsandtru
Copy link
Contributor

I got a same error with Karma 0.13.16 . Does this caused by #1765 ?

@zloirock
Copy link

@falsandtru see my comment above. This is fixed by #1765 because by ES6 RangeError should be thrown here :) Missed error here - V8 bug.

@falsandtru
Copy link
Contributor

@zloirock thanks for your response. Excuse me, how can we solve this problem? Won't fix?

@zloirock
Copy link

@falsandtru rather it's not core-js issue.

Looks like the problem in ws module in BufferPool (Buffer inherited from Uint8Array).

I can't reproduce it. Most likely to Buffer constructor (-> Uint8Array) passed an invalid argument. See this part of the spec.

@falsandtru
Copy link
Contributor

I can't reproduce it.

It error seems caused by coverage processing.

      reporters: ['dots', 'coverage'],
      preprocessors: {
        'dist/*.js': ['coverage']
      },

It error also caused on Firefox and Chrome. Not only IE.

Windows7 x64 latest
Chrome 47.0.2526
Firefox 43.0.0

@dignifiedquire
Copy link
Member

@falsandtru do you have a repo I can test with?

@egoroof
Copy link
Author

egoroof commented Dec 26, 2015

@falsandtru right you are! Crash only happens when coverage reporter is set.

@dignifiedquire you can test my repo: https://github.com/egoroof/browser-id3-writer

@falsandtru
Copy link
Contributor

@thangngoc89
Copy link

I got the same error too.

Crash only happens when I enable coverage report

claydiffrient added a commit to claydiffrient/voter that referenced this issue Dec 27, 2015
This should address the problem detailed here:
karma-runner/karma#1768
thangngoc89 added a commit to thangngoc89/hei-sb-redux that referenced this issue Dec 27, 2015
- Switch to Chrome (Phantomjs failed on Audio test)
- Downgrage to karma 0.13.15 (karma-runner/karma#1768)
- Add Foundation for testing
  + Use teaspoon for a jQuery-like DOM selector, stateless components wrapper
- Tested:
  + ControlButtons
  + AudioPlayer (need more love)
dignifiedquire added a commit to dignifiedquire/ws that referenced this issue Dec 27, 2015
`Buffer` inherits from `Uint8Arry` so the constructor needs to be
called with integers and mustn't be called with floats.

This patch ensures that the result of the the calculation
in the `shrinkStrategy` in `Receiver` returns an integer.

The reason why this has not been a problem up to now is that
a there is a [V8 Bug](https://code.google.com/p/v8/issues/detail?id=4552)
that the [spec](http://tc39.github.io/ecma262/#sec-typedarray-length)
is not adhered in this case.

This is a blocking issue for [Karma](karma-runner/karma#1768)
as the upgrade to [[email protected]](https://github.com/zloirock/core-js)
now enforces this error.
@dignifiedquire
Copy link
Member

Filed a PR to ws so this issue gets fixed at the source: websockets/ws#645. Depending on the speed of this getting into a release I will create a release with downgraded core-js in the next days.
Thanks for the help everyone.

@egoroof
Copy link
Author

egoroof commented Dec 27, 2015

@dignifiedquire thanks!

thangngoc89 added a commit to thangngoc89/hei-sb-redux that referenced this issue Dec 27, 2015
- Switch to Chrome (Phantomjs failed on Audio test)
- Downgrage to karma 0.13.15 (karma-runner/karma#1768)
- Add Foundation for testing
  + Use teaspoon for a jQuery-like DOM selector, stateless components wrapper
- Tested:
  + ControlButtons
  + AudioPlayer (need more love)
ybiquitous added a commit to ybiquitous/backbone.deepmodel that referenced this issue Dec 28, 2015
thangngoc89 added a commit to thangngoc89/hei-sb-redux that referenced this issue Dec 28, 2015
- Switch to Chrome (Phantomjs failed on Audio test)
- Downgrage to karma 0.13.15 (karma-runner/karma#1768)
- Add Foundation for testing
  + Use teaspoon for a jQuery-like DOM selector, stateless components wrapper
- Tested:
  + ControlButtons
  + AudioPlayer (need more love)
thangngoc89 added a commit to thangngoc89/hei-sb-redux that referenced this issue Dec 28, 2015
- Switch to Chrome (Phantomjs failed on Audio test)
- Downgrage to karma 0.13.15 (karma-runner/karma#1768)
- Add Foundation for testing
  + Use teaspoon for a jQuery-like DOM selector, stateless components wrapper
- Tested:
  + ControlButtons
  + AudioPlayer (need more love)
@diwu1989
Copy link

Also seeing problems.... have to revert to older version of karma unfortunately

@devversion
Copy link
Contributor

@dignifiedquire's PR is already merged, so now we need to wait for a quick release.

JamesMessinger added a commit to APIDevTools/swagger-parser that referenced this issue Dec 30, 2015
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 3, 2016
tleunen pushed a commit to tleunen/react-mdl that referenced this issue Jan 3, 2016
@emilioplatzer
Copy link

+1. I have the same problem https://travis-ci.org/codenautas/tedede/jobs/99987514

but only in travis (not in windows)

zloirock added a commit to zloirock/core-js that referenced this issue Jan 3, 2016
@zloirock
Copy link

zloirock commented Jan 3, 2016

Because it creates too many problems for you, I have temporarily removed length validation from Uint8Array in core-js 2.0.2, so you can just update core-js. I will return it when this V8 bug and bugs in all required packages will be fixed.

@dignifiedquire
Copy link
Member

@zloirock thanks a lot! and sorry for all the issues, I will push a release with that version in the morning.

@dignifiedquire
Copy link
Member

Should be fixed in 0.13.7

@egoroof
Copy link
Author

egoroof commented Jan 4, 2016

@dignifiedquire thanks! It is fixed.

@zzo
Copy link
Contributor

zzo commented Jan 4, 2016

Thanks @dignifiedquire for the quick turnaround!

IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 5, 2016
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 5, 2016
Mark says that karma-runner/karma#1768 is resolved in 0.13.17

 Please enter the commit message for your changes. Lines starting
vlazar added a commit to vlazar/awesomplete that referenced this issue Jan 8, 2016
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 12, 2016
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 12, 2016
Mark says that karma-runner/karma#1768 is resolved in 0.13.17

 Please enter the commit message for your changes. Lines starting
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 12, 2016
jondubois pushed a commit to SocketCluster/sc-ws that referenced this issue Jan 18, 2016
`Buffer` inherits from `Uint8Arry` so the constructor needs to be
called with integers and mustn't be called with floats.

This patch ensures that the result of the the calculation
in the `shrinkStrategy` in `Receiver` returns an integer.

The reason why this has not been a problem up to now is that
a there is a [V8 Bug](https://code.google.com/p/v8/issues/detail?id=4552)
that the [spec](http://tc39.github.io/ecma262/#sec-typedarray-length)
is not adhered in this case.

This is a blocking issue for [Karma](karma-runner/karma#1768)
as the upgrade to [[email protected]](https://github.com/zloirock/core-js)
now enforces this error.
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 20, 2016
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 20, 2016
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 21, 2016
IgorMinar added a commit to IgorMinar/angular that referenced this issue Jan 21, 2016
mhevery pushed a commit to angular/angular that referenced this issue Jan 22, 2016
mhevery pushed a commit to angular/angular that referenced this issue Jan 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests