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

LedaKemLT52 cannot be run in a worker thread on macOS #608

Closed
vsoftco opened this issue Feb 7, 2020 · 4 comments
Closed

LedaKemLT52 cannot be run in a worker thread on macOS #608

vsoftco opened this issue Feb 7, 2020 · 4 comments
Labels
bug Something isn't working; high priority to fix

Comments

@vsoftco
Copy link
Member

vsoftco commented Feb 7, 2020

Due to small stack size of worker threads under macOS (512kb), LEDAKEM52LT emits a BUS ERROR (access violations -Exception: EXC_BAD_ACCESS (code=1, address=0x70000292c4c8) ) when attempted to be run in a non-main (worker) thread under macOS. The first culprit is

uint8_t gamma[N0][N0][P] = {{{0}}};

where the array gamma seems to have 609068 bytes, more than can be stored on the stack of a single non-main thread in macOS (512kb). Allocating gamma on the heap still doesn't solve the problem, other violations of the same sort keep appearing (I didn't have time to go over the rest). So we should think whether we want to keep the code as is, or document that it shouldn't be run on a thread under macOS, or change it.

@vsoftco vsoftco changed the title LEDAKEM52LT cannot be run in a worker thread on macOS LedaKemLT52 cannot be run in a worker thread on macOS Feb 7, 2020
@vsoftco vsoftco added the bug Something isn't working; high priority to fix label Feb 8, 2020
@dstebila
Copy link
Member

Do you have a sense of how many places we'd have to change to make this work? A few or dozens and dozens?

@vsoftco
Copy link
Member Author

vsoftco commented Mar 7, 2020

@dstebila Definitely more than 1 place. I tried changing the first stack allocation, and got into another issue of the same flavour down the line. I'll look into it when I get some time. Hopefully not dozens and dozens and places we'd need to change.

@dstebila
Copy link
Member

795c1b7#diff-9d282cb2abf60a78fb263d773e0dabe2R84 fixed a memory leak in LEDAkem, there could be a small chance this fixed it?

@dstebila
Copy link
Member

dstebila commented Apr 1, 2020

WONTFIX for now.

@dstebila dstebila closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working; high priority to fix
Projects
None yet
Development

No branches or pull requests

2 participants