Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
33217d22
Unverified
Kaydet (Commit)
33217d22
authored
Kas 16, 2017
tarafından
Victor Stinner
Kaydeden (comit)
GitHub
Kas 16, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929) (#4416)
(cherry picked from commit
6e3d6b5d
)
üst
f35076a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
+36
-3
test_faulthandler.py
Lib/test/test_faulthandler.py
+16
-0
2017-10-09-17-42-30.bpo-31701.NRrVel.rst
...S.d/next/Library/2017-10-09-17-42-30.bpo-31701.NRrVel.rst
+1
-0
faulthandler.c
Modules/faulthandler.c
+19
-3
No files found.
Lib/test/test_faulthandler.py
Dosyayı görüntüle @
33217d22
...
@@ -755,6 +755,22 @@ class FaultHandlerTests(unittest.TestCase):
...
@@ -755,6 +755,22 @@ class FaultHandlerTests(unittest.TestCase):
3
,
3
,
name
)
name
)
@unittest.skipUnless
(
MS_WINDOWS
,
'specific to Windows'
)
def
test_ignore_exception
(
self
):
for
exc_code
in
(
0xE06D7363
,
# MSC exception ("Emsc")
0xE0434352
,
# COM Callable Runtime exception ("ECCR")
):
code
=
f
"""
import faulthandler
faulthandler.enable()
faulthandler._raise_exception({exc_code})
"""
code
=
dedent
(
code
)
output
,
exitcode
=
self
.
get_output
(
code
)
self
.
assertEqual
(
output
,
[])
self
.
assertEqual
(
exitcode
,
exc_code
)
@unittest.skipUnless
(
MS_WINDOWS
,
'specific to Windows'
)
@unittest.skipUnless
(
MS_WINDOWS
,
'specific to Windows'
)
def
test_raise_nonfatal_exception
(
self
):
def
test_raise_nonfatal_exception
(
self
):
# These exceptions are not strictly errors. Letting
# These exceptions are not strictly errors. Letting
...
...
Misc/NEWS.d/next/Library/2017-10-09-17-42-30.bpo-31701.NRrVel.rst
0 → 100644
Dosyayı görüntüle @
33217d22
On Windows, faulthandler.enable() now ignores MSC and COM exceptions.
Modules/faulthandler.c
Dosyayı görüntüle @
33217d22
...
@@ -366,6 +366,23 @@ faulthandler_fatal_error(int signum)
...
@@ -366,6 +366,23 @@ faulthandler_fatal_error(int signum)
}
}
#ifdef MS_WINDOWS
#ifdef MS_WINDOWS
static
int
faulthandler_ignore_exception
(
DWORD
code
)
{
/* bpo-30557: ignore exceptions which are not errors */
if
(
!
(
code
&
0x80000000
))
{
return
1
;
}
/* bpo-31701: ignore MSC and COM exceptions
E0000000 + code */
if
(
code
==
0xE06D7363
/* MSC exception ("Emsc") */
||
code
==
0xE0434352
/* COM Callable Runtime exception ("ECCR") */
)
{
return
1
;
}
/* Interesting exception: log it with the Python traceback */
return
0
;
}
static
LONG
WINAPI
static
LONG
WINAPI
faulthandler_exc_handler
(
struct
_EXCEPTION_POINTERS
*
exc_info
)
faulthandler_exc_handler
(
struct
_EXCEPTION_POINTERS
*
exc_info
)
{
{
...
@@ -373,9 +390,8 @@ faulthandler_exc_handler(struct _EXCEPTION_POINTERS *exc_info)
...
@@ -373,9 +390,8 @@ faulthandler_exc_handler(struct _EXCEPTION_POINTERS *exc_info)
DWORD
code
=
exc_info
->
ExceptionRecord
->
ExceptionCode
;
DWORD
code
=
exc_info
->
ExceptionRecord
->
ExceptionCode
;
DWORD
flags
=
exc_info
->
ExceptionRecord
->
ExceptionFlags
;
DWORD
flags
=
exc_info
->
ExceptionRecord
->
ExceptionFlags
;
/* bpo-30557: only log fatal exceptions */
if
(
faulthandler_ignore_exception
(
code
))
{
if
(
!
(
code
&
0x80000000
))
{
/* ignore the exception: call the next exception handler */
/* call the next exception handler */
return
EXCEPTION_CONTINUE_SEARCH
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment