nex3/sass — Issue #227: Import loops are not detected
Author: chriseppstein
Created: 2011-12-16 15:53:09+00:00
State: open

[Initially filed](https://github.com/chriseppstein/compass/issues/650) by @Pichirho against compass.

If you import a self referencing file, compass may exhaust all memory.

### _self.scss

@import "compass/css3"; // get something BIG to parse
@import "self";
/* Put here lots of css/sass/scss if you want to exhaust all memory */

### crasher.scss

@import "self";

## Expected results

The parser should notice a self reference or a circular reference and stop parsing with an error.

## Actual results

When compass detects a change in crasher.scss, it includes _self.scss until it fails with `SystemStackError on line ["10"] of C: stack level too deep` or the OS crashes if the available memory is exhausted before that.

## System & Versions

- 64 bit Win7 Professional
- Rails 3.0.7
- sass 3.1.10
- compass 0.11.5