Isolate Crash Vulnerability (SEGV) but Critical Legacy Code Rate to Separate Binary Code

I have a code base (mostly C ++) that is well tested and without crashing. Mostly. The part of the code that is irreplaceable, difficult to maintain or improve, and linked to the binary library *, causes all crashes. This does not happen often, but when they do, the whole program crashes.

          +----------------------+
          | Shiny new sane       |
          |  code base           |
          |                      |
          |  +-----------------+ |   If the legacy code crashes,
          |  |                 | |   the entire program does, too.
          |  |   Legacy Code   | |
          |  | * Crash prone * | |
          |  | int abc(data)   | |
          |  +-----------------+ |
          |                      |
          +----------------------+

Is it possible to extract this part of the code into a separate program, start from the main program, move data between these programs (on Linux, OS X and, if possible, Windows), endure failures in the child process and restart the child? Something like that:

        +----------------+         // start,
        | Shiny new sane | ------. // re-start on crash
        |  code base     |       | //   and
        |                |       v // input data
        |                |    +-----------------+
        |   return       |    |                 |
        |   results <-------- |   Legacy Code   |
        +----------------+    | * Crash prone * |
                              |  int abc(data)  |
       (or not results        +-----------------+
        because abc crashed)

, int abc(char *data) ( , ). - , . , .

- ++ 11 C, Qt boost. Linux, OSX Windows.

- *: / , .

+4
1

, , ...

, . , . , , , , , , . Boost , (. Asio).

"". Qt? - , , .

Windows, " DCOM" - .

, (, "", , .) , , , , , , .

Boost:: interprocess , - , , . Boost:: serialization .

+2

Source: https://habr.com/ru/post/1621265/


All Articles