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

HDF5 crashes with large 2d grids on Mac #40

Open
IanHawke opened this issue Mar 26, 2021 · 5 comments
Open

HDF5 crashes with large 2d grids on Mac #40

IanHawke opened this issue Mar 26, 2021 · 5 comments

Comments

@IanHawke
Copy link
Collaborator

double buffer[buffer_size];

When running on 1024^2 with ToyQ on Mac, the buffer creation segfaults. Replacing this line with

double *buffer = (double *) malloc(buffer_size*sizeof(double));

seems to work.

Unless someone objects, I will change this to an explicit malloc (note: need to check parallel case).

@AlexJamesWright
Copy link
Owner

AlexJamesWright commented Mar 26, 2021

Shouldn't this be
double * buffer = new double[buffer_size]
buffer_size isnt a constant so cant allocated at compile time

@AlexJamesWright
Copy link
Owner

Same needs to be done for the lengths variable just above I think too

@AlexJamesWright
Copy link
Owner

bd46c18 has a mem leak, Ian - *audible tutting*

@IanHawke
Copy link
Collaborator Author

Memory leak addressed in 7e9eeca but I didn't bother with the lengths variable as it's max size 3.

@AlexJamesWright
Copy link
Owner

FYI when you do fixes can you do them on a new branch so they can be merged into master sooner than the feature branches? Thnks

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

2 participants