This question evaluates text parsing, hierarchical data reconstruction, robust error handling for malformed inputs, and algorithmic reasoning about data structures and time/space complexity in the context of stack trace analysis.

Given a multi-line stack trace string from a single thread (e.g., each frame is in the form 'at Module::Function(file:line)'), design and implement a parser that: (