https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
j

jQrgen

02/28/2024, 10:00 AM
Do you guys know if this test from the documentation (https://kotlinlang.org/docs/native-memory-manager.html#check-for-memory-leaks) is supposed to pass as it says in the docs? Do you know how I can make it pass?
Copy code
> Task :mpthreads:iosSimulatorArm64Test FAILED
Invalid connection: com.apple.coresymbolicationd

kotlin.AssertionError: Expected <7077888>, actual <5242880>.
kotlin.AssertionError: Expected <7077888>, actual <5242880>.
	at kotlin.Error#<init>(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:14)
	at kotlin.AssertionError#<init>(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:132)
	at kotlin.test.DefaultAsserter#fail(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/DefaultAsserter.kt:16)
	at kotlin.test.Asserter#fail(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/Assertions.kt:634)
	at kotlin.test.Asserter#assertTrue(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/Assertions.kt:652)
	at kotlin.test.Asserter#assertTrue(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/Assertions.kt:650)
	at kotlin.test.Asserter#assertEquals(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/Assertions.kt:671)
	at kotlin.test.Asserter#assertEquals(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/Assertions.kt:670)
	at kotlin.test#assertEquals(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/Assertions.kt:63)
	at kotlin.test#assertEquals$default(/opt/buildAgent/work/2fed3917837e7e79/kotlin/libraries/kotlin.test/common/src/main/kotlin/kotlin/test/Assertions.kt:62)
	at <global>.#test(/Users/bu/dev/mpthreads/mpthreads/src/nativeTest/kotlin/test.kt:26)
	at $test$FUNCTION_REFERENCE$0.invoke#internal(/Users/bu/dev/mpthreads/mpthreads/src/nativeTest/kotlin/test.kt:21)
	at $test$FUNCTION_REFERENCE$0.$<bridge-UNN>invoke(/Users/bu/dev/mpthreads/mpthreads/src/nativeTest/kotlin/test.kt:21)
	at kotlin.Function0#invoke(/Users/teamcity/.gradle/daemon/8.2.1/[K][Suspend]Functions:1)
	at kotlin.native.internal.test.TopLevelSuite.TestCase#run(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestSuite.kt:153)
	at kotlin.native.internal.test.TestCase#run(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestSuite.kt:19)
	at kotlin.native.internal.test.TestRunner.run#internal(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt:248)
	at kotlin.native.internal.test.TestRunner.runIteration#internal(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt:274)
	at kotlin.native.internal.test.TestRunner#run(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt:289)
	at kotlin.native.internal.test#testLauncherEntryPoint(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/Launcher.kt:33)
	at kotlin.native.internal.test#main(/opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/Launcher.kt:38)
	at <global>.Konan_start(/Users/bu/.gradle/daemon/8.6/entryPointOwner:1)
	at <global>.Init_and_run_start(Unknown Source)
	at <global>.0x0(Unknown Source)
	at <global>.0x0(Unknown Source)
	at <global>.0x0(Unknown Source)


TestKt.test[iosSimulatorArm64] FAILED
    kotlin.AssertionError at /opt/buildAgent/work/2fed3917837e7e79/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:14
1 test completed, 1 failed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mpthreads:iosSimulatorArm64Test'.
> There were failing tests. See the report at: file:///Users/bu/dev/mpthreads/mpthreads/build/reports/tests/iosSimulatorArm64Test/index.html
* Try:
> Run with --scan to get full insights.
BUILD FAILED in 4s
7 actionable tasks: 4 executed, 3 up-to-date
11:08:12: Execution finished ':mpthreads:cleanIosSimulatorArm64Test :mpthreads:iosSimulatorArm64Test --tests "TestKt.test"'.
It is indeed frustrating when the example test doesn't pass. I can also see that "'GC' is deprecated. Use kotlin.native.runtime.GC instead." are the docs outdated? How can we check for memory leaks when
kotlin.native.internal.GC.lastGCInfo()
is not working?
2 Views