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

I use maven and a jdk 18.

XMLWordPrintable

    • generic
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 with subsistem wsl2, jdk and maven are in wsl, IDE: Eclipse installed in windows. Source code is in windows.

      A DESCRIPTION OF THE PROBLEM :
      Im using ORTools but i dont know if it come from here

      REGRESSION : Last worked in version 18

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      package main;

      import static java.util.Arrays.stream;

      import com.google.ortools.Loader;
      import com.google.ortools.sat.CpModel;
      import com.google.ortools.sat.CpSolver;
      import com.google.ortools.sat.CpSolverStatus;
      import com.google.ortools.sat.IntVar;
      import com.google.ortools.sat.LinearExpr;

      /** Minimal CP-SAT example to showcase calling the solver. */
      public final class CpSatExample {
        public static void main(String[] args) {
          Loader.loadNativeLibraries();
          // Create the model.
          CpModel model = new CpModel();

          // Create the variables.
          int varUpperBound = stream(new int[] {50, 45, 37}).max().getAsInt();

          IntVar x = model.newIntVar(0, varUpperBound, "x");
          IntVar y = model.newIntVar(0, varUpperBound, "y");
          IntVar z = model.newIntVar(0, varUpperBound, "z");

          // Create the constraints.
          model.addLessOrEqual(LinearExpr.weightedSum(new IntVar[] {x, y, z}, new long[] {2, 7, 3}), 50);
          model.addLessOrEqual(LinearExpr.weightedSum(new IntVar[] {x, y, z}, new long[] {3, -5, 7}), 45);
          model.addLessOrEqual(LinearExpr.weightedSum(new IntVar[] {x, y, z}, new long[] {5, 2, -6}), 37);

          model.maximize(LinearExpr.weightedSum(new IntVar[] {x, y, z}, new long[] {2, 2, 3}));

          // Create a solver and solve the model.
          CpSolver solver = new CpSolver();
          CpSolverStatus status = solver.solve(model);

          if (status == CpSolverStatus.OPTIMAL || status == CpSolverStatus.FEASIBLE) {
            System.out.printf("Maximum of objective function: %f%n", solver.objectiveValue());
            System.out.println("x = " + solver.value(x));
            System.out.println("y = " + solver.value(y));
            System.out.println("z = " + solver.value(z));
          } else {
            System.out.println("No solution found.");
          }

          // Statistics.
          System.out.println("Statistics");
          System.out.printf(" conflicts: %d%n", solver.numConflicts());
          System.out.printf(" branches : %d%n", solver.numBranches());
          System.out.printf(" wall time: %f s%n", solver.wallTime());
        }

        private CpSatExample() {}
      }

      run this code

      ACTUAL -
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb61e02c10, pid=23400, tid=15316
      #
      # JRE version: OpenJDK Runtime Environment (18.0.1.1+2) (build 18.0.1.1+2-6)
      # Java VM: OpenJDK 64-Bit Server VM (18.0.1.1+2-6, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
      # Problematic frame:
      # C [msvcp140.dll+0x12c10]
      #
      # No core dump will be written. Minidumps are not enabled by default on client versions of Windows
      #
      # An error report file with more information is saved as:
      # XXXX\hs_err_pid23400.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      # The crash happened outside the Java Virtual Machine in native code.
      # See problematic frame for where to report the bug.
      #


      ---------- BEGIN SOURCE ----------

      ---------- END SOURCE ----------

      FREQUENCY : always

            spayne Sandra Payne
            spayne Sandra Payne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: