Closed eliquinox closed 3 years ago
Additional information.
Running ./gradlew test
on the above RPI spec produces the following failures:
WebSocketSessionPollModeAcceptanceTest > shouldHandleMultipleSessions() FAILED
com.google.common.truth.AssertionErrorWithFacts at WebSocketSessionPollModeAcceptanceTest.java:114
MultipleWebSocketSessionDetachedSessionContainerAcceptanceTest > shouldHandleMultipleSessions() FAILED
java.lang.InternalError at MultipleWebSocketSessionDetachedSessionContainerAcceptanceTest.java:82
SingleWebSocketSessionDirectSessionContainerAcceptanceTest > shouldEchoMediumAndLargePayload() FAILED
java.lang.InternalError at SingleWebSocketSessionDirectSessionContainerAcceptanceTest.java:96
SingleWebSocketSessionDirectSessionContainerAcceptanceTest > shouldSendCloseResponseMessage() FAILED
java.lang.InternalError at SingleWebSocketSessionDirectSessionContainerAcceptanceTest.java:96
SingleWebSocketSessionDirectSessionContainerAcceptanceTest > validationFailureShouldCauseDisconnect() FAILED
java.lang.InternalError at SingleWebSocketSessionDirectSessionContainerAcceptanceTest.java:96
SingleWebSocketSessionDirectSessionContainerAcceptanceTest > shouldHandleSingleClient() FAILED
java.lang.InternalError at SingleWebSocketSessionDirectSessionContainerAcceptanceTest.java:96
SingleWebSocketSessionDirectSessionContainerAcceptanceTest > shouldPropagateUpgradeRequestHeaders() FAILED
java.lang.InternalError at SingleWebSocketSessionDirectSessionContainerAcceptanceTest.java:96
SingleWebSocketSessionDirectSessionContainerAcceptanceTest > shouldRespondToPings() FAILED
java.lang.InternalError at SingleWebSocketSessionDirectSessionContainerAcceptanceTest.java:96
SingleWebSocketSessionDirectSessionContainerAcceptanceTest > shouldHandleUpgradeFailure() FAILED
java.lang.InternalError at SingleWebSocketSessionDirectSessionContainerAcceptanceTest.java:96
MultipleWebSocketSessionBroadcastAcceptanceTest > shouldBroadcastOnMultipleTopics() FAILED
java.lang.InternalError at MultipleWebSocketSessionBroadcastAcceptanceTest.java:91
MultipleWebSocketSessionDirectSessionContainerAcceptanceTest > shouldHandleMultipleSessions() FAILED
java.lang.InternalError at MultipleWebSocketSessionDirectSessionContainerAcceptanceTest.java:68
BackPressureDirectSessionContainerAcceptanceTest > shouldHandleSingleClient() FAILED
java.lang.InternalError at BackPressureDirectSessionContainerAcceptanceTest.java:64
DockerComposeIntegrationTest > shouldExposeMonitoringData() FAILED
java.io.IOException at DockerComposeIntegrationTest.java:74
Caused by: java.io.IOException at DockerComposeIntegrationTest.java:74
SessionStatisticsFileTest > insertionAndRemoval() FAILED
java.lang.InternalError at SessionStatisticsFileTest.java:180
SessionStatisticsFileTest > shouldRemoveEntryInMiddleOfFile() FAILED
java.lang.InternalError at SessionStatisticsFileTest.java:162
SessionStatisticsFileTest > shouldRemoveEntryAtEndOfFile() FAILED
java.lang.InternalError at SessionStatisticsFileTest.java:180
SessionStatisticsFileTest > shouldContainMaximumEntryCount() FAILED
java.lang.InternalError at SessionStatisticsFileTest.java:100
SessionStatisticsFileTest > shouldRemoveEntryAtStartOfFile() FAILED
java.lang.InternalError at SessionStatisticsFileTest.java:162
SessionStatisticsFileTest > shouldAddNewEntries() FAILED
java.lang.InternalError at SessionStatisticsFileTest.java:72
Let me know if you need any specific traces of the above failures
Hi, thank you for the report.
ARM is not a target platform at the moment, and we don't have an RPI to reproduce on.
If you would like to investigate, I would suggest looking at any hs_err_pid
files output during the test run. Please raise a PR if you identify any changes that fix the issue you are seeing.
@eliquinox the only other things that comes to mind is that it could be an alignment issue. There are some resources suggesting that ARM has different alignment requirements for certain instructions.
You could try modifying the offsets in the various Mapped*
files to all be 64-bits wide for instance (or 128-bit depending on architecture [1]). You'll need to trace where all those alignments start from. For instance, the alignment here:
is offset by 12 bytes here:
You may also have issues if the cache-line length is not 64 bytes.
1) https://community.arm.com/developer/ip-products/processors/f/cortex-m-forum/7154/alignment-in-arm
Appreciate the input, @epickrram. I have been experimenting with alignments of buffer offsets and sizes to 32 bits:
https://github.com/eliquinox/babl
I have managed to fix a number of alignment issues using Aeron source as inspiration. Currently stuck on maskingKeyBytes
in FrameDecoder
and I frankly do not know what can possibly be wrong with accessing elements of a 4-byte array on ARM, but an InternalError
is thrown at the line of the array's instantiation.
Firstly, thank you for taking the time to try to improve the project, and it's good to hear that you are making progress.
You say that an InternalError is thrown at the line of the array's instantiation, but that would imply that the processor doesn't allow valid Java programs to execute (i.e. declaring and initialising a 4-byte array).
I think there's a clue in the error message recent unsafe memory access operation
- the unsafe access is probably somewhere 'close by' in the temporal sense.
Looking at the code, the most recent native-memory accesses before the FrameDecoder
is instantiated is started here:
and ends up performing a write here:
Can you double-check that alignments here are correct?
Hi @eliquinox any progress on this? Anything else I can help with? I'd be happy to merge a PR to support ARM if you are able to get it to work.
Hi @epickrram. I did not make any significant further progress on this issue. I have switched target architecture to x86, and thus have no problems described any longer. As such, I do not think that I will have bandwidth to work on this in the near future, so unless you will, you can go ahead and close this issue; you may want to specify the CPU requirements somewhere in the README.md
accordingly.
Understood. Thanks for the initial investigation work. I may pick it up again in future.
Running WS server on the following system:
Raspberry Pi 4 Model B 8GB OS: Ubuntu Server 20.04 (64 bit)
The same program works perfectly from my Dell XPS laptop, running Ubuntu 18.04 with the following cpu:
I am willing to test any suggestions.