Skip to content

Conversation

@eric-wieser
Copy link
Member

Extracted from #9022, since that's segfaulting, and maybe this piece is fine.

goto fail;
}

Py_DECREF(mps[j]);
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm pretty sure that there's a segfault in master for a ufunc with more than one output, where only the second __array_wrap__ fails - this ends up being decref'd both here and in fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, fixed in #11296

PyErr_Clear();
res = PyObject_CallFunctionObjArgs(wrap, mps[j], NULL);
}
Py_DECREF(wrap);
Copy link
Member Author

Choose a reason for hiding this comment

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

Memory leak here (and in the new version) - this won't get decref'd for the second output if the first fails.

}

Py_DECREF(mps[j]);
retobj[i] = res;
Copy link
Member Author

Choose a reason for hiding this comment

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

This memory is also leaked if the second one errors.

@eric-wieser
Copy link
Member Author

Closing - I learnt what I needed to here

@eric-wieser eric-wieser deleted the array-wrap-helper branch June 11, 2018 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant