Code Monkey home page Code Monkey logo

abort_on_panic-rs's People

Contributors

emk avatar frewsxcv avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

abort_on_panic-rs's Issues

Unlicense or CC0?

The README states

This code is placed into the public domain under the terms described by the Unlicense.

but the license key in the toml file says CC0. Did 6a2e302 just forget to update the README?

Crashes when no task exists and no panic occurs

Program received signal SIGILL, Illegal instruction.
0x00007ffff6a64f6d in util::abort::h02951b1e75008cc1HAa () from ./testmodule.so
(gdb) bt
#0  0x00007ffff6a64f6d in util::abort::h02951b1e75008cc1HAa () from ./testmodule.so
#1  0x00007ffff69d9899 in local_ptr::compiled::take::h14452098448178968240 () from ./testmodule.so
#2  0x00007ffff6a30697 in task::failing::hbfb6b409badfcd086tp () from ./testmodule.so
#3  0x00007ffff69ca781 in abort_on_panic::PanicGuard.Drop::drop (self=0x7fffffffded8) at src/lib.rs:49
#4  0x00007ffff69c4ad6 in abort_on_panic..PanicGuard::glue_drop.1623::h9a0c7ff411355a98 () from ./testmodule.so
#5  0x00007ffff69c4a6c in testmodule::inittestmodule () at <abort_on_panic macros>:13
#6  0x00007ffff69c47fe in inittestmodule () from ./testmodule.so
#7  0x000000000056e0b9 in _PyImport_LoadDynamicModule () at ../Python/importdl.c:53

This occurs when a python extension module written in Rust is imported into the normal python interpreter.
abort_on_panic works as expected when the python interpreter is hosted by a Rust program.

It's debatable whether this is a bug in task::failing() or in abort_on_panic, but there's an easy workaround:
Replace the failing() call with rustrt::local::Local::exists(None::<Task>) && failing()

PanicGuard::drop panics during process shutdown

std::io::stderr panics if stderr cannot be accessed because the process is shutting down, therefore the panic guard does not do its job (on the other hand, it could be argued that it does work since it initiates a double panic that aborts the process). I'm not sure there is any solution.

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.