Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13615

ProcessTreeKiller doesn't work for cygwin sub-processes

      The ProcessTreeKiller[1] doesn't work for cygwin processes launched from a cygwin process.

      To reproduce:

      • Launch a CMD in a terminal.
      • set AAA=123
      • bash.exe
      • sleep 10000
      • Look sleep up in Process Explorer and notice that it has only 4 environment variables, none of which is AAA.

      This is because cygwin maintains the environment variables in the shared memory space for cygwin.dll: See the bottom of http://cygwin.com/cygwin-ug-net/setup-env.html

      One possible solution might be to have a checkbox that enables a cygwin hack that fires up bash.exe and scans /proc//cwd looking for processes that are in the workspace. Then grabs the /proc//winpid and kills them.

      The downside is this may kill too much (a random user cd'd into the workspace, unlikely a problem since it'll prevent directory deletion anyway) and may miss any processes that cd outside the workspace. But better than nothing.

      Ciao!

      [1] https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller

          [JENKINS-13615] ProcessTreeKiller doesn't work for cygwin sub-processes

          Christian Höltje created issue -
          Oleg Nenashev made changes -
          Assignee New: Oleg Nenashev [ oleg_nenashev ]
          Oleg Nenashev made changes -
          Link New: This issue depends on JENKINS-19156 [ JENKINS-19156 ]
          Oleg Nenashev made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Oleg Nenashev made changes -
          Resolution New: Incomplete [ 4 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Oleg Nenashev made changes -
          Link New: This issue is related to JENKINS-20289 [ JENKINS-20289 ]
          Oleg Nenashev made changes -
          Component/s New: cygwin-process-killer [ 18147 ]
          Component/s Original: core [ 15593 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 144082 ] New: JNJira + In-Review [ 190901 ]

            oleg_nenashev Oleg Nenashev
            docwhat Christian Höltje
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: