Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidMutabilityException: mutation attempt of frozen mu.KotlinLoggingLevel #218

Closed
benkuly opened this issue Dec 22, 2021 · 12 comments
Closed

Comments

@benkuly
Copy link

benkuly commented Dec 22, 2021

When using this library with the new native memory model of native I get the follwing exception:

kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen mu.KotlinLoggingLevel@fa8aa0
    at kfun:kotlin.Throwable#<init>(kotlin.String?){} (0x494001)
    at kfun:kotlin.Exception#<init>(kotlin.String?){} (0x48cc5d)
    at kfun:kotlin.RuntimeException#<init>(kotlin.String?){} (0x48ce0d)
    at kfun:kotlin.native.concurrent.InvalidMutabilityException#<init>(kotlin.String){} (0x4bd1cd)
    at ThrowInvalidMutabilityException (0x4be4c8)
    at Kotlin_AtomicReference_checkIfFrozen (0x872364)
    at kfun:kotlin.native.concurrent.AtomicReference#<init>(1:0){} (0x4bc782)
    at kfun:mu.KotlinLoggingConfiguration#<init>(){} (0x697878)
    at _ZN6kotlin2mm13InitSingletonEPNS0_10ThreadDataEPP9ObjHeaderPK8TypeInfoPFvS4_ES5_ (0x84b2b2)
    at kfun:mu.internal.KLoggerLinux#warn(kotlin.Throwable?;kotlin.Function0<kotlin.Any?>){} (0x69a286)
@github-actions
Copy link

Thank you for reporting an issue. See the wiki for documentation and slack for questions.

@oshai
Copy link
Owner

oshai commented Dec 22, 2021

Thanks for reporting! Any idea how this should be fixed?

@benkuly
Copy link
Author

benkuly commented Dec 23, 2021

Maybe set kotlin.native.binary.memoryModel=experimental in gradle.properties like described in the migration guide

@oshai
Copy link
Owner

oshai commented Dec 23, 2021

can you provide a test that will reproduce the issue?

@benkuly
Copy link
Author

benkuly commented Dec 23, 2021

@oshai
Copy link
Owner

oshai commented Dec 23, 2021

thanks! would you like to create a pr out of it or should i?

@benkuly
Copy link
Author

benkuly commented Dec 23, 2021

Would be cool, when you do it :)

@oshai
Copy link
Owner

oshai commented Jan 16, 2022

So I think now I am able to reproduce it by adding the experiment flag, and created a PR for that:
#219

I am not sure what is the best approach for fixing it.

@benkuly
Copy link
Author

benkuly commented Jan 17, 2022

Looks good to me :) Thank you very much!

@oshai
Copy link
Owner

oshai commented Jan 17, 2022

@benkuly maybe you didn't understand my comment. I am able to reproduce it, but no idea how to fix it.

@benkuly
Copy link
Author

benkuly commented Jan 17, 2022

Oh sorry, yeah, than you are as far as I was, when I tried to fix it :(

@oshai
Copy link
Owner

oshai commented Oct 29, 2022

Seems that now (3.0.3) that we're using kotlin 1.7.20 this works fine. Anyway I added a test in #219.

@oshai oshai closed this as completed Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants