KalmanEstimator error

Hi everyone,

I encountered an error today, when I tried the test sample from KalmanEstimatorTest to build a Kalman estimator. When the program executed
KalmanEstimator kalman = new KalmanEstimatorBuilder().addPropagationConfiguration(propagatorBuilder, new ConstantProcessNoise(processNoiseMatrix)).build();
an error would occur:

Exception in thread “main” java.lang.VerifyError: Inconsistent stackmap frames at branch target 156
Exception Details:
Location:
org/orekit/propagation/numerical/PartialDerivativesEquations.setInitialJacobians(Lorg/orekit/propagation/SpacecraftState;[[D[[D)Lorg/orekit/propagation/SpacecraftState; @156: aload_3
Reason:
Type uninitialized 135 (current frame, stack[2]) is not assignable to uninitialized 131 (stack map, stack[2])
Current Frame:
bci: @149
flags: { }
locals: { ‘org/orekit/propagation/numerical/PartialDerivativesEquations’, ‘org/orekit/propagation/SpacecraftState’, ‘[[D’, ‘[[D’, integer }
stack: { uninitialized 131, uninitialized 131, uninitialized 135, uninitialized 135, ‘org/orekit/errors/OrekitMessages’, ‘[Ljava/lang/Object;’, ‘[Ljava/lang/Object;’, integer, ‘[[D’ }
Stackmap Frame:
bci: @156
flags: { }
locals: { ‘org/orekit/propagation/numerical/PartialDerivativesEquations’, ‘org/orekit/propagation/SpacecraftState’, ‘[[D’, ‘[[D’, integer }
stack: { uninitialized 131, uninitialized 131, uninitialized 131, uninitialized 131, ‘org/orekit/errors/OrekitMessages’, ‘[Ljava/lang/Object;’, ‘[Ljava/lang/Object;’, integer }
Bytecode:
0000000: 2ab7 0080 2cbe 3604 1504 1006 a000 0c15
0000010: 042c 0332 be9f 0024 bb00 9559 b200 9705
0000020: bd00 0359 0315 04b8 0068 5359 042c 0332
0000030: beb8 0068 53b7 009d bf2d c600 2915 042d
0000040: be9f 0022 bb00 9559 b200 a005 bd00 0359
0000050: 0315 04b8 0068 5359 042d beb8 0068 53b7
0000060: 009d bf2d c700 0d2a b400 1bb6 0086 9a00
0000070: 152d c600 462a b400 1bb6 0086 2d03 32be
0000080: 9f00 38bb 0095 59bb 0095 59b2 00a3 05bd
0000090: 0003 5903 2dc7 0007 03a7 0007 2d03 32be
00000a0: b800 6853 5904 2ab4 001b b600 86b8 0068
00000b0: 53b7 009d b700 a6bf 2a04 b500 212a b600
00000c0: a93a 0519 05b6 00ad bc07 3a06 1905 2b2c
00000d0: 2d19 06b6 00b2 2b2a b400 1919 06b6 00b5
00000e0: b0
Stackmap Table:
append_frame(@24,Integer)
same_frame(@57)
same_frame(@99)
same_frame(@113)
same_frame(@131)
full_frame(@156,{Object[#1],Object[#147],Object[#132],Object[#132],Integer},{Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Object[#152],Object[#193],Object[#193],Integer})
full_frame(@160,{Object[#1],Object[#147],Object[#132],Object[#132],Integer},{Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Object[#152],Object[#193],Object[#193],Integer,Integer})
same_frame(@184)

    at org.orekit.estimation.sequential.KalmanModel.updateReferenceTrajectories(KalmanModel.java:782)
    at org.orekit.estimation.sequential.KalmanModel.<init>(KalmanModel.java:244)
    at org.orekit.propagation.conversion.NumericalPropagatorBuilder.buildKalmanModel(NumericalPropagatorBuilder.java:195)
    at org.orekit.propagation.conversion.NumericalPropagatorBuilder.buildKalmanModel(NumericalPropagatorBuilder.java:1)
    at org.orekit.estimation.sequential.KalmanEstimator.<init>(KalmanEstimator.java:107)
    at org.orekit.estimation.sequential.KalmanEstimatorBuilder.build(KalmanEstimatorBuilder.java:71)
    at org.orekit.test1.TestRound8.main(TestRound8.java:120)

Do you have any idea why would this error occur? Thanks for your help!

Seems to be an issue with the jvm thinking the jars are corrupted. Which jvm are you using? Which version of Orekit and Hipparchus?

Hi Evan,

I used jdk 13.0.1. And Orekit 10.0 with some estimation part of the codes from 10.1 (files related to issue #588 in order to resolve a bug in 10.0, including KalmanModel ), Hipparchus 1.5.

I just checked even with all original Orekit 10.0 codes, the problem still persists.

Since I’m not very familiar with Java right now, do you have any clue what might be the problem?

Thank you for your help!

Could you try with Java 8 and see if the problem still persists?

Hi Evan,

I just checked with Java 8

java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

The problem still persists. It shows the same error info.

PS: I tested the same code with IDEA (jdk 13.0.1) and MATLAB (Java 1.8.0_202-b08, built-in MATLAB), the error didn’t occur. But when I used VS Code, I met with this problem. Do you think is it related to the IDE settings? I think I did not change the default settings of these IDEs.

Thanks for your help!

Hmm strange. Based on those results it seems to be an IDE issue. I’m not familiar with VS so I can’t help with that. Perhaps check that the class path is set correctly when running it.

Thanks a lot for your suggestion! I managed to recreate the project and now it seems to work fine.