Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6155479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:26:32+00:00 2026-05-23T20:26:32+00:00

I am writing a C++ exception class, which has to provide limited backtrace at

  • 0

I am writing a C++ exception class, which has to provide limited backtrace at throw site. Since my application will be multi-threaded, exceptions might be thrown at the same time. I searched the Internet for this thread-safety issue, but found none.

backtrace() returns array of C strings. These C strings must not be freed by the application. Since it gets its information and composites these strings at runtime, I fear that it is not thread safe.

dladdr() returns a struct Dl_info, with two C strings in it. Also must not be freed by the application.

Oh well, I guess I should just read the source code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:26:34+00:00Added an answer on May 23, 2026 at 8:26 pm

    From the manual

    A backtrace is a list of the function calls that are currently active in a thread. The usual way to inspect a backtrace of a program is to use an external debugger such as gdb. However, sometimes it is useful to obtain a backtrace programmatically from within a program, e.g., for the purposes of logging or diagnostics.

    The header file execinfo.h declares three functions that obtain and manipulate backtraces of the current thread.

    Looks like they’re using thread-local storage.

    dladdr is returning non-modifiable strings which belong to the loaded object file. This is thread-safe because it’s read-only and the object is available until dlclose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing some new code that will throw a custom exception - I
I'm writing an application using Seam 2.2.x which will be deployed on JBoss 5.1.
All, I am writing a multithread program. The class which extends Thread has a
I'm writing a class called Category which has 2 static methods for retreiving XML
I'm writing some class which has 2 (main) subsystems. A part depends on boost::filesystem
I'm currently writing some code for UnconstrainedMelody which has generic methods to do with
I have a class which has some methods like follows (And more): template<class T>
I'm writing a small program which will make a GET request to a server
I'm writing a Java app which has to add a record to a database.
I am writing a program which will preform texture synthesis. I have been away

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.