title: Java ProcessBuilder to run a java with ThreadPoolExecutor does not work properly on ubuntu
body: <p>After running the app for somedays, I found out that some JVM crash report are created in the /root folder
  The log file starts with this info</p>
  
  <pre><code># A fatal error has been detected by the Java Runtime Environment:
  #
  #  SIGSEGV (0xb) at pc=0x00007f050013cdeb, pid=31295, tid=139659437045504
  #
  # JRE version: 6.0_26-b03
  # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode linux-amd64     compressed oops)
  # Problematic frame:
  # C  [libc.so.6+0x86deb]  unsigned long+0x15b
  #
  </code></pre>
  
  <p>I found out that the below behavior happens only on Ubuntu</p>
  
  <blockquote>
    <p>java version "1.6.0_26"
        Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
        Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
        Linux ubuntu 2.6.32-36-server #79-Ubuntu SMP Tue Nov 8 22:44:38 UTC 2011 x86_64 GNU/Linux</p>
  </blockquote>
  
  <p>But the same jars run on Windows 7 professional 32 bit <strong>works correctly</strong></p>
  
  <blockquote>
    <p>java version "1.6.0_22"
    Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
    Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode)</p>
  </blockquote>
  
  <p>I have a multithreaded java app (APP1) using a ThreadPoolExecutor to process some objects.
  When I run it on Linux from the command line it works as expected. Then I written another java app (APP2) that uses <code>ProcessBuilder.start</code> to execute the multithreaded app.</p>
  
  <p>When I use APP2 to run APP1, I found out that the behavior of the <code>ThreadPoolExecutor</code> in APP1 is different where some threads are reused with their old data more than once.
  my code is something like this:
  App1:</p>
  
  <pre><code>    myProcessor processor = new myProcessor(data);
      threadExecuter.execute(processor);
  </code></pre>
  
  <p><code>myProcessor</code> is implementing runnable, and data is stored there in a private variable.</p>
  
  <p>This the code of <code>myProcessor</code> class</p>
  
  <pre><code>    private class myProcessor implements Runnable {
      public myProcessor(Data data)
      {
      myData=data;
      }
  
      private Data myData;
  
  DataDAO datadao=new DataDAO();
  
      public void run() {
          Boolean processed = false;
          if (myData != null) {
              if(Logger.isDebug())
              {
                  Logger.logInfo("-- thread:"+ Thread.currentThread().getName()+" processing "+myData.getId());
              }
              processed = dataHandler.process(myData.getMade(), myData.getText(), myData.getSc().getComp(), myData.getSc(), myData.getOp(),myData.getId());
              myData.setProcessed(processed);
              myData.setStatus(1);
              try {
                  if(myData.isProcessed()) datadao.UpdateProcessedStatus(myData);
              } catch (SQLException ex) {
                  Logger.logError(ex);
              }
          }
      }
      }
  </code></pre>
  
  <p>When I check the log file, I find that Thread name is run twice with the same data id, where it never happen when I run App1 normally from the command line.</p>
  
  <p>Did anyone encountered such behavior before?</p>