Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8362270

(process) Improve abnormal abort diagnostic for POSIX_SPAWN and FORK modes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      Originally I wanted to remove the aliveness-ping-handshake we do with the jspawnhelper completely (see JDK-8362257). That was a workaround for a glibc bug that is not relevant anymore.

      However after looking at the code more closely, I saw that shortly afterwards we added diagnostic crash detection code for jspawnhelper which relies on the alive ping.

      It needs the ping to distinguish between "exec succeeded, but the child process afterwards got a abnormal termination signal" and "jspawnhelper ended abnormally before reaching exec(), e.g. because of a programming error".

      Without the aliveness ping, we could not tell these states apart: Both would exactly the same to the parent (fail pipe closes, and process ends with waitpid reporting an error).

      The solution for JDK-8362257 piggy-backed on the aliveness ping such that
      - if we don't send the alive ping, we know the child never reached exec but ended abnormally before that
      - if we send the alive ping, we assume all is well and we will be reaching exec()

      But that solution is not optimal, since:
      - the alive ping comes too early. It comes at the beginning of childProcess(). So we do notice if we abnormally end before that point (in jspawnhelper main()), but not if we abnormally end after this point (during all the preparation work done before exec'ing).
      - and it only works for POSIX_SPAWN.


            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: