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: Dead Code of Handler check in function faulthandler_fatal_error()
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, pankaj.s01, vstinner
Priority: normal Keywords: patch

Created on 2015-05-27 16:30 by pankaj.s01, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Python-3.4.3-faulthandler.patch pankaj.s01, 2015-05-27 16:30 Modules/faulthandler.c
Messages (2)
msg244195 - (view) Author: Pankaj Sharma (pankaj.s01) * Date: 2015-05-27 16:30
Hi,
There is dead code reported in this issue and I think no need to check for NULL of 'handler' in function faulthandler_fatal_error() and file Python-3.4.3/Modules/faulthandler.c . where 'handler' is pointed to staic array faulthandler_handlers[] which never will be null inside loop with faulthandler_nsignals value and doesn't means to check for NULL outside of loop. but if there is possibility of 'handler' to be NULL then it should be check inside the loop until
handler->signum is not equal to signum and then break;
msg247264 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-07-24 08:36
The check is required to fix a compiler warning. Please keep it, it doesn't
bite.

Maybe add a comment to explain it.
History
Date User Action Args
2022-04-11 14:58:17adminsetgithub: 68490
2019-10-16 23:11:05vstinnersetstatus: open -> closed
resolution: not a bug
stage: resolved
2015-07-24 08:36:17vstinnersetmessages: + msg247264
2015-07-24 05:46:42pankaj.s01setnosy: + benjamin.peterson
2015-05-27 17:34:50r.david.murraysetnosy: + vstinner
2015-05-27 16:30:45pankaj.s01create