Coder Social home page Coder Social logo

tnakagome / exray Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 1.0 103 KB

Show stack traces from C++ exceptions at run-time without rebuilding target applications

License: Apache License 2.0

Makefile 6.64% Shell 0.26% C++ 92.93% C 0.17%
backtrace c-plus-plus exceptions ld-preload linux stack-frames stack-traces

exray's People

Contributors

tnakagome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jjzhang166

exray's Issues

symbol lookup error: ./libexray.so: undefined symbol: pthread_once

I'm trying to use your library on my Ubuntu 16.04 machine.

make built the lib without errors, but when I run my test-program I get the following:

$ LD_PRELOAD=./libexray.so ./fail
./fail: symbol lookup error: ./libexray.so: undefined symbol: pthread_once

My test-program is:

#include <stdexcept>

void three()
{
                throw std::runtime_error("Failed in function three");
}

void two(int num)
{
                three();
}

void one()
{
                two(42);
}

int main(int argc, char *argv[])
{
                one();
                return 0;
}

Static initialization order fiasco problem

exray::Options::outputFilters is a static variable and it is used by the ExceptionHandler to try and filter exceptions.

Now if the using application throws from another static initialization, if outputFilters wasn't yet initialized, the application will crash. (there's a 50/50 chance)

In my case it crashed. I fixed it by making outputFilters a static function instead (which just creates a static object and returns its reference). This fixes the above problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.