Skip to content

Conversation

dylanahsmith
Copy link
Contributor

Problem

When a StackFrames::Buffer#capture is called more than once, any StackFrames::Frame objects obtained from a previous capture with a frame number higher than the most recent capture's length will no longer reference a marked profile frame object. This library needs to prevent using those no longer marked profile frame objects in the StackFrames::Buffer, but the provided regression test shows nothing gets raised when this happens without the corresponding fix.

Solution

StackFrames::Frame just holds an index into the buffer, so I added a bounds check to catch this possible application bug so it can't produce undefined behaviour in this way.

Seems like this would be a non-standard attribute which shouldn't
be necessary for correctness.
…capture

Otherwise, we could be accessing an object that hasn't been marked
which would cause undefined behaviour.
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.

1 participant