Skip to content

Segfault when swapping Field3D after mergeYupYdown #1568

Description

@johnomotani

If mergeYupDown() has been called on a Field3D so that its yup_field and ydown_field pointers point to itself, then swapping it may cause a segfault. The problem is that the yup_field and ydown_field pointers are swapped, but continue to point to the original field. The check in the ~Field3D() destructor on whether to delete yup_field or ydown_field will then not skip the delete, and already-deleted memory will be deleted, causing a segfault.

@dschwoerer has a fix for this in 8eae21d of #956.
The issue is also fixed by #1345 which changes the implementation of mergeYupYdown().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions