Skip to content

Segfault with Python 3.7#540

Merged
stevengj merged 3 commits into
JuliaPy:masterfrom
tkf:py37-segfault
Aug 28, 2018
Merged

Segfault with Python 3.7#540
stevengj merged 3 commits into
JuliaPy:masterfrom
tkf:py37-segfault

Conversation

@tkf

@tkf tkf commented Aug 26, 2018

Copy link
Copy Markdown
Member

Running tests with Python 3.7 segfaults. I try to reproduce the issue on Travis in this PR.

The minimal code I found to cause the segfault was:

using PyCall, Dates; convert(PyObject, DateTime(2013))

Added: closes #544

@tkf tkf force-pushed the py37-segfault branch 2 times, most recently from 64efd17 to 2b7ab9e Compare August 26, 2018 17:31
@tkf

tkf commented Aug 26, 2018

Copy link
Copy Markdown
Member Author

So in all platforms and all Julia versions, we have segfaults.
https://travis-ci.org/JuliaPy/PyCall.jl/builds/420806360
(see, e.g., https://travis-ci.org/JuliaPy/PyCall.jl/jobs/420806366#L881)

@tkf

tkf commented Aug 26, 2018

Copy link
Copy Markdown
Member Author

Just applying the change in PyDateTime_CAPI struct from https://github.com/python/cpython/pull/5032/files#diff-fbac1e7a0d4bf4957e460fa4560277f4 fixes the segfault.

I didn't touch anything else to add full support of the new C APIs: https://docs.python.org/3/whatsnew/3.7.html#c-api-changes

@tkf

tkf commented Aug 26, 2018

Copy link
Copy Markdown
Member Author

Actually, TZInfoType wasn't used either and stdlib Dates does not support timezone anyway. So I guess this PR is good to go?

Comment thread .travis.yml Outdated
- julia --color=yes -e 'VERSION < v"0.7.0-DEV.5183" || using Pkg; Pkg.add("Conda")'
- if [ "x$PYTHON" = xConda ]; then
julia --color=yes -e 'using Conda; Conda.add("python=3.7")';
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather test the default for Conda here.

Maybe change AppVeyor to test Python 3.7 instead of Python 3.4, now that appveyor/ci#2475 made the former available.

@stevengj

stevengj commented Aug 27, 2018

Copy link
Copy Markdown
Member

Thanks for looking into this!

@tkf

tkf commented Aug 27, 2018

Copy link
Copy Markdown
Member Author

Right, I agree that testing against the default Conda.jl setup is important.

I changed Python 3 version in appveyor.yml as you suggested. If #543 CI fails and CI here succeeds, I think it's good to go.

@codecov-io

codecov-io commented Aug 28, 2018

Copy link
Copy Markdown

Codecov Report

Merging #540 into master will decrease coverage by 0.86%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #540      +/-   ##
==========================================
- Coverage   52.26%   51.39%   -0.87%     
==========================================
  Files          19       19              
  Lines        1502     1502              
==========================================
- Hits          785      772      -13     
- Misses        717      730      +13
Impacted Files Coverage Δ
src/pydates.jl 62.5% <ø> (ø) ⬆️
src/conversions.jl 49.38% <0%> (-3.4%) ⬇️
src/pyinit.jl 72.72% <0%> (-1.82%) ⬇️
src/numpy.jl 50.3% <0%> (-0.61%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 849adab...60381c2. Read the comment docs.

@tkf

tkf commented Aug 28, 2018

Copy link
Copy Markdown
Member Author

I rebased this PR onto #544 as it looks like previously tests in x64 AppVeyor were not run properly. The tests were actually run against Python installed via conda since binary incompatibility was automatically detected. Now that I fixed it, Python 3.7 in both x86 and x64 correctly segfault in #544. So this PR should be good to go once the tests here all pass.

@stevengj stevengj merged commit 9224c60 into JuliaPy:master Aug 28, 2018
@tkf tkf deleted the py37-segfault branch November 4, 2018 13:44
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