Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Uncaught RangeError: Invalid string length #7417

Closed

Description

@ZenHarbinger

[Enter steps to reproduce below:]

  1. I opened a very large (591.0 MB (591,032,444 bytes)) JSON file.

Atom Version: 1.0.0
System: Ubuntu 15.04
Thrown From: Atom Core

Stack Trace

Uncaught RangeError: Invalid string length

At /usr/share/atom/resources/app.asar/node_modules/pathwatcher/lib/file.js:301

RangeError: Invalid string length
  at Array.join (native)
  at ReadStream.<anonymous> (/usr/share/atom/resources/app.asar/node_modules/pathwatcher/lib/file.js:301:43)
  at emitNone (events.js:72:20)
  at ReadStream.emit (events.js:163:7)
  at _stream_readable.js:891:16
  at process._tickCallback (node.js:357:13)

Commands

     -8:52 editor:select-line (atom-text-editor.editor.is-focused)
     -8:49.7.0 grammar-selector:show (atom-text-editor.editor.is-focused)
 22x -8:04.1.0 pane:show-next-item (atom-text-editor.editor.is-focused)
  2x -6:26 pane:show-previous-item (atom-text-editor.editor.is-focused)
     -6:20.3.0 release-notes:show (atom-text-editor.editor.is-focused)
 41x -0:16.5.0 core:close (atom-text-editor.editor.is-focused)

Config

{
  "core": {},
  "editor": {
    "invisibles": {},
    "fontSize": 10,
    "tabLength": 4,
    "showInvisibles": true
  }
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

Activity

  1. mnquintana commented on Jun 25, 2015

    @mnquintana
    Contributor

    Was this a one-line file by any chance? Is there any way you could post this (or a similar file that triggers the same error) as a Gist?

    /cc @nathansobo @maxbrunsfeld

  2. ZenHarbinger commented on Jun 25, 2015

    @ZenHarbinger
    Author

    It is not all one line.
    https://www.dropbox.com/s/2jcdqso36rb014a/large.json.gz?dl=0

    Not sure how to get a file like this anywhere except dropbox. If you need it somewhere else, let me know.

  3. 3zzy commented on Jun 26, 2015

    @3zzy

    Had the exact same error opening a large (570mb) XML file.

  4. robmcl4 commented on Jun 26, 2015

    @robmcl4

    For me this happens with any file above 268,435,440 characters, which is suspiciously close to 228 = 268,435,456. Anyway, here's how I reproduce on OS X 10.10.3:

    % python -c "with open('broken.txt', mode='w') as f: f.write('1'*268435441)"
    % open Atom.app --args broken.txt

    Click proceed, and observe error.

  5. kubetz commented on Jun 26, 2015

    @kubetz

    @robmcl4 thanks for providing an easy way how to reproduce this issue 👍

    I am getting same error under Windows 8.1 .

  6. robmcl4 commented on Jun 26, 2015

    @robmcl4

    I feel like this is related to nodejs/node-v0.x-archive/issues/14170. If so, what this error is really saying is out of memory.

  7. kubetz commented on Jun 26, 2015

    @kubetz

    It seems that the issue is caused by V8 as it is not able to allocate string with given size.

    More information in this V8 issue comment:

    This puts a limit on the maximally possible allocation request in 32-bit versions of 2^27-1. The maximal flat string length is ~2^28 (512MB space), and the maximal string length is 2^29-1 ...

    Note: 2^28 is not 512MB, but 256MB.

  8. robmcl4 commented on Jun 26, 2015

    @robmcl4

    👍 That seems to be the problem. Additionally, this seems to be a duplicate of #7210.

  9. izuzak commented on Jun 26, 2015

    @izuzak
    Contributor

    Yeah, closing in favor of #7417. Thanks for the report and the details, everyone.

  10. lock commented on Apr 10, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  11. locked and limited conversation to collaborators on Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions