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

cannot abort shell scripts on 64-bit Solaris

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      I cannot get pipeline jobs to abort properly on Solaris machines. Whenever I tried to abort a pipeline job that was running a shell script on a solaris machine the console would say "Sending interrupt signal to process", but debugging on the actual system did not show the slave processes getting any signals.

      Adding some debugging info to the Jenkins code I noticed that the mechanism to identify and kill spawned processes via an environment variable Relies on very OS-specific logic in ProcessTree.java to list the environment variables of processes. On Solaris this logic assumes the data it gets out of /proc/

      {pid}/psinfo contains 32-bit pointers. This is only true as long as the process reading the data out of /proc/{pid}

      /psinfo is a 32-bit process (i.e. the Java process running slave.jar). If the Java process is 64-bit it will get a 64-bit psinfo_t struct out of /proc/

      {pid}

      /psinfo. This results in all of the pointer arithmetic in ProcessTree.java being wrong for 64-bit JVM processes.

      Pull request: https://github.com/jenkinsci/jenkins/pull/2507

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: csiden
            Path:
            core/src/main/java/hudson/util/ProcessTree.java
            core/src/main/java/hudson/util/jna/GNUCLibrary.java
            http://jenkins-ci.org/commit/jenkins/0f364e3a554a1bc6cddbfe7740993b835cae010e
            Log:
            JENKINS-37559 cannot abort shell scripts on 64-bit Solaris (#2507)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: csiden Path: core/src/main/java/hudson/util/ProcessTree.java core/src/main/java/hudson/util/jna/GNUCLibrary.java http://jenkins-ci.org/commit/jenkins/0f364e3a554a1bc6cddbfe7740993b835cae010e Log: JENKINS-37559 cannot abort shell scripts on 64-bit Solaris (#2507)
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The fix has been merged towards jenkins-2.20

            Show
            oleg_nenashev Oleg Nenashev added a comment - The fix has been merged towards jenkins-2.20
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Christopher Siden The fix is released, so changed the status back

            Show
            oleg_nenashev Oleg Nenashev added a comment - Christopher Siden The fix is released, so changed the status back
            Hide
            gozdal Marcin Gozdalik added a comment -

            Christopher Siden unfortunately I believe that your fix causes regression - https://issues.jenkins-ci.org/browse/JENKINS-40470.
            I've run into the same issue and debugged it a bit. java Jenkins process spins in an infinite loop after the job is complete. Running truss I've seen a lot of pread calls. I believe it spins in this loop:

            while(true) {
                LIBC.pread(fd, m, new NativeLong(1), new NativeLong(addr));
                ch = m.getByte(0);
                if (ch == 0)
                    break;
                buf.write(ch);
                addr++;
            }
            
            Show
            gozdal Marcin Gozdalik added a comment - Christopher Siden unfortunately I believe that your fix causes regression - https://issues.jenkins-ci.org/browse/JENKINS-40470 . I've run into the same issue and debugged it a bit. java Jenkins process spins in an infinite loop after the job is complete. Running truss I've seen a lot of pread calls. I believe it spins in this loop: while ( true ) { LIBC.pread(fd, m, new NativeLong(1), new NativeLong(addr)); ch = m.getByte(0); if (ch == 0) break ; buf.write(ch); addr++; }
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/util/ProcessTree.java
            core/src/main/java/hudson/util/jna/GNUCLibrary.java
            http://jenkins-ci.org/commit/jenkins/b4cc77011e8ea90a4c4f924e10cfa08f45ce1f34
            Log:
            Revert "[FIXED JENKINS-37559] - Fix ProcessTree.java on Solaris with 64-bit JVM"

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/util/ProcessTree.java core/src/main/java/hudson/util/jna/GNUCLibrary.java http://jenkins-ci.org/commit/jenkins/b4cc77011e8ea90a4c4f924e10cfa08f45ce1f34 Log: Revert " [FIXED JENKINS-37559] - Fix ProcessTree.java on Solaris with 64-bit JVM"

              People

              • Assignee:
                csiden Christopher Siden
                Reporter:
                csiden Christopher Siden
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: