Skip to content

Conversation

@rxsto
Copy link
Contributor

@rxsto rxsto commented Jan 13, 2026

After running 0.1.2 in a partitioned prod environment I am still seeing these errors:

2026-01-13T09:30:25.932Z ‹ [72881916055592)][c.minnced.discord.jdave.ffi.LibDave     ][ERROR] › Caught unexpected exception while trying to log message
java.lang.IndexOutOfBoundsException: No null terminator found: MemorySegment{ kind: native, address: 0x7f937bb55300, byteSize: 12288 } using region [0, 12288)
	at java.base/jdk.internal.foreign.StringSupport.nullNotFound(StringSupport.java:288)
	at java.base/jdk.internal.foreign.StringSupport.strlenByte(StringSupport.java:158)
	at java.base/jdk.internal.foreign.StringSupport.readByte(StringSupport.java:71)
	at java.base/jdk.internal.foreign.StringSupport.read(StringSupport.java:54)
	at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.getString(AbstractMemorySegmentImpl.java:937)
	at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.getString(AbstractMemorySegmentImpl.java:930)
	at club.minnced.discord.jdave.ffi.NativeUtils.asJavaString(NativeUtils.java:12)
	at club.minnced.discord.jdave.ffi.LibDave$LogSinkCallbackMapper.onCallback(LibDave.java:123)
	at club.minnced.discord.jdave.ffi.LibDaveSessionBinding.processProposals(LibDaveSessionBinding.java:245)
	at club.minnced.discord.jdave.DaveSessionImpl.processProposals(DaveSessionImpl.java:67)
	at club.minnced.discord.jdave.manager.DaveSessionManager.onMLSProposals(DaveSessionManager.java:159)
	at club.minnced.discord.jdave.interop.JDaveSession.onMLSProposals(JDaveSession.java:123)
	at net.dv8tion.jda.internal.audio.AudioWebSocket.onBinaryMessage(AudioWebSocket.java:429)
	at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
	at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
	at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
	at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
	at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
	at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
	at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

They're at least recoverable now, but extending the maximum string size even more makes sense so we can properly print all libdave logs. It might also make sense to consider figuring out how long such a string might end up being, not yet sure how we could figure that out.

@rxsto
Copy link
Contributor Author

rxsto commented Jan 13, 2026

Additionally, I've added two checks that should avoid printing logs for the following cases:

  1. When a client joined that wasn't yet supporting DAVE the protocol is transitioned to version 0, which triggered the warning log that is now being avoided
  2. Whenever a user joined a voice channel and was not deafened the addUser() method was called twice, by both USER_SPEAKING_UPDATE and USER_BULK_CONNECT - if the user was already present, logically there shouldn't be any change to the session; therefore we should be able to skip that duplicated call

Please let me know if you want any adjustments or improvements to these changes.

@MinnDevelopment
Copy link
Owner

Could you split this into two PRs? One for logging changes and one for the decryptor one? Also, please rebase your branch onto master to get rid of the unused commits.

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

Successfully merging this pull request may close these issues.

2 participants