Giter VIP home page Giter VIP logo

libas-safe's Introduction

libas-safe

This 127-line proof-of-concept library enables a program's signal handlers to call library functions not designated by POSIX as async-signal safe. It does this via two mechanisms: library copying (whereby the signal handler uses a separate copy of each shared library from the rest of the process image) and deferral (whereby signal arrivals are postponed during certain library functions' execution). The library is so short because libgotcha does most of the heavy lifting, and so long because libgotcha doesn't currently provide a seamless way for control libraries to request a callback at process start, and thanks for all the fish.

License

The entire contents and history of this repository are distributed under the following license:

Copyright 2020 Carnegie Mellon University

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Building libas-safe

  1. $ ln -s ../path/to/libgotcha
  2. $ make -Clibgotcha libgotcha.a libgotcha.mk
  3. $ make

Note that the example program does not deadlock on some glibcs newer than 2.29 (at least 2.33). To build and run it against a non-installed copy of an older dynamic linker, do:

  1. $ make signal LDFLAGS=-Wl,-I.../lib/ld-linux-x86-64.so.2
  2. $ ./signal

To avoid symbol version clashes in libas-safe, you will need to build it against that same glibc:

  1. $ make LDFLAGS=-L.../lib
  2. $ LD_PRELOAD=./libas-safe.so ./signal

Using libas-safe

Either link your program against libas-safe.so or request it at load time via $LD_PRELOAD.

To see more details, export $LIBASSAFE_VERBOSE. Depending on the test program, exporting libgotcha configuration variables such as $LIBGOTCHA_SHAREDLIBC may exercise different behavior, such as forcing signals to be deferred more often.

libas-safe's People

Contributors

solb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zabrane

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.