Skip to content

segmentation fault when run on large sets of files #128

@chriswatrous

Description

@chriswatrous
  • OS: macOS 10.13.6
  • node: v6.11.3, v8.11.3
  • npm: 6.3.0
  • grasp: 0.6.0

I'm getting Segmentation fault: 11 and sometimes Bus error: 10 when running grasp on large sets of files. I first noticed the problem working on a proprietary project that I can't share here but I was able to reproduce it by cloning the react repo.

To reproduce:

git clone https://github.com/facebook/react.git --branch v16.4.2 --depth 1
cd react
grasp -r ident
grasp -r import-dec
grasp -r with
grasp -re '__ = __'
grasp -re '__ = __ = __'

This gets 131643 lines of javascript. The query doesn't seem to matter. All of those grasp commands end with Segmentation fault: 11 every time.

Here's an example with a smaller set of files (but still 29065 lines).

cd packages/react-dom/src/__tests__

# run grasp on 29066 lines in 67 files
grasp with *.js # segfault

# run grasp separately on each file, largest file 2578 lines
ls *.js | xargs -L 1 grasp with  # no segfault

# cat the files together and pipe to grasp
cat *.js | grasp with  # segfault

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions