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

Segfault when calling __repr__ on an EclFile instance with invalid filepath #786

Open
lars-petter-hauge opened this issue Dec 21, 2020 · 0 comments

Comments

@lars-petter-hauge
Copy link
Contributor

Issue:

Pytest run __repr__ on an instance as part of its runtime - which typically IDE's also will do for you. __repr__ in EclFile uses getFilename which segfaults if the file path does not exist. This occurs even though an IOerror is raised as part of handling the initilization of EclFile.

https://github.com/equinor/ecl/blob/55625950b10f048e5e462bf4c7ab779d6b5b5c76/python/ecl/eclfile/ecl_file.py#L183

How to recreate:

Create a test_ecl.py with the following content

from ecl.eclfile import EclFile

def test_seg_fault_ecl():
    ecl_sum = EclFile("non_existing_file")

and run: pytest test_ecl.py

This issue is closely related to #758, where the bug was discovered when __repr__ was called on a EclSum instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants