It seems we missed one spot to persist SampleContextFrameVector into the global table (CSProfileGenerator::populateFunctionBoundarySamples:340) which causes a crash.
This change tried to fix it in a centralized way i. e. where we generate the FunctionSamples.
Side note:
This might be improved in the future, if it's a new context, it will always do a twice search(find and emplace), I guess context search is heavy.