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

error() functions does not work correctly #1198

Open
GiovanniBussi opened this issue Feb 17, 2025 · 0 comments
Open

error() functions does not work correctly #1198

GiovanniBussi opened this issue Feb 17, 2025 · 0 comments

Comments

@GiovanniBussi
Copy link
Member

This was reported by @ollyfutur . The Action::error function results in a segmentation fault when called within the calculate function. A way to reproduce it is to go in plumed2/regtest/basic/rt-make-load and test these changes in the file Distance10.cpp

  • First, use error("xxxx") in the constructor. This will just make the test file and result in a tmp/log_threads10 containing the following line:
PLUMED: ERROR in input to action DISTANCE with label d_loaded : xxxx
  • Then, use error("xxxx")in the calculate function. The code will crash with abus error`.

  • Then, use plumed_error()<<"xxxx"; in the calculate function. The stderr will contain something like this:

libc++abi: terminating due to uncaught exception of type PLMD::Plumed::ExceptionError: 
(Distance10.ziScdp.cpp:87) virtual void PLMD::Distance::calculate()
xxxx

@ollyfutur suggested that the error happens at if( !keywords.exists("NO_ACTION_LOG") ). @gtribello does this make sense?

@gtribello gtribello mentioned this issue Feb 17, 2025
7 tasks
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

1 participant