classification
Title: test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault
Type: crash Stage: resolved
Components: SSL, Tests Versions: Python 3.9, Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: christian.heimes, sxt1001, thatiparthy, vstinner
Priority: normal Keywords:

Created on 2021-07-11 16:19 by sxt1001, last changed 2021-09-22 12:39 by sxt1001. This issue is now closed.

Files
File name Uploaded Description Edit
log thatiparthy, 2021-07-19 07:46
Messages (6)
msg397254 - (view) Author: tongxiaoge (sxt1001) Date: 2021-07-11 16:19
I have reproduced this problem in the latest versions of Python 3.8.11 and 3.9.6. Python 3.8.5 does not have this problem, other versions are not tested. The failure log is as follows:
[  613s] 0:02:27 load avg: 4.66 Re-running failed tests in verbose mode
[  613s] 0:02:27 load avg: 4.66 Re-running test_ssl in verbose mode
[  613s] test_ssl: testing with 'OpenSSL 1.1.1f  31 Mar 2020' (1, 1, 1, 6, 15)
[  613s]           under 'Linux-5.4.6-x86_64-with-glibc2.2.5'
[  613s]           HAS_SNI = True
[  613s]           OP_ALL = 0x80000054
[  613s]           OP_NO_TLSv1_1 = 0x10000000
[  613s] test__create_stdlib_context (test.test_ssl.ContextTests) ... ok
[  613s] test_cert_store_stats (test.test_ssl.ContextTests) ... ok
[  613s] test_check_hostname (test.test_ssl.ContextTests) ... ok
[  613s] test_ciphers (test.test_ssl.ContextTests) ... ok
[  613s] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault
[  613s] 
[  613s] Current thread 0x00007ff433b90740 (most recent call first):
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/ssl.py", line 483 in __new__
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 1126 in test_constructor
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 650 in _callTestMethod
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 693 in run
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 753 in __call__
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in run
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in __call__
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in run
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in __call__
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/runner.py", line 176 in run
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 2030 in _run_suite
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 2152 in run_unittest
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 4848 in test_main
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 153 in _runtest
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 193 in runtest
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 318 in rerun_failed_tests
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 694 in _main
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 637 in main
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 715 in main
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 46 in _main
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 50 in <module>
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 87 in _run_code
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 194 in _run_module_as_main
[  613s] /var/tmp/rpm-tmp.lFeeM8: line 50: 15891 Segmentation fault      WITHIN_PYTHON_RPM_BUILD= LD_LIBRARY_PATH=$(pwd)/build/debug $(pwd)/build/debug/python -m test.regrtest -wW --slowest -j0 -x test_distutils -x test_bdist_rpm -x test_gdb -x test_socket -x test_asyncio
[  613s] error: Bad exit status from /var/tmp/rpm-tmp.lFeeM8 (%check)

What is the reason for this? and is there a plan to fix it?
msg397256 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-07-11 16:37
Python 3.9.5 and OpenSSL 1.1.1f are both outdated. Can you reproduce the problem with 3.9.6 and 1.1.1k?

Can you tel us more about your system (distribution, CPU arch, compiler) and provide a C stacktrace with debug symbols?
msg397780 - (view) Author: Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) (thatiparthy) * Date: 2021-07-19 07:46
ran on 3.9.6 branch with OpenSSL 1.1.1k  25 Mar 2021. I see this warning in the console. Please also see the attached log for full details.


/Users/srini/workspace/consulting/cpython/Lib/test/support/__init__.py:3105: ResourceWarning: unclosed <ssl.SSLSocket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 60533), raddr=('127.0.0.1', 60534)>
  del self.thread
ResourceWarning: Enable tracemalloc to get the object allocation traceback
msg399266 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-08-09 13:24
tongxiaoge: Without more information, we cannot help you. See Christian's questions.
msg401950 - (view) Author: tongxiaoge (sxt1001) Date: 2021-09-16 14:53
I'm sorry I haven't replied for a long time. I found that the OpenSSL version I use is 1.1.1f, which is probably caused by this. Today, I tried to upgrade Python 3 to 3.8.12, and the same problem occurred. I'll try again after upgrading the OpenSSL version tomorrow. If there are still problems, I'll give a reply at that time.
msg402428 - (view) Author: tongxiaoge (sxt1001) Date: 2021-09-22 12:39
I installed OpenSSL version 1.1.1l and tested it again. The problem disappeared. It should be the reason why the OpenSSL version I used before is too low. The current issue is closed
History
Date User Action Args
2021-09-22 12:39:51sxt1001setstatus: open -> closed

messages: + msg402428
stage: resolved
2021-09-16 14:53:42sxt1001setmessages: + msg401950
2021-08-09 13:24:08vstinnersetmessages: + msg399266
2021-07-19 07:46:48thatiparthysetfiles: + log
nosy: + thatiparthy
messages: + msg397780

2021-07-11 16:37:45christian.heimessetnosy: - Guido.van.Rossum
messages: + msg397256
2021-07-11 16:19:41sxt1001create