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 WanderingLogic
Recipients WanderingLogic
Date 2015-03-12.22:51:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426200687.84.0.455927631723.issue23654@psf.upfronthosting.co.za>
In-reply-to
Content
When the faulthandler module is compiled at -O3 (the default for non-debug builds) with a compiler that does tailcall optimization the Modules/faulthandler.c:stack_overflow() function may become an infinite loop that does not expand the stack.  This puts the interpreter into an infinite loop with 100% CPU utilization that won't respond to SIGINT.  (But sending SIGTERM will get it to exit.)

The Intel compiler (15.0.1 on Linux) seems to be able to prove this optimization "safe".  (And thus cause the function to turn into an infinite loop.)  While gcc 4.8.2 and clang 3.4.2 do not currently optimize this call (because their pointer analysis isn't quite strong enough to deal with the pointer to the depth argument), there's no guarantee that they won't be able to optimize it in their next versions.

This patch adds a test between the recursive call and the return statement which makes it not a tail call.
History
Date User Action Args
2015-03-12 22:51:27WanderingLogicsetrecipients: + WanderingLogic
2015-03-12 22:51:27WanderingLogicsetmessageid: <1426200687.84.0.455927631723.issue23654@psf.upfronthosting.co.za>
2015-03-12 22:51:27WanderingLogiclinkissue23654 messages
2015-03-12 22:51:27WanderingLogiccreate