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

MAX_SIG_SIZE limitation #3

Open
Henriojord opened this issue Aug 20, 2014 · 3 comments
Open

MAX_SIG_SIZE limitation #3

Henriojord opened this issue Aug 20, 2014 · 3 comments

Comments

@Henriojord
Copy link

If you set the MAX_SIG_SIZE value upper than 1015, the program crashes with a segmentation fault.

@andreasjansson
Copy link
Owner

@Henriojord Huh, nice find! I'll have a look if I see something obvious, or at least put a warning in the code.

@Henriojord
Copy link
Author

I'm not sure, but the bug seems to come from the variable "Delta", in "russel" function.

@tnaumann
Copy link

tnaumann commented Jul 9, 2015

This appears to be a limitation of emd.c. Several arrays are created of length MAX_SIG_SIZE1 which are managed by the stack and consequently large values of MAX_SIG_SIZE can cause a seg fault.

You may be able to get around this by changing the default stack size allocation (e.g. via /etc/security/limits.conf) before compiling, but a better solution probably involves rewriting the file in order to allocate space via malloc. NB: Some things (e.g. MATLAB's mex) may not respect this value anyway.

@Henriojord I suspect that if things failed in russel it was because either D[MAX_SIG_SIZE1] and S[MAX_SIG_SIZE1] created in init were not able to be properly passed (causing a seg fault on the opening brace) or there wasn't enough space for one of the variable initializations in russel (e.g. causing a seg fault on Delta[MAX_SIG_SIZE1][MAX_SIG_SIZE1]).

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

3 participants