This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asyncio-related (?) segmentation fault
Type: crash Stage:
Components: asyncio, macOS Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, nchammas, ned.deily, ronaldoussoren, vstinner, yselivanov
Priority: normal Keywords:

Created on 2016-03-01 02:50 by nchammas, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
segfault.txt nchammas, 2016-03-01 02:50
stacktrace.txt nchammas, 2016-03-01 02:51
faulthandler-stacktrace.txt nchammas, 2016-03-01 13:30
Messages (3)
msg261036 - (view) Author: Nicholas Chammas (nchammas) * Date: 2016-03-01 02:50
Python 3.5.1, OS X 10.11.3.

I have an application that uses asyncio and Cryptography (via the AsyncSSH library). Cryptography has some parts written in C, I believe.

I'm testing my application by sending a keyboard interrupt while 2 tasks are working. My application doesn't clean up after itself correctly, so I get these warnings about pending tasks being destroyed, but I don't think I should ever be getting segfaults. I am able to consistently get this segfault by interrupting my application at roughly the same point.

I'm frankly intimidated by the segfault (it's been many years since I dug into one), but the most likely culprits are either Python or Cryptography since they're the only components of my application that have parts written in C, as far as I know.

I'm willing to help boil this down to something more minimal with some help. Right now I just have the repro at this branch of my application (which isn't too helpful for people other than myself): 

https://github.com/nchammas/flintrock/pull/77

Basically, launch a cluster on EC2, and as soon as one task reports that SSH is online, interrupt Flintrock with Control + C. You'll get this segfault.
msg261045 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-03-01 09:36
Please try to get the Python stacktrace on the segfault using the faulthandler module: add faulthandler.enable() call at the beginning of your application.

https://docs.python.org/dev/library/faulthandler.html

I suspect a bug in your C code, not in asyncio. asyncio is written in pure Python.
msg261048 - (view) Author: Nicholas Chammas (nchammas) * Date: 2016-03-01 13:30
Thanks for the tip. Enabling the fault handler reveals that the crash is happening from the Cryptography library. I'll move this issue there.

Thank you.
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70650
2016-03-01 13:30:14nchammassetstatus: open -> closed
files: + faulthandler-stacktrace.txt
resolution: not a bug
messages: + msg261048
2016-03-01 09:36:42vstinnersetmessages: + msg261045
2016-03-01 02:51:18nchammassetfiles: + stacktrace.txt
2016-03-01 02:50:54nchammascreate