{"action":"created","issue":{"url":"https://api.github.com/repos/tbuktu/libntru/issues/37","repository_url":"https://api.github.com/repos/tbuktu/libntru","labels_url":"https://api.github.com/repos/tbuktu/libntru/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/tbuktu/libntru/issues/37/comments","events_url":"https://api.github.com/repos/tbuktu/libntru/issues/37/events","html_url":"https://github.com/tbuktu/libntru/issues/37","id":242895582,"number":37,"title":"Running test on mac-os","user":{"login":"berserkr","id":5473173,"avatar_url":"https://avatars5.githubusercontent.com/u/5473173?v=4","gravatar_id":"","url":"https://api.github.com/users/berserkr","html_url":"https://github.com/berserkr","followers_url":"https://api.github.com/users/berserkr/followers","following_url":"https://api.github.com/users/berserkr/following{/other_user}","gists_url":"https://api.github.com/users/berserkr/gists{/gist_id}","starred_url":"https://api.github.com/users/berserkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berserkr/subscriptions","organizations_url":"https://api.github.com/users/berserkr/orgs","repos_url":"https://api.github.com/users/berserkr/repos","events_url":"https://api.github.com/users/berserkr/events{/privacy}","received_events_url":"https://api.github.com/users/berserkr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-14T04:39:42Z","updated_at":"2017-07-17T01:20:58Z","closed_at":null,"body":"I am getting segfaults with the current master branch on mac OS. Somehow the function ptr is not reference properly...\r\n\r\nPlatform:\r\n\r\nApple LLVM version 8.1.0 (clang-802.0.42)\r\nTarget: x86_64-apple-darwin16.6.0\r\nThread model: posix\r\nInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin\r\n\r\nHere is some debugging information:\r\n\r\n\r\nThere is a running process, kill it and restart?: [Y/n] yes\r\nProcess 25413 exited with status = 9 (0x00000009)\r\nProcess 25418 launched: './testnoham' (x86_64)\r\nRunning tests...\r\n  test_ntruprime_inv_int   ✓\r\n  test_ntruprime_inv_poly  ✓\r\ntestnoham was compiled with optimization - stepping may behave oddly; variables may not be available.\r\nProcess 25418 stopped\r\n* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1\r\n    frame #0: 0x000000010000495a testnoham`test_mult_int at test_poly.c:82 [opt]\r\n   79       NtruIntPoly a1 = {11, {-1, 1, 1, 0, -1, 0, 1, 0, 0, 1, -1}};\r\n   80       NtruIntPoly b1 = {11, {14, 11, 26, 24, 14, 16, 30, 7, 25, 6, 19}};\r\n   81       NtruIntPoly c1;\r\n-> 82       ntru_mult_int(&a1, &b1, &c1, 32-1);\r\n   83       NtruIntPoly c1_exp = {11, {3, 25, -10, 21, 10, 7, 6, 7, 5, 29, -7}};\r\n   84       valid &= equals_poly_mod(&c1_exp, &c1, 32);\r\n   85\r\n(lldb) print ntru_mult_int\r\n(uint8_t (*)(NtruIntPoly *, NtruIntPoly *, NtruIntPoly *, uint16_t)) $0 = 0x0000000000000000\r\n(lldb) print &ntru_mult_int\r\n(uint8_t (**)(NtruIntPoly *, NtruIntPoly *, NtruIntPoly *, uint16_t)) $1 = 0x000000010000a328\r\n(lldb) print *ntru_mult_int\r\n(uint8_t (*)(NtruIntPoly *, NtruIntPoly *, NtruIntPoly *, uint16_t)) $2 = 0x0000000000000000\r\n(lldb) step\r\nProcess 25418 stopped\r\n* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)\r\n    frame #0: 0x0000000000000000\r\nerror: memory read failed for 0x0\r\n(lldb) bt\r\n* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)\r\n  * frame #0: 0x0000000000000000\r\n    frame #1: 0x000000010000497a testnoham`test_mult_int at test_poly.c:82 [opt]\r\n    frame #2: 0x00000001000059b1 testnoham`test_poly at test_poly.c:313 [opt]\r\n    frame #3: 0x00000001000044f5 testnoham`main(argc=<unavailable>, argv=<unavailable>) at test.c:16 [opt]\r\n    frame #4: 0x00007fffad4de235 libdyld.dylib`start + 1\r\n    frame #5: 0x00007fffad4de235 libdyld.dylib`start + 1\r\n(lldb)\r\n\r\n\r\nIt is as if the function ptr are not allocated: ntru_mult_int\r\n\r\nI know for sure, it is hitting:\r\n\r\n`\r\n#elif __SSSE3__\r\n    ntru_mult_int = &ntru_mult_int_sse;\r\n    ntru_mult_tern = ntru_mult_tern_sse;\r\n    ntru_to_arr = ntru_to_arr_sse;\r\n    ntru_mod_mask = ntru_mod_sse;\r\n`\r\n\r\nin poly.c, however, not sure what is going on :( Any ideas?\r\n"},"comment":{"url":"https://api.github.com/repos/tbuktu/libntru/issues/comments/315652489","html_url":"https://github.com/tbuktu/libntru/issues/37#issuecomment-315652489","issue_url":"https://api.github.com/repos/tbuktu/libntru/issues/37","id":315652489,"user":{"login":"pschlump","id":543809,"avatar_url":"https://avatars6.githubusercontent.com/u/543809?v=4","gravatar_id":"","url":"https://api.github.com/users/pschlump","html_url":"https://github.com/pschlump","followers_url":"https://api.github.com/users/pschlump/followers","following_url":"https://api.github.com/users/pschlump/following{/other_user}","gists_url":"https://api.github.com/users/pschlump/gists{/gist_id}","starred_url":"https://api.github.com/users/pschlump/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pschlump/subscriptions","organizations_url":"https://api.github.com/users/pschlump/orgs","repos_url":"https://api.github.com/users/pschlump/repos","events_url":"https://api.github.com/users/pschlump/events{/privacy}","received_events_url":"https://api.github.com/users/pschlump/received_events","type":"User","site_admin":false},"created_at":"2017-07-17T01:20:58Z","updated_at":"2017-07-17T01:20:58Z","body":"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\r\nextern in the .h file and then declared in src/poly.c.\r\n\r\nI 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."}}
{"actor":{"display_login":"pschlump"}}