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

Fix net.openhft.chronicle.salt.EasyBoxTest #13

Closed
RobAustin opened this issue Dec 5, 2018 · 9 comments
Closed

Fix net.openhft.chronicle.salt.EasyBoxTest #13

RobAustin opened this issue Dec 5, 2018 · 9 comments
Assignees

Comments

@RobAustin
Copy link
Contributor

please fix this test, net.openhft.chronicle.salt.EasyBoxTest, for now, it has been ignored because it fails on TeamCity, see http://teamcity.higherfrequencytrading.com/viewLog.html?buildId=309860&buildTypeId=OpenHFT_ChronicleSalt_Snapshot&tab=buildLog&_focus=14105

@RobAustin
Copy link
Contributor Author

RobAustin commented Dec 5, 2018

pastedgraphic-2

we updated EasyBox to use sodium 1.0.16 but this test is still failing, It works for @peter-lawrey on his laptop.

RobAustin pushed a commit that referenced this issue Dec 5, 2018
@rogersimmons rogersimmons changed the title Fixed net.openhft.chronicle.salt.EasyBoxTest Fix net.openhft.chronicle.salt.EasyBoxTest Dec 7, 2018
@rogersimmons
Copy link

This appears to be an issue with the current version of JNR FFI - specifically, it is corrupting the 6th argument in the crypto_box_(open)_easy calls (the secret key). These are the only functions in the Sodium interface which take so many arguments, hence why only the EasyBox tests failing.

A stand-alone C version running on the same libsodium version works fine.
Intercepting the JNR-FFI call with a manual C lib/function exposing the same interface shows the corruption of the 6th arg. Interestingly the corruption is of a constant form - looks like the last 4 bytes or so of the 6th argument (which is a pointer/address) is being clobbered with a constant value.

Continuing to look into options. This may need a bug report raised to JNR-FFI.

@rogersimmons
Copy link

Confirmed. Amending the Java code to wrap all the addresses into a long[] array, and just forwarding this one argument via JNR FFI through an intermediate C .so which unpacks and calls on to sodium works fine (EasyBox tests pass). Using this as a stopgap for now while a fix from JNR FFI is pending.

@rogersimmons
Copy link

This is now fixed.
The 2 problematic EasyBox calls which are being corrupted by JNR-FFI has been switched to JNI for now following the same model as Chronicle-Ticker

@rogersimmons
Copy link

JNR-FFI issue raised:
jnr/jnr-ffi#181

@hft-team-city
Copy link

Released in Chronicle-Salt-2.17.2, BOM-2.17.119

@hft-team-city
Copy link

Released in Chronicle-Salt-2.17.2, BOM-2.17.196

@hft-team-city
Copy link

Released in Chronicle-Salt-2.17.2, BOM-2.17.225

@hft-team-city
Copy link

Released in Chronicle-Salt-2.17.2, BOM-2.17.241

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

4 participants