Title: faulthandler_register_py() may use _Py_sighandler_t previous with initialization
Type: behavior Stage: needs patch
Components: Versions: Python 3.3, Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vstinner Nosy List: christian.heimes, python-dev, vstinner
Priority: normal Keywords:

Created on 2013-07-01 22:04 by christian.heimes, last changed 2013-07-01 22:18 by vstinner. This issue is now closed.

Messages (3)
msg192154 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-01 22:04
faulthandler_register_py() may use the variable previous uninitialized if user->enabled is set.

Excerpt from Coverity log:

var_decl: Declaring variable "previous" without initializer.
711    _Py_sighandler_t previous;

8. Condition "!user->enabled", taking false branch
738    if (!user->enabled) {

CID 984060 (#1 of 1): Uninitialized scalar variable (UNINIT)
12. uninit_use: Using uninitialized value "previous": field "previous"."sa_restorer" is uninitialized.
752    user->previous = previous;
msg192156 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-07-01 22:17
New changeset 229dde749ed6 by Victor Stinner in branch '3.3':
Issue #18343: faulthandler.register() now keeps the previous signal handler

New changeset 74b7ff20e0e4 by Victor Stinner in branch 'default':
(Merge 3.3) Issue #18343: faulthandler.register() now keeps the previous signal
msg192157 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-07-01 22:18
Thanks for the report!
Date User Action Args
2013-07-01 22:18:59vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg192157
2013-07-01 22:17:41python-devsetnosy: + python-dev
messages: + msg192156
2013-07-01 22:04:41christian.heimescreate