• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      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

          [JENKINS-37559] cannot abort shell scripts on 64-bit Solaris

          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)

          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)

          Oleg Nenashev added a comment -

          The fix has been merged towards jenkins-2.20

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

          Oleg Nenashev added a comment -

          csiden The fix is released, so changed the status back

          Oleg Nenashev added a comment - csiden The fix is released, so changed the status back

          csiden 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++;
          }
          

          Marcin Gozdalik added a comment - csiden 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++; }

          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"

          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"

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

              Created:
              Updated:
              Resolved: