Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

SystemStackError: stack level too deep when specs are too heavily nested #341

Closed
craigjbass opened this issue Jan 26, 2018 · 8 comments
Closed

Comments

@craigjbass
Copy link
Contributor

On Ruby 2.5.0p0

To Reproduce:

describe 'StackLevelTooDeep' do
  context 'if' do
    context 'you' do
      context 'use' do
        context 'the' do
          context 'magic' do
            context 'of' do
              context 'rspec' do
                context 'too' do
                  context 'much' do
                    it 'blows up when rendering the Failure :(' do
                      expect(1).to eq(2)
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end
SystemStackError: stack level too deep
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/location.rb:10:in `all?'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/location.rb:10:in `location?'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:30:in `block in args'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:27:in `map'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:27:in `args'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:45:in `location'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:51:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source.rb:61:in `select'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source.rb:61:in `nodes_by_line_number'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:118:in `location_nodes_at_beginning_line'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:96:in `expression_node'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:88:in `line_range_of_location_nodes_in_expression'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:57:in `line_range_of_expression'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:42:in `expression_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:31:in `extract_expression_lines_at'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:218:in `read_failed_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:163:in `failure_slash_error_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:150:in `block in failure_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:149:in `tap'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:149:in `failure_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:34:in `colorized_message_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:240:in `formatted_message_and_backtrace'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:86:in `fully_formatted_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:78:in `fully_formatted'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:200:in `fully_formatted'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:114:in `block in fully_formatted_failed_examples'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:113:in `each'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:113:in `each_with_index'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:113:in `fully_formatted_failed_examples'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/base_text_formatter.rb:32:in `dump_failures'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:206:in `block in notify'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:205:in `each'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:205:in `notify'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:175:in `block in finish'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:191:in `close_after'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:171:in `finish'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:81:in `report'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:112:in `run_specs'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:87:in `run'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:71:in `run'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:45:in `invoke'
  /usr/local/bundle/gems/rspec-core-3.7.1/exe/rspec:4:in `<top (required)>'
  /usr/local/bundle/bin/rspec:29:in `load'
  /usr/local/bundle/bin/rspec:29:in `<top (required)>'

We encountered this issue and it caused some sads 😢

@myronmarston
Copy link
Member

Thanks for reporting this! @yujinakayama, this looks like it's happening in snippet extraction support code you added. Can you take a look?

craigjbass added a commit to craigjbass/rspec-support that referenced this issue Jan 27, 2018
craigjbass added a commit to craigjbass/rspec-support that referenced this issue Jan 27, 2018
@yujinakayama
Copy link
Member

Hmm, I could not reproduce it.

$ ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
$ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    diff-lcs (1.3)
    rspec (3.7.0)
      rspec-core (~> 3.7.0)
      rspec-expectations (~> 3.7.0)
      rspec-mocks (~> 3.7.0)
    rspec-core (3.7.1)
      rspec-support (~> 3.7.0)
    rspec-expectations (3.7.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.7.0)
    rspec-mocks (3.7.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.7.0)
    rspec-support (3.7.0)

PLATFORMS
  ruby

DEPENDENCIES
  rspec

BUNDLED WITH
   1.16.1
$ cat spec/test_spec.rb
describe 'StackLevelTooDeep' do
  context 'if' do
    context 'you' do
      context 'use' do
        context 'the' do
          context 'magic' do
            context 'of' do
              context 'rspec' do
                context 'too' do
                  context 'much' do
                    it 'blows up when rendering the Failure :(' do
                      expect(1).to eq(2)
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end
$ bundle exec rspec
F

Failures:

  1) StackLevelTooDeep if you use the magic of rspec too much blows up when rendering the Failure :(
     Failure/Error: expect(1).to eq(2)

       expected: 2
            got: 1

       (compared using ==)
     # ./spec/test_spec.rb:12:in `block (11 levels) in <top (required)>'

Finished in 0.01589 seconds (files took 0.07908 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/test_spec.rb:11 # StackLevelTooDeep if you use the magic of rspec too much blows up when rendering the Failure :(

@craigjbass
Copy link
Contributor Author

craigjbass commented Jan 27, 2018

yeah this is strange.

I found it did work natively on my machine, but within Docker there seems to be a much smaller stack limit

This is my Dockerfile

FROM ruby:2.5.0-alpine3.7

RUN apk add --update alpine-sdk postgresql-dev postgresql-client

WORKDIR /app
COPY Gemfile ./
COPY Gemfile.lock ./
RUN bundle install

RUN apk del alpine-sdk

ADD . /app

EXPOSE 4567
EXPOSE 1234
CMD ["bin/serve.sh"]

@craigjbass
Copy link
Contributor Author

My .rspec flags:

--format documentation
--color

@craigjbass
Copy link
Contributor Author

I'm using the patch in #343 against my production code, and I don't get the error anymore.

@craigjbass
Copy link
Contributor Author

Here's a repo with a minimal reproducible example: https://github.com/craigjbass/rspec-stack-level-too-deep

Note: I've struggled with flakiness around this depending on whether run in Docker / natively / enough nesting

 cbass@craig-lenovo  ~/Projects/stack-level-too-deep   master  git rev-parse HEAD
49e8032e4a467713ec853242e270b8302f4c76b2
 cbass@craig-lenovo  ~/Projects/stack-level-too-deep   master  git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working tree clean
 cbass@craig-lenovo  ~/Projects/stack-level-too-deep   master  make
docker build -t rspec-stack-level-too-deep . && docker run rspec-stack-level-too-deep
Sending build context to Docker daemon  71.68kB
Step 1/7 : FROM ruby:2.5.0-alpine3.7
 ---> 4c0d231f6a74
Step 2/7 : WORKDIR /app
 ---> Using cache
 ---> 3ec1f3f5a21f
Step 3/7 : COPY Gemfile ./
 ---> Using cache
 ---> ce23e660fb3d
Step 4/7 : COPY Gemfile.lock ./
 ---> Using cache
 ---> a90b20e1e4fd
Step 5/7 : RUN bundle install
 ---> Using cache
 ---> 0af1ce25e7dd
Step 6/7 : ADD . /app
 ---> faba7094cf76
Removing intermediate container 9749a5b529f5
Step 7/7 : CMD bundle exec rspec
 ---> Running in 0bf6a7faf9ef
 ---> 1ca92d99805b
Removing intermediate container 0bf6a7faf9ef
Successfully built 1ca92d99805b
Successfully tagged rspec-stack-level-too-deep:latest
F

bundler: failed to load command: rspec (/usr/local/bundle/bin/rspec)
SystemStackError: stack level too deep
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:29:in `new'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:29:in `block in args'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:27:in `map'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:27:in `args'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:45:in `location'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:51:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:54:in `block in each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source/node.rb:53:in `each'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source.rb:61:in `select'
  /usr/local/bundle/gems/rspec-support-3.7.0/lib/rspec/support/source.rb:61:in `nodes_by_line_number'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:118:in `location_nodes_at_beginning_line'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:96:in `expression_node'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:88:in `line_range_of_location_nodes_in_expression'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:57:in `line_range_of_expression'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:42:in `expression_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/snippet_extractor.rb:31:in `extract_expression_lines_at'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:218:in `read_failed_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:163:in `failure_slash_error_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:150:in `block in failure_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:149:in `tap'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:149:in `failure_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:34:in `colorized_message_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:240:in `formatted_message_and_backtrace'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:86:in `fully_formatted_lines'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/exception_presenter.rb:78:in `fully_formatted'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:200:in `fully_formatted'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:114:in `block in fully_formatted_failed_examples'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:113:in `each'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:113:in `each_with_index'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/notifications.rb:113:in `fully_formatted_failed_examples'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/formatters/base_text_formatter.rb:32:in `dump_failures'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:206:in `block in notify'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:205:in `each'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:205:in `notify'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:175:in `block in finish'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:191:in `close_after'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:171:in `finish'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:81:in `report'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:112:in `run_specs'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:87:in `run'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:71:in `run'
  /usr/local/bundle/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:45:in `invoke'
  /usr/local/bundle/gems/rspec-core-3.7.1/exe/rspec:4:in `<top (required)>'
  /usr/local/bundle/bin/rspec:29:in `load'
  /usr/local/bundle/bin/rspec:29:in `<top (required)>'
make: *** [Makefile:2: run] Error 1
 ✘ cbass@craig-lenovo  ~/Projects/stack-level-too-deep   master  uname -a
Linux craig-lenovo 4.14.13-300.fc27.x86_64 #1 SMP Thu Jan 11 04:00:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

myronmarston added a commit that referenced this issue Jan 30, 2018
…arch

Use loop-based DFS to resolve #341 (SystemStackError)
@jayniz
Copy link

jayniz commented Feb 9, 2018

For people coming here via google: There's also this ruby issue about a stack level too deep error on alpine/docker. This might still bite you even with rspec 3.7.1!

@craigjbass
Copy link
Contributor Author

Indeed @jayniz - this is caused by Alpine’s use of musl libc instead of glibc which has a stack size of 80k. There is an API to tell musl to increase the stack size, but Ruby does not know how to call this. (Yet)

yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this issue Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants