Skip to content

This fixes a bug that appears if you use HISTOGRAM with READ - #1432

Merged
carlocamilloni merged 2 commits into
masterfrom
fix-histo-bug-for-read
Jul 17, 2026
Merged

This fixes a bug that appears if you use HISTOGRAM with READ#1432
carlocamilloni merged 2 commits into
masterfrom
fix-histo-bug-for-read

Conversation

@gtribello

Copy link
Copy Markdown
Member
Description

This PR fixes a small bug in the master version of PLUMED that I found when I was reviewing masterclass 21.2.

If you are using driver to analyze the data in colvar file only using the --noatoms option then the pbc information is not transferred to PLUMED and you get a segmentation fault. As you can see I have resolved this problem in KDE.h by checking if the PbcAction is a null pointer and not calling any function from it if it is.

Target release

I would like my code to appear in release 2.11

Type of contribution
  • changes to code or doc authored by PLUMED developers, or additions of code in the core or within the default modules
  • changes to a module not authored by you
  • new module contribution or edit of a module authored by you
Copyright
  • I agree to transfer the copyright of the code I have written to the PLUMED developers or to the author of the code I am modifying.
  • the module I added or modified contains a COPYRIGHT file with the correct license information. Code should be released under an open source license. I also used the command cd src && ./header.sh mymodulename in order to make sure the headers of the module are correct.
Tests
  • I added a new regtest or modified an existing regtest to validate my changes.
  • I verified that all regtests are passed successfully on GitHub Actions.

If you are using driver to analyze the data in colvar file only using the --noatoms option then
the pbc information is not transferred to PLUMED and you get a segmentation fault. As you can see
I have resolved this problem in KDE.h by checking if the PbcAction is a null pointer and not calling
any function from it if it is.
@gtribello
gtribello requested a review from carlocamilloni July 16, 2026 14:36
@carlocamilloni

Copy link
Copy Markdown
Member

@gtribello This looks fine but we need a regtest that fails before and pass after the change to be sure that the bug is not inadvertently reintroduced in the future

@gtribello

Copy link
Copy Markdown
Member Author

HI @carlocamilloni

I have added the retest. Here is what happens if you try the test with the master version of PLUMED that doesn't have this fix

segfault

@carlocamilloni
carlocamilloni merged commit 4a22744 into master Jul 17, 2026
48 of 50 checks passed
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

Successfully merging this pull request may close these issues.

2 participants