-
Notifications
You must be signed in to change notification settings - Fork 59
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
Running test on mac-os #37
Comments
I am seeing this issue also. |
The problem is global variables that are re-declared in multiple places instead of declared once and then "extern" in other places. Specifically there are 5 function pointers in src/poly.h that need to be I will have a pull request within a day - as soon as I have tested this across all the different architectures. The pull request will also allow for compilation with llvm (clang) on mac. |
Working for me now after applying your changes @pschlump |
The reason for using the ifdef(s) in the code instead of just disabling SSE/AVX2 is because the problem is compile dependent - not mac-os dependent. I have not determined how to get the If somebody knows how to get SSE/AVX2 to work in clang please add a note to this and I will re-build |
I am getting segfaults with the current master branch on mac OS. Somehow the function ptr is not reference properly...
Platform:
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Here is some debugging information:
There is a running process, kill it and restart?: [Y/n] yes
Process 25413 exited with status = 9 (0x00000009)
Process 25418 launched: './testnoham' (x86_64)
Running tests...
test_ntruprime_inv_int ✓
test_ntruprime_inv_poly ✓
testnoham was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 25418 stopped
frame #0: 0x000000010000495a testnoham`test_mult_int at test_poly.c:82 [opt]
79 NtruIntPoly a1 = {11, {-1, 1, 1, 0, -1, 0, 1, 0, 0, 1, -1}};
80 NtruIntPoly b1 = {11, {14, 11, 26, 24, 14, 16, 30, 7, 25, 6, 19}};
81 NtruIntPoly c1;
-> 82 ntru_mult_int(&a1, &b1, &c1, 32-1);
83 NtruIntPoly c1_exp = {11, {3, 25, -10, 21, 10, 7, 6, 7, 5, 29, -7}};
84 valid &= equals_poly_mod(&c1_exp, &c1, 32);
85
(lldb) print ntru_mult_int
(uint8_t (*)(NtruIntPoly *, NtruIntPoly *, NtruIntPoly *, uint16_t)) $0 = 0x0000000000000000
(lldb) print &ntru_mult_int
(uint8_t (**)(NtruIntPoly *, NtruIntPoly *, NtruIntPoly *, uint16_t)) $1 = 0x000000010000a328
(lldb) print ntru_mult_int
(uint8_t ()(NtruIntPoly *, NtruIntPoly *, NtruIntPoly *, uint16_t)) $2 = 0x0000000000000000
(lldb) step
Process 25418 stopped
frame #0: 0x0000000000000000
error: memory read failed for 0x0
(lldb) bt
frame test_key() stack date currupted #1: 0x000000010000497a testnoham
test_mult_int at test_poly.c:82 [opt] frame #2: 0x00000001000059b1 testnoham
test_poly at test_poly.c:313 [opt]frame MGF function incorect realization #3: 0x00000001000044f5 testnoham
main(argc=<unavailable>, argv=<unavailable>) at test.c:16 [opt] frame #4: 0x00007fffad4de235 libdyld.dylib
start + 1frame Possible memory leak in ntru_invert() #5: 0x00007fffad4de235 libdyld.dylib`start + 1
(lldb)
It is as if the function ptr are not allocated: ntru_mult_int
I know for sure, it is hitting:
#elif __SSSE3__ ntru_mult_int = &ntru_mult_int_sse; ntru_mult_tern = ntru_mult_tern_sse; ntru_to_arr = ntru_to_arr_sse; ntru_mod_mask = ntru_mod_sse;
in poly.c, however, not sure what is going on :( Any ideas?
The text was updated successfully, but these errors were encountered: