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.

Author xiang.zhang
Recipients Steven Adams, amaury.forgeotdarc, belopolsky, meador.inge, vstinner, xiang.zhang
Date 2016-04-18.07:29:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460964576.45.0.25867766325.issue26793@psf.upfronthosting.co.za>
In-reply-to
Content
I write a simple example which behaviour is like Steven's example.

import os
import sys
import threading
import ctypes
import time

def test():
    while True:
        print(time.time())

_thread = threading.Thread(target=test)

pid = os.fork()
if pid > 0:
    sys.exit(0)

_thread.start()

Run this with py3.4 emits one print and then comes fatal error:

[code]$ python3 ctypes_test.py 
1460964519.9721818
[code]$ Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads

Thread 0x00007f41fdadf700 (most recent call first):
  File "ctypes_test.py", line 9 in test
  File "/usr/lib/python3.4/threading.py", line 868 in run
  File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
  File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap

Current thread 0x00007f41ff9a9700 (most recent call first):
^C

Without import ctypes, it's OK.
History
Date User Action Args
2016-04-18 07:29:36xiang.zhangsetrecipients: + xiang.zhang, amaury.forgeotdarc, belopolsky, vstinner, meador.inge, Steven Adams
2016-04-18 07:29:36xiang.zhangsetmessageid: <1460964576.45.0.25867766325.issue26793@psf.upfronthosting.co.za>
2016-04-18 07:29:36xiang.zhanglinkissue26793 messages
2016-04-18 07:29:35xiang.zhangcreate