Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Expose DumpStackTraceToString to application/user #144

@sudhagarc

Description

@sudhagarc

Currently, it seems like only way to get call stack (backtrace or stack trace) is to set FLAGS_log_backtrace_at variable with the desired filename and line number. However, this is a global variable and when used in multithreaded environment, it leads to data corruption issue, hence process crash. One way to prevent it would be to use locks and allow only one thread to dump the call stack.

I'm wondering whether it's possible to expose DumpStackTraceToString utility to application or user. Would that make it lock-free to get the stack trace and make it performant? or, is there any other alternative to achieve the same i.e., get call stack in multithreaded application where more than one thread can simultaneously invoke logging with backtrace set.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions