Git Product home page Git Product logo

simterpose's People

Contributors

abronan avatar icule avatar louisa-bessad avatar mquinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

simterpose's Issues

infinite loop when no binary managed to start

If you have a typo in your deploy file (or if you launch it from the wrong directory), simterpose issues a sensible error message and then enters an infinite loop:

[Tremblay:BROKENapps/server:(1) 0.000000] [simterpose/INFO] Process is starting child: BROKENapps/server 5 128 2227
Error while starting BROKENapps/server: No such file or directory (full cmdline: BROKENapps/server 5 128 2227)Unhandled syscall: 9374 = 140432327229312
Unhandled syscall: 9374 = 140432327229312
Unhandled syscall: 9374 = 140432327229312
Unhandled syscall: 9374 = 140432327229312
[...]

Remove the MAX_FD limit

Simterpose only handles file descriptors < MAX_FD (2048) and it does not event detect that the FD is out of bounds. For this reason, it segfaults when trying to use tools such as valgrind which create file descriptor somewhere in ~65535. We should probably some sort of map (and possibly adding a direct-mapped/2-way-associative cache if it turns out to be too slow) instead of a plain array for storing FD infos.

Syscall arguments are neveger negative

The arguments are defined as unsigned long:

typedef struct open_arg_s {
  unsigned long ret;
  unsigned long ptr_filename;
  unsigned long flags;
  unsigned long mode;
} open_arg_s;

However the code has a lot of tests for negativeness:

if (arg->ret >= 0) {
  // This is always executed
}

simterpose should not leak FDs

Right now, the sockets and file descriptors opened by the main simterpose process are leaked into the childs when we fork. In order to keep the strace output aligned, we have to plan funny games such as

https://github.com/mquinson/simterpose/blob/master/src/simterpose.c#L172

This is ugly and should be removed. Instead, the file descriptors must be passed the CLOEXEC flag so that they get closed automatically on exec().

You can see whether your work is doing the trick by removing the manual closing stuff (pointed above) and running one of our tests (such as cd tests; make diff-msg) If you see a "open() = 3" in strace that become a "open() = 4" in simterpose, then you are leaking FDs.

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.