Author Hexorg
Recipients Hexorg
Date 2018-12-05.12:55:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1544014510.18.0.788709270274.issue35419@psf.upfronthosting.co.za>
In-reply-to
Content
Checking if thread.is_alive() while thread is checking on Process.is_alive() seemingly causes undefined behavior. 

The attached POC is expected to print "ThreadN.data == 1999" for N in range(0, 20) with some repeats. However the integers are spread all over the place. Moreover sometimes one or more of the threads never terminate resulting in technically infinite amount of "ThreadN.data == ###" prints. 

In python2.7.15 I never observed a thread lock (only early terminations), but in python3.4.8 I did.

You may have to adjust max_count variable to have higher success rate of thread locking. I got about 40% chance of `python3 bug_test.py` never finishing on an Intel(R) Core(TM) i7-4610M CPU @ 3.00GHz
History
Date User Action Args
2018-12-05 12:55:10Hexorgsetrecipients: + Hexorg
2018-12-05 12:55:10Hexorgsetmessageid: <1544014510.18.0.788709270274.issue35419@psf.upfronthosting.co.za>
2018-12-05 12:55:10Hexorglinkissue35419 messages
2018-12-05 12:55:09Hexorgcreate