atom / find-and-replace

Find and replace in a single buffer and in the project
MIT License
242 stars 197 forks source link

"Invalid String Length" error in find-and-replace upon Cmd + Shift + F #869

Open yingw787 opened 7 years ago

yingw787 commented 7 years ago

Description

When searching directory in Atom, cannot because of an "Invalid String Length" error.

Steps to Reproduce

  1. Open Atom
  2. Press Cmd + Shift + F to search in directory
  3. Enter in a string (preferably two strings or space delimited one)
  4. Press Enter to search directory

Expected behavior: [Searches directory for string]

Actual behavior: [Red unformatted invalid string length error pops up]

Reproduces how often: [100% after 3:40PM EST 03/08/2017]

Versions

macOS Sierra v10.12.3 atom v1.14.4 apm v1.15.3

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

Looks like this:

screen shot 2017-03-08 at 3 46 17 pm
rsese commented 7 years ago

Can you reproduce this error consistently and in safe mode (atom --safe)?

Also, do you see this error when searching any directory or just a particular directory?

yingw787 commented 7 years ago

I can replicate this error in safe mode from the same directory:

screen shot 2017-03-09 at 10 04 35 am

However, the error disappears when searching in the immediate child directory of the directory I found the bug in.

winstliu commented 7 years ago

So does it only reproduce in that one directory? Can you try with an unrelated project? Do you by any chance have a very, very, very large file in the directory where the error occurs?

yingw787 commented 7 years ago

Yeah, I think it's an issue with the repository size. It's the entire company's codebase and dependencies. I checked with smaller repositories and the error does not occur.

rsese commented 7 years ago

Thanks for clarifying - about how large is the repository? I tested on https://github.com/torvalds/linux.git which is ~2.5 GB and didn't see the error when searching (2 separate strings or otherwise) so I'm curious how large your project is.

I also noticed https://github.com/atom/find-and-replace/issues/444 which looks like a very similar report so I'll close that one since it's older and hasn't been updated in a while.

yingw787 commented 7 years ago

It's about 31.72 GB. That might do it.

pydolan commented 7 years ago

I'm running into same "invalid string length" message showing up when I search the root of one of my projects. More and more of the "Invalid string length" messages keep showing if I let it keep running.

Search finally finishes after several minutes. The directory is only 80MB, and grep only takes seconds.

This is on Atom 1.20.1 (Mac).

rsese commented 7 years ago

Thanks @pydolan - any chance your project is public so we can use it to try and reproduce?

And can you check dev tools and see if there's a stack trace in the console tab?

pydolan commented 7 years ago

@rsese - I tried searching today, and was unable to reproduce the problem. I'm 90% sure I'm on the same project I was on before, but can't say for sure. Since last hitting this issue, I probably updated Atom to a new version (currently using 1.21.0). Also, the project is not public, so can't share.

I'll reply back if the issue resurfaces.