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

fixed: do not dereference invalid iterator #5624

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akva2
Copy link
Member

@akva2 akva2 commented Sep 23, 2024

if a well has connections added in an action, the well perf data is not yet initialized in the call to updateEclWells. it will however be reinitialized before the next time step so simply adding a bounds check here avoid the invalid dereference and the connection factor will take effect through the reinitialization.

ref e.g. https://ci.opm-project.org/job/opm-simulators-static-analysis/383/testReport/junit/(root)/debug_iterator/compareSeparateECLFiles_flow_pyaction_gruptree_insert_kw/

if a well has connections added in an action, the well perf data
is not yet initialized in the call to updateEclWells. it will however
be reinitialized before the next time step so simply adding a bounds
check here avoid the invalid dereference and the connection factor
will take effect through the reinitialization.
@akva2
Copy link
Member Author

akva2 commented Sep 23, 2024

jenkins build this please

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the face of it this looks benign, but I need to review the wider context here. Please hold any further action here.

@lisajulia
Copy link
Contributor

lisajulia commented Sep 24, 2024

You mean the perf data will be initialized here at the beginning of each time step (https://github.com/OPM/opm-simulators/blob/master/opm/simulators/wells/BlackoilWellModel_impl.hpp#L436 and then https://github.com/OPM/opm-simulators/blob/master/opm/simulators/wells/BlackoilWellModel_impl.hpp#L343) , right?

Looks fine :) @akva2: can you possibly add a comment about the newly introduced check and why it is needed?

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.

3 participants