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

Fix malloc error 'Incorrect checksum for freed object' for custom spacing functions #135

Merged
merged 3 commits into from
Apr 19, 2023

Conversation

n-claes
Copy link
Owner

@n-claes n-claes commented Apr 19, 2023

PR description

It seems that #129 introduced a pesky bug if the dx spacing function was chosen in such a way that the number of gridpoints increased with respect to the user-set gridpoints, such that these got updated. This change was not propagated correctly to the eigenvalue/eigenvector arrays, which were initialised too early.
This led to the following error, which popped up at completely random times

legolas(32399,0x7ff85dcc8340) malloc: 
Incorrect checksum for freed object 0x7f9cb4012400: probably modified after being freed.
Corrupt value: 0x3ff1e376c990c00a
legolas(32399,0x7ff85dcc8340) malloc: *** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT: Process abort signal.
zsh: abort      ./legolas -i config.par

Re-arranging array allocations in the main program so they take place after the grid has been initialised (and thus use the modified number of gridpoints) seems to have fixed the issue.

Bugfixes

Legolas

  • Heisenbugfix: malloc error at random intervals when specifying a custom spacing function

@n-claes n-claes added the bug Something isn't working label Apr 19, 2023
@n-claes n-claes added this to the Legolas 2.0 milestone Apr 19, 2023
@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #135 (04feed7) into develop (b255f61) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #135   +/-   ##
========================================
  Coverage    90.64%   90.65%           
========================================
  Files          158      158           
  Lines         8893     8899    +6     
========================================
+ Hits          8061     8067    +6     
  Misses         832      832           
Flag Coverage Δ
legolas 93.14% <100.00%> (+<0.01%) ⬆️
pylbo 86.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@n-claes n-claes merged commit e98d984 into develop Apr 19, 2023
@n-claes n-claes deleted the bugfix/matrices_custom_dx branch April 19, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant