OR-TOOLS EXCEPTION_ACCESS_VIOLATION 当 运行 TSP
OR-TOOLS EXCEPTION_ACCESS_VIOLATION when running TSP
当我 运行 TSP 算法时,我在本机 or-tools 库上遇到致命错误。
当 运行 只执行一次 TSP 算法时,成功执行 TSP 算法的机会很小,但对于连续执行且它们之间没有很大间隔,它总是会发生。
我目前 运行 在 Windows 10 上安装它,但它在 Debian 和 Alpine 上测试了它,但问题仍然存在。
这里是预览,但你可以看到完整的日志here(每次我收到这个错误时,有问题的框架都是不同的)。
#
# 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代码:
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
}
我还尝试使方法同步化,使用锁并在 运行TSP 之后调用 closeModel(),但运气不好。
似乎与 https://github.com/google/or-tools/issues/2091
相关
请不要犹豫,用所有这些信息打开一个 github 问题...
当我 运行 TSP 算法时,我在本机 or-tools 库上遇到致命错误。 当 运行 只执行一次 TSP 算法时,成功执行 TSP 算法的机会很小,但对于连续执行且它们之间没有很大间隔,它总是会发生。
我目前 运行 在 Windows 10 上安装它,但它在 Debian 和 Alpine 上测试了它,但问题仍然存在。
这里是预览,但你可以看到完整的日志here(每次我收到这个错误时,有问题的框架都是不同的)。
#
# 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代码:
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
}
我还尝试使方法同步化,使用锁并在 运行TSP 之后调用 closeModel(),但运气不好。
似乎与 https://github.com/google/or-tools/issues/2091
相关请不要犹豫,用所有这些信息打开一个 github 问题...