Skip to content

Conversation

@mseeley
Copy link
Contributor

@mseeley mseeley commented Jan 15, 2016

Raven.isSetup() logs an error the first time it's called when Raven is not configured. The logDebug method assumes the methods cached at initialization time are the built-in methods.

It's possible to send Raven.isSetup() into a reentrant loop if a few things happen:

  • The console methods cached at initialization are not the the built-in methods.
  • The console.error method calls Raven.isSetup().
  • Raven is in debug mode.

Repro: https://gist.github.com/mseeley/c6243d39a77e54a17ff1

Super edgy but not difficult to trigger if you're holding it a little crooked. Although since avoiding excessive reentrancy is a one liner I figured you all might take the patch.

Thanks!

Calling isSetup from within a log method before Raven is setup can cause Raven to enter an reentrant flow. Set the `raventNotConfiguredError` flag early to limit reentrances to 1.
benvinegar added a commit that referenced this pull request Jan 15, 2016
Prevent reentrancy in isSetup() when used in log method
@benvinegar benvinegar merged commit d105f37 into getsentry:master Jan 15, 2016
@benvinegar
Copy link
Contributor

Thanks @mseeley!

@mseeley mseeley deleted the avoid-max-callstack branch January 16, 2016 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants