-
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
realloc()-invalid next size error during repopulate() in 3D models #709
Comments
Hi @tiannh7 , A debug idea. You could reduce the the size of the 3D models mesh, naturally this would decrease the particle population. What happens if you do this? Another thing to check is for 'unexpected' flow occurring just before the error? An example of this is a cell without a particle, ie. an 'empty' cells. This is a condition Underworld can't deal with. Is there outflow in the model, or stagnation points? Let me know. |
Hi @julesghub, Thank you for your response and for looking into this issue. I'd like to provide some updates and clarifications based on your suggestions:
I hope this information is useful for understanding and potentially addressing this issue in future versions. Please let me know if I can assist further or provide additional details! Best, |
Thanks for the detailed response. While I'm looking at that feel free to make a PR with this change to UW and we can check how the modification effects other models. cheers, |
Thank you for your response and for explaining how Regarding sharing the 3D model, I’d like to first ensure that this issue is not specific to my particular setup or model. To do so, I am currently working on creating a simpler and more general example that reproduces the same error. This approach should help confirm whether the problem is more broadly applicable and make it easier to investigate without the complexities of my original model. I just need a little more time to finalize this test case, as I want to make sure it reliably reproduces the issue. Once I have it ready, I’ll share it here so we can further analyze the problem together. Thank you for your patience and understanding! If there’s anything specific you’d like me to focus on while preparing the example, feel free to let me know. best, |
That sounds great! A simplified example is most welcome. Nothing specific from my end yet. |
Hi,
I am encountering a recurring issue when running 3D models using Underworld2. The error seems to be related to memory allocation (realloc()), as detailed below. Interestingly, this issue only occurs in 3D simulations and never in 2D models.
When running a 3D model and calling
repopulate()
as part of the simulation workflow, the program crashes intermittently with the following error:This error occurs unpredictably, sometimes after hundreds of steps, and sometimes after fewer or more steps. it seems to stem from a small omission, but it will continue to accumulate. I have tried using different parameters for
repopulate()
(instead of the default settings), and execute on different machines, but the issue persists regardless of the parameters used.I suspect the problem might be in functions like
_DVCWeights_UpdateBchain
or_DVCWeights_CreateVoronoi3D
, which involve memory resizing (e.g.,realloc()
). If the allocated memory is unintentionally accessed or modified beyond its bounds, this reserved metadata can be corrupted.Environment:
Underworld2 version: v2.15.0b0 release
Python version: 3.11.3
OS: Ubuntu 22.04
The text was updated successfully, but these errors were encountered: