OR-TOOLS EXCEPTION_ACCESS_VIOLATION when running TSP

0

When I run the TSP algorithm I get a fatal error on the native or-tools library. There is a small chance to execute the TSP algo with success when running it only one time, but for consecutive executions without a big interval between them, it always happens.

I'm currently running it on Windows 10, but it tested it on Debian and Alpine and the problem still happens.

Here is a preview, but you can see the full log here (each time I get this error the problematic frame is different).

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000002a9e261c007, pid=12012, tid=9116
#
# JRE version: OpenJDK Runtime Environment (14.0.1+7) (build 14.0.1+7)
# Java VM: OpenJDK 64-Bit Server VM (14.0.1+7, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# J 10298 c2 org.neo4j.kernel.impl.store.LongerShortString.decode([JII)Lorg/neo4j/values/storable/TextValue; (120 bytes) @ 0x000002a9e261c007 [0x000002a9e261bb80+0x0000000000000487]
#
# 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:
# C:\Users\hugo_\Workspace\Itini\Backend\service-itinerary-builder\hs_err_pid12012.log
Compiled method (c2)  124037 10298       4       org.neo4j.kernel.impl.store.LongerShortString::decode (120 bytes)
 total in heap  [0x000002a9e261b910,0x000002a9e261cc48] = 4920
 relocation     [0x000002a9e261ba70,0x000002a9e261bb70] = 256
 main code      [0x000002a9e261bb80,0x000002a9e261c6e0] = 2912
 stub code      [0x000002a9e261c6e0,0x000002a9e261c6f8] = 24
 oops           [0x000002a9e261c6f8,0x000002a9e261c708] = 16
 metadata       [0x000002a9e261c708,0x000002a9e261c770] = 104
 scopes data    [0x000002a9e261c770,0x000002a9e261ca40] = 720
 scopes pcs     [0x000002a9e261ca40,0x000002a9e261cb90] = 336
 dependencies   [0x000002a9e261cb90,0x000002a9e261cb98] = 8
 handler table  [0x000002a9e261cb98,0x000002a9e261cc28] = 144
 nul chk table  [0x000002a9e261cc28,0x000002a9e261cc48] = 32
Compiled method (c2)  124056 12326       4       org.neo4j.kernel.impl.newapi.DefaultPropertyCursor::propertyValue (38 bytes)
 total in heap  [0x000002a9e2cb7410,0x000002a9e2cb88f8] = 5352
 relocation     [0x000002a9e2cb7570,0x000002a9e2cb7750] = 480
 main code      [0x000002a9e2cb7760,0x000002a9e2cb8280] = 2848
 stub code      [0x000002a9e2cb8280,0x000002a9e2cb82c8] = 72
 oops           [0x000002a9e2cb82c8,0x000002a9e2cb82d8] = 16
 metadata       [0x000002a9e2cb82d8,0x000002a9e2cb8398] = 192
 scopes data    [0x000002a9e2cb8398,0x000002a9e2cb8618] = 640
 scopes pcs     [0x000002a9e2cb8618,0x000002a9e2cb8828] = 528
 dependencies   [0x000002a9e2cb8828,0x000002a9e2cb8838] = 16
 handler table  [0x000002a9e2cb8838,0x000002a9e2cb88c8] = 144
 nul chk table  [0x000002a9e2cb88c8,0x000002a9e2cb88f8] = 48

Java code:

public List<AlgoNode> solve(final Collection<AlgoNode> nodes, final AlgoNode start) {
     if (nodes == null || nodes.isEmpty())
         return new ArrayList<>();
     if (nodes.size() == 1)
         return new ArrayList<>(nodes);

     // Setup Variables
     var list = new ArrayList<>(nodes);
     var depot = start == null ? 0 : list.indexOf(start);
     var manager = new RoutingIndexManager(list.size(), 1, depot);
     var routing = new RoutingModel(manager);

     // Define dummy weight function
     var transitCallbackIndex = routing.registerTransitCallback((fromIndex, toIndex) -> 1L);
     routing.setArcCostEvaluatorOfAllVehicles(transitCallbackIndex);

     // Solve
     var parameters = main.defaultRoutingSearchParameters().toBuilder();
     parameters.setFirstSolutionStrategy(FirstSolutionStrategy.Value.PATH_CHEAPEST_ARC);
     var solution = routing.solveWithParameters(parameters.build()); // Problematic line
     return new ArrayList<>(); // Dummy return
 }

I also tryied making the method syncronized, using a lock and calling closeModel() after running the TSP, but no lucky.

java
or-tools
asked on Stack Overflow Jul 22, 2020 by Hugo Sartori

1 Answer

1

seems related to https://github.com/google/or-tools/issues/2091

Please, don't hesitate to open a github issue with all this information...

answered on Stack Overflow Jul 23, 2020 by Mizux

User contributions licensed under CC BY-SA 3.0