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

cffi issue on NetBSD #3372

Closed
0-wiz-0 opened this issue Jan 28, 2017 · 12 comments
Closed

cffi issue on NetBSD #3372

0-wiz-0 opened this issue Jan 28, 2017 · 12 comments

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Jan 28, 2017

py-acme does not work on NetBSD. Tracking down the cause I arrived at py-cryptography. It fails the self tests with:

cd .../cryptography-1.7.2 && py.test-3.6
======================================================================================= test session starts ========================================================================================
platform netbsd7 -- Python 3.6.0, pytest-3.0.5, py-1.4.30, pluggy-0.4.0
OpenSSL: OpenSSL 1.0.2j  26 Sep 2016
rootdir: /scratch/security/py-cryptography/work/cryptography-1.7.2, inifile:
collected 86445 items / 4 skipped 

tests/test_cryptography_utils.py .
tests/test_fernet.py ........................
tests/test_interfaces.py .....
tests/test_utils.py ........................................
tests/test_warnings.py ..
tests/test_x509.py ....................................................................................ss....................................................................................................................................
tests/test_x509_crlbuilder.py ..............................
tests/test_x509_ext.py ..............................................................................................................................................................................................................................................................................................
tests/test_x509_revokedcertbuilder.py ....................
tests/hazmat/backends/test_backendinit.py ..
tests/hazmat/backends/test_commoncrypto.py ssss
tests/hazmat/backends/test_multibackend.py ..............
tests/hazmat/backends/test_openssl.py .............................s.........ss....ss.ss.ss.[1]   Segmentation fault (core dumped) py.test-3.6
*** Error code 139

gdb gives:

# gdb /usr/pkg/bin/python3.6 .../cryptography-1.7.2/python3.6.core
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000700326088fc0 in ?? ()
(gdb) bt
#0  0x0000700326088fc0 in ?? ()
#1  0x000070031c405618 in ffi_call_unix64 () from /usr/pkg/lib/libffi.so.6
#2  0x000070031c4050cd in ffi_call () from /usr/pkg/lib/libffi.so.6
#3  0x000070031c81900e in cdata_call () from /usr/pkg/lib/python3.6/site-packages/_cffi_backend.so
#4  0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#5  0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#6  0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#7  0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#8  0x0000700325b34098 in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#9  0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#10 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#11 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#12 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#13 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#14 0x0000700325b2bdcb in PyEval_EvalCodeEx () from /usr/pkg/lib/libpython3.6.so.1.0
#15 0x0000700325a93ce1 in function_call () from /usr/pkg/lib/libpython3.6.so.1.0
#16 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#17 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#18 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#19 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#20 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#21 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#22 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#23 0x0000700325b34098 in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#24 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#25 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#26 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#27 0x0000700325acd262 in slot_tp_init () from /usr/pkg/lib/libpython3.6.so.1.0
#28 0x0000700325ac95a7 in type_call () from /usr/pkg/lib/libpython3.6.so.1.0
#29 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#30 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#31 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#32 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#33 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#34 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#35 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#36 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#37 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#38 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#39 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#40 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#41 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#42 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#43 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#44 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#45 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#46 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#47 0x0000700325b33eba in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#48 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#49 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#50 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#51 0x0000700325acd569 in slot_tp_call () from /usr/pkg/lib/libpython3.6.so.1.0
#52 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#53 0x0000700325a66f99 in _PyObject_FastCallKeywords () from /usr/pkg/lib/libpython3.6.so.1.0
#54 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#55 0x0000700325b2d22f in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#56 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#57 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#58 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#59 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#60 0x0000700325b2bdcb in PyEval_EvalCodeEx () from /usr/pkg/lib/libpython3.6.so.1.0
#61 0x0000700325a93ce1 in function_call () from /usr/pkg/lib/libpython3.6.so.1.0
#62 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#63 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#64 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#65 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#66 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#67 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#68 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#69 0x0000700325b34098 in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#70 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#71 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#72 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#73 0x0000700325acd262 in slot_tp_init () from /usr/pkg/lib/libpython3.6.so.1.0
#74 0x0000700325ac95a7 in type_call () from /usr/pkg/lib/libpython3.6.so.1.0
#75 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#76 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#77 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#78 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#79 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#80 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#81 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#82 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#83 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#84 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#85 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#86 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#87 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#88 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#89 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#90 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#91 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#92 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#93 0x0000700325b33eba in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#94 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#95 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#96 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#97 0x0000700325acd569 in slot_tp_call () from /usr/pkg/lib/libpython3.6.so.1.0
#98 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#99 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#100 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#101 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#102 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#103 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#104 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#105 0x0000700325b33eba in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#106 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#107 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#108 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#109 0x0000700325acd262 in slot_tp_init () from /usr/pkg/lib/libpython3.6.so.1.0
#110 0x0000700325ac95a7 in type_call () from /usr/pkg/lib/libpython3.6.so.1.0
#111 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#112 0x0000700325a66f99 in _PyObject_FastCallKeywords () from /usr/pkg/lib/libpython3.6.so.1.0
#113 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#114 0x0000700325b2d22f in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#115 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#116 0x0000700325b2bdcb in PyEval_EvalCodeEx () from /usr/pkg/lib/libpython3.6.so.1.0
#117 0x0000700325a93dd1 in function_call () from /usr/pkg/lib/libpython3.6.so.1.0
#118 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#119 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#120 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#121 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#122 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#123 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#124 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#125 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#126 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#127 0x0000700325b2d22f in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#128 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#129 0x0000700325b2bdcb in PyEval_EvalCodeEx () from /usr/pkg/lib/libpython3.6.so.1.0
#130 0x0000700325a93ce1 in function_call () from /usr/pkg/lib/libpython3.6.so.1.0
#131 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#132 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#133 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#134 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#135 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#136 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#137 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#138 0x0000700325b34098 in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#139 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#140 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#141 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#142 0x0000700325acd262 in slot_tp_init () from /usr/pkg/lib/libpython3.6.so.1.0
#143 0x0000700325ac95a7 in type_call () from /usr/pkg/lib/libpython3.6.so.1.0
#144 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#145 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#146 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#147 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#148 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#149 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#150 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#151 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#152 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#153 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#154 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#155 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#156 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#157 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#158 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#159 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#160 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#161 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#162 0x0000700325b33eba in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#163 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#164 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#165 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#166 0x0000700325acd569 in slot_tp_call () from /usr/pkg/lib/libpython3.6.so.1.0
#167 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#168 0x0000700325a66f99 in _PyObject_FastCallKeywords () from /usr/pkg/lib/libpython3.6.so.1.0
#169 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#170 0x0000700325b2d22f in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#171 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#172 0x0000700325b2bdcb in PyEval_EvalCodeEx () from /usr/pkg/lib/libpython3.6.so.1.0
#173 0x0000700325a93ce1 in function_call () from /usr/pkg/lib/libpython3.6.so.1.0
#174 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#175 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#176 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#177 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#178 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#179 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#180 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#181 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#182 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#183 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#184 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#185 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#186 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#187 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#188 0x0000700325b33eba in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#189 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#190 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#191 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#192 0x0000700325acd569 in slot_tp_call () from /usr/pkg/lib/libpython3.6.so.1.0
#193 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#194 0x0000700325a66f99 in _PyObject_FastCallKeywords () from /usr/pkg/lib/libpython3.6.so.1.0
#195 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#196 0x0000700325b2d22f in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#197 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#198 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#199 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#200 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#201 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#202 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#203 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#204 0x0000700325b2bdcb in PyEval_EvalCodeEx () from /usr/pkg/lib/libpython3.6.so.1.0
#205 0x0000700325a93ce1 in function_call () from /usr/pkg/lib/libpython3.6.so.1.0
#206 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#207 0x0000700325b30754 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#208 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#209 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#210 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#211 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#212 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#213 0x0000700325b2b922 in fast_function () from /usr/pkg/lib/libpython3.6.so.1.0
#214 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#215 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#216 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#217 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#218 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#219 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#220 0x0000700325b33eba in _PyFunction_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#221 0x0000700325a66a98 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#222 0x0000700325a66c72 in _PyObject_Call_Prepend () from /usr/pkg/lib/libpython3.6.so.1.0
#223 0x0000700325a66823 in PyObject_Call () from /usr/pkg/lib/libpython3.6.so.1.0
#224 0x0000700325acd569 in slot_tp_call () from /usr/pkg/lib/libpython3.6.so.1.0
#225 0x0000700325a669b7 in _PyObject_FastCallDict () from /usr/pkg/lib/libpython3.6.so.1.0
#226 0x0000700325a66f99 in _PyObject_FastCallKeywords () from /usr/pkg/lib/libpython3.6.so.1.0
#227 0x0000700325b2baf0 in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#228 0x0000700325b2d22f in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#229 0x0000700325b2ad6c in _PyFunction_FastCall () from /usr/pkg/lib/libpython3.6.so.1.0
#230 0x0000700325b2bb9b in call_function () from /usr/pkg/lib/libpython3.6.so.1.0
#231 0x0000700325b2eab2 in _PyEval_EvalFrameDefault () from /usr/pkg/lib/libpython3.6.so.1.0
#232 0x0000700325b2b753 in _PyEval_EvalCodeWithName () from /usr/pkg/lib/libpython3.6.so.1.0
#233 0x0000700325b2bdcb in PyEval_EvalCodeEx () from /usr/pkg/lib/libpython3.6.so.1.0
#234 0x0000700325b2be32 in PyEval_EvalCode () from /usr/pkg/lib/libpython3.6.so.1.0
#235 0x0000700325b57128 in run_mod () from /usr/pkg/lib/libpython3.6.so.1.0
#236 0x0000700325b595e8 in PyRun_FileExFlags () from /usr/pkg/lib/libpython3.6.so.1.0
#237 0x0000700325b59750 in PyRun_SimpleFileExFlags () from /usr/pkg/lib/libpython3.6.so.1.0
#238 0x0000700325b70b31 in Py_Main () from /usr/pkg/lib/libpython3.6.so.1.0
#239 0x0000000000400dd4 in main ()
(gdb)

I don't know enough about cffi to debug this, can you help please?

@reaperhulk
Copy link
Member

Does it always fail at the same point? Could you run py.test-3.6 -v tests/hazmat/backends/test_openssl.py to provide more detail about which tests it is running (and see if it crashes when just running a subset of the tests)?

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jan 28, 2017

Seems quite repeatable, yes, I tried three times and it was always the
same test case.

Output with -v:

======================================================================================= test session starts ========================================================================================
platform netbsd7 -- Python 3.6.0, pytest-3.0.5, py-1.4.30, pluggy-0.4.0 -- /usr/pkg/bin/python3.6
cachedir: .cache
OpenSSL: OpenSSL 1.0.2j  26 Sep 2016
rootdir: /scratch/security/py-cryptography/work/cryptography-1.7.2, inifile:
collected 64 items 
  
tests/hazmat/backends/test_openssl.py::TestLibreSkip::test_skip_no PASSED
tests/hazmat/backends/test_openssl.py::TestLibreSkip::test_skip_yes PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_backend_exists PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_openssl_version_text PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_supports_cipher PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_aes_ctr_always_available PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_register_duplicate_cipher_adapter PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_nonexistent_cipher[mode0] PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_nonexistent_cipher[None] PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_openssl_assert PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_consume_errors PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_ssl_ciphers_registered PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_evp_ciphers_registered PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_error_strings_loaded PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_unknown_error_in_cipher_finalize PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_large_key_size_on_new_openssl PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_int_to_bn PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_int_to_bn_inplace PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSL::test_bn_to_int PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRandomEngine::test_osrandom_engine_is_default PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRandomEngine::test_osrandom_sanity_check PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRandomEngine::test_activate_osrandom_no_default PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRandomEngine::test_activate_builtin_random PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRandomEngine::test_activate_builtin_random_already_active PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRandomEngine::test_osrandom_engine_implementation PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRandomEngine::test_activate_osrandom_already_default PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_generate_rsa_parameters_supported PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_generate_bad_public_exponent PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_cant_generate_insecure_tiny_key PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_non_sha1_pss_mgf1_hash_algorithm_on_old_openssl SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_unsupported_pss_mgf1_hash PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_unsupported PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_supported_pkcs1v15 PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_supported_pss PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_supported_oaep PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_supported_oaep_sha2_combinations PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_unsupported_oaep_ripemd160_sha1 PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_unsupported_oaep_sha1_ripemd160 PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_rsa_padding_unsupported_mgf PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_unsupported_mgf1_hash_algorithm_decrypt SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_unsupported_oaep_hash_algorithm_decrypt SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_unsupported_mgf1_hash_algorithm_ripemd160_decrypt PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_unsupported_mgf1_hash_algorithm_whirlpool_decrypt PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLRSA::test_unsupported_oaep_label_decrypt PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLCMAC::test_unsupported_cipher PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLCreateX509CSR::test_unsupported_dsa_keys SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLCreateX509CSR::test_unsupported_ec_keys SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLSignX509Certificate::test_requires_certificate_builder PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLSignX509Certificate::test_sign_with_dsa_private_key_is_unsupported SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLSignX509Certificate::test_sign_with_ec_private_key_is_unsupported SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLSignX509CertificateRevocationList::test_invalid_builder PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLSignX509CertificateRevocationList::test_sign_with_dsa_private_key_is_unsupported SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLSignX509CertificateRevocationList::test_sign_with_ec_private_key_is_unsupported SKIPPED
tests/hazmat/backends/test_openssl.py::TestOpenSSLCreateRevokedCertificate::test_invalid_builder PASSED
tests/hazmat/backends/test_openssl.py::TestOpenSSLSerializationWithOpenSSL::test_pem_password_cb_buffer_too_small [1]   Segmentation fault (core dumped) py.test-3.6 -v t...

@reaperhulk
Copy link
Member

Okay, this script should replicate the segfault for you then:

from cryptography.hazmat.backends.openssl.backend import backend

ffi_cb, userdata = backend._pem_password_cb(b"aa")
handle = backend._ffi.new_handle(userdata)
buf = backend._ffi.new('char *')
print(ffi_cb(buf, 1, False, handle))

Could you confirm that? And then, just for good measure run these variants and tell me what you get?

from cryptography.hazmat.backends.openssl.backend import backend

ffi_cb, userdata = backend._pem_password_cb(b"aa")
handle = backend._ffi.new_handle(userdata)
buf = backend._ffi.new('char *')
from cryptography.hazmat.backends.openssl.backend import backend

ffi_cb, userdata = backend._pem_password_cb(b"aa")
handle = backend._ffi.new_handle(userdata)
buf = backend._ffi.new('char []', 2)
print(ffi_cb(buf, 1, False, handle))
from cryptography.hazmat.backends.openssl.backend import backend

ffi_cb, userdata = backend._pem_password_cb(b"aa")
handle = backend._ffi.new_handle(userdata)
buf = backend._ffi.new('char []', 1)
print(ffi_cb(buf, 1, False, handle))

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jan 28, 2017

Scripts 1, 3, and 4 give me Memory fault (core dumped).
Script 2 returns nothing, but no fault either.
Just to make sure, script 2 is

from cryptography.hazmat.backends.openssl.backend import backend

ffi_cb, userdata = backend._pem_password_cb(b"aa")
handle = backend._ffi.new_handle(userdata)
buf = backend._ffi.new('char *')

When I add a print line

print(ffi_cb(buf, 1, False, handle))

like the other scripts have, it also dumps core.

@reaperhulk
Copy link
Member

Yep, just wanted to confirm that the actual callback was causing the crash. Interesting that the crash occurs even when the memory size is sufficiently large to handle it. Okay, I need to head out for a bit but would you mind cloning current master and installing it in a virtualenv to see if the crash occurs there?

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jan 28, 2017

Ok, I did:

virtualenv ~/pycrypto
cd ~/pycrypto
# to get the dependencies installed
./bin/pip3.6 install cryptography
./bin/pip uninstall cryptography              
git clone git@github.com:pyca/cryptography.git
cd cryptography
../bin/python3.6 setup.py build
../bin/pip install pytest 
../bin/python3.6 setup.py install
../bin/pytest
../bin/pip install cryptography_vectors
../bin/pytest
../bin/pip install pretend pytz pyasn1_modules iso8601
../bin/pytest

and this mostly ran through, except for

===================================================================================== short test summary info ======================================================================================
SKIP [1] /home/wiz/pycrypto/cryptography/tests/hazmat/bindings/test_commoncrypto.py:11: could not import 'cryptography.hazmat.bindings.commoncrypto.binding'
SKIP [1] /home/wiz/pycrypto/cryptography/tests/utils.py:49: No backends provided supply the interface: ScryptBackend
SKIP [2] /home/wiz/pycrypto/cryptography/tests/hypothesis/__init__.py:9: could not import 'hypothesis'
SKIP [2] tests/test_x509.py:1527: Requires windows
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:22: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:26: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:34: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:46: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_openssl.py:399: Requires OpenSSL without rsa_oaep_md (< 1.0.2)
SKIP [1] tests/hazmat/backends/test_openssl.py:415: Requires OpenSSL without rsa_oaep_md (< 1.0.2)
SKIP [3] /home/wiz/pycrypto/cryptography/tests/utils.py:60: Does not support CAST5 CTR (<cryptography.hazmat.backends.openssl.backend.Backend object at 0x7d4ddb165e98>)
SKIP [9] /home/wiz/pycrypto/cryptography/tests/utils.py:60: Does not support BLAKE2b (<cryptography.hazmat.backends.openssl.backend.Backend object at 0x7d4ddb165e98>)
SKIP [9] /home/wiz/pycrypto/cryptography/tests/utils.py:60: Does not support BLAKE2s (<cryptography.hazmat.backends.openssl.backend.Backend object at 0x7d4ddb165e98>)
SKIP [480] /home/wiz/pycrypto/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_aes128
SKIP [480] /home/wiz/pycrypto/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_aes192
SKIP [480] /home/wiz/pycrypto/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_aes256
SKIP [480] /home/wiz/pycrypto/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_tdes2
SKIP [480] /home/wiz/pycrypto/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_tdes3
SKIP [800] /home/wiz/pycrypto/cryptography/tests/hazmat/primitives/utils.py:413: Does not support counter location: middle_fixed

============================================================================================= FAILURES =============================================================================================
_______________________________________________________________________________________ test_vector_version ________________________________________________________________________________________

    def test_vector_version():
>       assert cryptography.__version__ == cryptography_vectors.__version__
E       assert '1.8.dev1' == '1.7.2'
E         - 1.8.dev1
E         + 1.7.2

tests/test_utils.py:3588: AssertionError
====================================================================== 1 failed, 83208 passed, 3233 skipped in 245.67 seconds ======================================================================

py-cffi in pkgsrc has one patch:

Handle PaX/MPROTECT

--- c/malloc_closure.h.orig     2016-09-21 22:53:05.889258675 -0400
+++ c/malloc_closure.h  2016-09-21 22:53:47.057812777 -0400
@@ -57,6 +57,8 @@
 
 #define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \
         : (emutramp_enabled = emutramp_enabled_check ()))
+#elif defined(__NetBSD__)
+#define is_emutramp_enabled() 1        /* We have PaX MPROTECT, no point in checking if it is enabled! */
 #else
 #define is_emutramp_enabled() 0
 #endif

Not sure what else would explain the test success.

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jan 28, 2017
Add more test dependencies.
Self tests cause a python core dump, see
pyca/cryptography#3372

1.7.2 - 2017-01-27
~~~~~~~~~~~~~~~~~~

* Updated Windows and macOS wheels to be compiled against OpenSSL 1.0.2k.
@0-wiz-0
Copy link
Author

0-wiz-0 commented Jan 28, 2017

The problem is not related to the py-cffi patch, removing that does not change the situation.
On the other hand, the problem seems to be fixed on git head.

I made a package for current git head, to make sure the environments for both tests are the same, and I cannot reproduce the problem there.

tests/test_cryptography_utils.py .
tests/test_fernet.py ........................
tests/test_interfaces.py .....
tests/test_utils.py ...................................F....
tests/test_warnings.py ..
tests/test_x509.py ....................................................................................ss....................................................................................................................................
tests/test_x509_crlbuilder.py ..............................
tests/test_x509_ext.py ..............................................................................................................................................................................................................................................................................................
tests/test_x509_revokedcertbuilder.py ....................
tests/hazmat/backends/test_backendinit.py ..
tests/hazmat/backends/test_commoncrypto.py ssss
tests/hazmat/backends/test_multibackend.py ..............
tests/hazmat/backends/test_openssl.py ......................................ss.................
tests/hazmat/bindings/test_openssl.py ........
tests/hazmat/primitives/test_3des.py ...............................................................................................................................................................
...
===================================================================================== short test summary info ======================================================================================
SKIP [1] /scratch/wip/py-cryptography-git/work/cryptography/tests/hazmat/bindings/test_commoncrypto.py:11: could not import 'cryptography.hazmat.bindings.commoncrypto.binding'
SKIP [1] /scratch/wip/py-cryptography-git/work/cryptography/tests/utils.py:49: No backends provided supply the interface: ScryptBackend
SKIP [2] /scratch/wip/py-cryptography-git/work/cryptography/tests/hypothesis/__init__.py:9: could not import 'hypothesis'
SKIP [2] tests/test_x509.py:1527: Requires windows
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:22: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:26: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:34: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_commoncrypto.py:46: CommonCrypto not available
SKIP [1] tests/hazmat/backends/test_openssl.py:399: Requires OpenSSL without rsa_oaep_md (< 1.0.2)
SKIP [1] tests/hazmat/backends/test_openssl.py:415: Requires OpenSSL without rsa_oaep_md (< 1.0.2)
SKIP [3] /scratch/wip/py-cryptography-git/work/cryptography/tests/utils.py:60: Does not support CAST5 CTR (<cryptography.hazmat.backends.openssl.backend.Backend object at 0x7ce1543b7958>)
SKIP [9] /scratch/wip/py-cryptography-git/work/cryptography/tests/utils.py:60: Does not support BLAKE2b (<cryptography.hazmat.backends.openssl.backend.Backend object at 0x7ce1543b7958>)
SKIP [9] /scratch/wip/py-cryptography-git/work/cryptography/tests/utils.py:60: Does not support BLAKE2s (<cryptography.hazmat.backends.openssl.backend.Backend object at 0x7ce1543b7958>)
SKIP [480] /scratch/wip/py-cryptography-git/work/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_aes128
SKIP [480] /scratch/wip/py-cryptography-git/work/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_aes192
SKIP [480] /scratch/wip/py-cryptography-git/work/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_aes256
SKIP [480] /scratch/wip/py-cryptography-git/work/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_tdes2
SKIP [480] /scratch/wip/py-cryptography-git/work/cryptography/tests/hazmat/primitives/utils.py:407: KBKDF does not support algorithm: cmac_tdes3
SKIP [800] /scratch/wip/py-cryptography-git/work/cryptography/tests/hazmat/primitives/utils.py:413: Does not support counter location: middle_fixed

============================================================================================= FAILURES =============================================================================================
_______________________________________________________________________________________ test_vector_version ________________________________________________________________________________________

    def test_vector_version():
>       assert cryptography.__version__ == cryptography_vectors.__version__
E       assert '1.8.dev1' == '1.7.2'
E         - 1.8.dev1
E         + 1.7.2

tests/test_utils.py:3588: AssertionError
====================================================================== 1 failed, 83208 passed, 3233 skipped in 329.34 seconds ======================================================================

Do you have an idea which commit(s) might have fixed the problem?

0-wiz-0 added a commit to NetBSD/pkgsrc-wip that referenced this issue Jan 28, 2017
@reaperhulk
Copy link
Member

It's almost certainly #3350 which changes py3.x to use a different cffi callback model. It's possible that there's a bug in the old-style cffi callbacks on NetBSD I suppose, but to check that we'd need to build a reduced test case.

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jan 28, 2017

I don't think that's it, or not only that.
I've applied both patches from that merge request on top of 1.7.2 and still see the segfault.

Also, I'm testing with python-3.6, so sys.version_info >= (3, 5) should already have been true, right?

@reaperhulk
Copy link
Member

Prior to that PR it checked to see if it was >= (3, 5) to disable static callbacks. You'll need to recompile/reinstall after applying that patch to verify the behavioral change. If you did that and it's still crashing then that's surprising 😮

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jan 28, 2017

Oh, sorry, bitten by #3373, I forgot to reinstall.
#3350 does indeed fix the problem for me.
Thank you for the analysis!

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jan 28, 2017
@reaperhulk
Copy link
Member

Closing since this is effectively resolved (and will be in the next release)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants