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.

Title: deliberately crashing tests should prevent core dumps
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lambertv, neologix, pitrou, python-dev, vstinner, zach.ware
Priority: low Keywords: easy, patch

Created on 2013-09-06 18:56 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
issue-18948.patch lambertv, 2013-09-13 15:50 review
issue-18948_v2.patch lambertv, 2013-09-14 01:31 review
issue18948-combined.diff zach.ware, 2013-10-07 20:25 Combine suppression CMs, update Valerie's patch review
Messages (11)
msg197090 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-09-06 18:56
Here is a (exhaustive?) list of tests which deliberately crash the interpreter:
- test_daemon_threads_fatal_error() in test_threading
- several fatal error tests in test_faulthandler
- test_recursionlimit_fatalerror() in test_sys
- test_no_FatalError_infinite_loop() in test_capi

They should reuse the new SuppressCoreFiles facility from
msg197602 - (view) Author: Valerie Lambert (lambertv) * Date: 2013-09-13 15:50
Great! Thanks for putting together a list. I've incorporated SuppressCoreFiles into these tests and have used the test suite without any errors. Again, I'm testing these on Ubuntu.
msg197661 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-09-13 21:01
Ok, I've left a comment on the review tool above. You can click on the "review" link if you haven't received an e-mail.
msg197679 - (view) Author: Valerie Lambert (lambertv) * Date: 2013-09-14 01:31
Oops! That was careless. Fixed.
msg197907 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-09-16 15:05
Perhaps it would be best to either combine SuppressCoreFiles and suppress_crash_popup, or provide a new construct that does so since both are used in almost every place one is used.  Also, test_daemon_threads_fatal_error in test_threading should be using suppress_crash_popup, but isn't currently, which I believe falls under the scope of this issue.
msg198766 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-10-01 11:57
> Perhaps it would be best to either combine SuppressCoreFiles
> and suppress_crash_popup

Yes, these two tools must be merged into one unique portable tool. Example of names:

 * ignore_fatal_errors()
 * dont_report_crashes()
 * ignore_crashes()

Doc: "On Windows, don't display the Windows Error Reporting dialog. On UNIX, disable the creation of coredump file."
msg198768 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-10-01 11:59 was added by #18623.

I implemented a similar tool in my tracemalloc fork:
msg199161 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-10-07 20:25
Here's a patch that combines Valerie's patch with a merged suppress_crash_popup and SuppressCoreFiles called SuppressCrashReport.  

Tests ok on Windows; I haven't been able to test on Unix yet.
msg199164 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-07 20:58
Thanks! The patch works fine here under Linux, too (though I haven't tried to figure out if it really prevented core files from being generated).
msg199248 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-08 21:05
New changeset 1cbd3d9f7d61 by Antoine Pitrou in branch 'default':
Issue #18948: improve SuppressCoreFiles to include Windows crash popup suppression, and use it in more tests.
msg199250 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-08 21:05
Patch committed. Thanks to both of you!
Date User Action Args
2022-04-11 14:57:50adminsetgithub: 63148
2013-10-08 21:05:58pitrousetstatus: open -> closed
resolution: fixed
messages: + msg199250

stage: needs patch -> resolved
2013-10-08 21:05:23python-devsetnosy: + python-dev
messages: + msg199248
2013-10-07 20:58:54pitrousetmessages: + msg199164
2013-10-07 20:25:35zach.waresetfiles: + issue18948-combined.diff

messages: + msg199161
2013-10-01 11:59:51vstinnersetmessages: + msg198768
2013-10-01 11:57:27vstinnersetmessages: + msg198766
2013-09-16 15:05:31zach.waresetnosy: + zach.ware
messages: + msg197907
2013-09-14 01:31:34lambertvsetfiles: + issue-18948_v2.patch

messages: + msg197679
2013-09-13 21:35:32vstinnersetnosy: + vstinner
2013-09-13 21:01:26pitrousetmessages: + msg197661
2013-09-13 15:50:42lambertvsetfiles: + issue-18948.patch
keywords: + patch
messages: + msg197602
2013-09-06 18:56:05pitroucreate