Skip to content

Upgrading Unleash causes Java Out of Memory #310

@Syuziko

Description

@Syuziko

Describe the bug

When we upgraded Unleash java client from version 10.2.2 to 11.0.0, we started seeing errors in production

We reverted the upgrade and the errors went away.

Steps to reproduce the bug

No response

Expected behavior

No response

Logs, error output, etc.

An unhandled exception occurred for request: 
com.dylibso.chicory.runtime.WasmRuntimeException: out of bounds memory access: attempted to access address: -759324 but limit is: 1192886272 and size: 4
    at com.dylibso.chicory.runtime.ByteBufferMemory.outOfBoundsException(ByteBufferMemory.java:155)
    at com.dylibso.chicory.runtime.ByteBufferMemory.writeI32(ByteBufferMemory.java:207)
    at io.getunleash.wasm.YggdrasilMachine$AotMethods.memoryWriteInt(AotMethods.java:126)
    at io.getunleash.wasm.YggdrasilMachine.func_1173(wasm)
    at io.getunleash.wasm.YggdrasilMachine.func_1132(wasm)
    at io.getunleash.wasm.YggdrasilMachine.func_1149(wasm)
    at io.getunleash.wasm.YggdrasilMachine.func_438(wasm)
    at io.getunleash.wasm.YggdrasilMachine.func_362(wasm)
    at io.getunleash.wasm.YggdrasilMachine$MachineCall.call_362(Unknown Source)
    at io.getunleash.wasm.YggdrasilMachine$MachineCall.call_dispatch_0(Unknown Source)
    at io.getunleash.wasm.YggdrasilMachine$MachineCall.call(Unknown Source)
    at io.getunleash.wasm.YggdrasilMachine.call(wasm)
    at com.dylibso.chicory.runtime.Instance$Exports.lambda$function$0(Instance.java:214)
    at io.getunleash.engine.WasmInterface.checkEnabled(WasmInterface.java:142)
    at io.getunleash.engine.UnleashEngine.isEnabled(UnleashEngine.java:219)
    at io.getunleash.repository.FeatureRepositoryImpl.isEnabled(FeatureRepositoryImpl.java:183)
    at io.getunleash.EngineProxyImpl.isEnabled(EngineProxyImpl.java:48)
    at io.getunleash.DefaultUnleash.isEnabled(DefaultUnleash.java:117)
    at io.getunleash.Unleash.isEnabled(Unleash.java:20)
    at io.getunleash.DefaultUnleash.isEnabled(DefaultUnleash.java:99)
....

Screenshots

No response

Additional context

No response

Unleash version

11.0.0

Subscription type

None

Hosting type

None

SDK information (language and version)

Java 21

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Investigating

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions