Skip to content

Fix for #3789, segfault in _tri - #3797

Merged
jenshnielsen merged 1 commit into
matplotlib:masterfrom
ianthomas23:3789_segfault
Nov 14, 2014
Merged

jenshnielsen merged 1 commit into
matplotlib:masterfrom
ianthomas23:3789_segfault

Conversation

@ianthomas23

Copy link
Copy Markdown
Member

Candidate fix for issue #3789. Segfaults were occurring when travis was running test_tritools, but only under python 3. This is an esoteric one - my local tests all ran fine under python 3 with both old and new gcc and numpy, so I could only debug by pushing candidate fixes to my github mpl repository and running travis on them there. That's a new form of remote debugging for me.

The problem occurs accessing const/non-const boolean arrays wrapped in the new numpy::array_view classes. It shouldn't occur, but evidently some combination of hardware, gcc and python versions behave differently.

I will need to go through the travis logs with a fine toothcomb before this is merged.

@jenshnielsen: Thanks for reporting this.

@ianthomas23

Copy link
Copy Markdown
Member Author

@mdboom: It looks like I spoke too soon about knowing what I was doing with numpy::array_view<bool>! If we get any further problems I may have to resort to the plan B of using array_view<unsigned char> instead.

@jenshnielsen

Copy link
Copy Markdown
Member

Could the differences with respect to numpy be due to numpy/numpy#5203 which relates to some strange sharing of masks in Numpy between 1.7.0 and 1.9.0 (fixed in numpy 1.9.1) We have been bitten by this before in a different context.

@ianthomas23

Copy link
Copy Markdown
Member Author

@jenshnielsen: I don't think so. Although the problem arrays are known as 'masks', they are standalone boolean arrays rather than masks of numpy MaskedArrays. Plus it looks like the problems occurring on travis all used numpy 1.6.1. But I will be keeping an eye on this in case I am wrong.

@jenshnielsen

Copy link
Copy Markdown
Member

@ianthomas23 your probably right. It just crossed my mind when I saw the changes.

@ianthomas23

Copy link
Copy Markdown
Member Author

I've checked all of the travis logs and this PR does indeed fix the problem, so is ready to be merged.

@jenshnielsen

Copy link
Copy Markdown
Member

Great

jenshnielsen added a commit that referenced this pull request Nov 14, 2014
@jenshnielsen
jenshnielsen merged commit cae5a8e into matplotlib:master Nov 14, 2014
@ianthomas23
ianthomas23 deleted the 3789_segfault branch July 8, 2021 18:21
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