Originally posted by: JorisK
A specific set of instructions in a Java CP model causes a fatal crash. Please find attached a minimal working example. For demonstration purposes, I made some minor modifications to the class Facility.java, which is shipped by default as one of the example classes in CP optimizer. I've marked the lines of code I've changed/added.
CP version: 12.6.2, Linux 64bit (default, unmodified libraries)
Java version: 1.8.0_66
Running the attached code results in:
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x00007f4150c1dc59, pid=8054, tid=139918371522304
# JRE version: Java(TM) SE Runtime Environment (8.0_66-b17) (build 1.8.0_66-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libcp_wrap_cpp_java1262.so+0xb65c59][thread 139917199922944 also had an error]
[thread 139918388307712 also had an error]
IlcCPOConflictAggregatorI::getConflictVar(IlcCPOIntVarI*)+0x79
Cause of crash: I'm not entirely sure what the root cause is. At least the following "ingredients" seem to be required:
-a variable which is not used in any of the constraints/objective
-an IloSearchPhase
-invocation of the 'exportModel' function.
Admittedly, the attached example is rather artificial, but accidentally having an unused variable in your model is not uncommon, for example if, due to some bug, the indexing of a variable array is off by one.
Please let me know whether you are able to reproduce the issue and/or whether you need more information.
#CPOptimizer#DecisionOptimization