| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
* Don't call close() if the file descriptor is negative. * If close() fails, chain the existing exception.
Sorry, something went wrong.
|
Example to trigger #130052 (comment) bug. Apply the patch: diff --git a/Modules/_testexternalinspection.c b/Modules/_testexternalinspection.c
index e90cfb9132b..dfb874c2f9a 100644
--- a/Modules/_testexternalinspection.c
+++ b/Modules/_testexternalinspection.c
@@ -335,6 +335,7 @@ search_map_for_section(pid_t pid, const char* secname, const char* map)
uintptr_t result = 0;
void* file_memory = NULL;
+elf_file[0] = 'X';
int fd = open(elf_file, O_RDONLY);
if (fd < 0) {
PyErr_SetFromErrno(PyExc_OSError);Run the test: $ ./python -m test -v test_external_inspection -v (...) 0:00:00 load avg: 0.91 [1/1] test_external_inspection test_async_gather_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_gather_remote_stack_trace) ... python: Objects/call.c:342: _PyObject_Call: Assertion `!_PyErr_Occurred(tstate)' failed. Fatal Python error: Aborted Current thread 0x00007fc09e64d780 [python] (most recent call first): File "/home/vstinner/python/main/Lib/test/test_external_inspection.py", line 271 in test_async_gather_remote_stack_trace (...) Extension modules: _testinternalcapi, _testexternalinspection (total: 2) Abandon (core dumped) |
Sorry, something went wrong.
|
There is another bug in find_map_start_address(), it fails to retrieve the ELF filename in some cases. But I chose to focus on the first most urgent bug. The bug is hard is reproduce. |
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
|
GH-132598 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
@vstinner thanks for the fix! Do you want me to look at the second bug? |
Sorry, something went wrong.
If you want. Sometimes, find_map_start_address() fails to parse the ELF filename and so open() fails. For example, the filename starts with spaces and ends with a newline. I don't know how to reproduce the bug in a reliable way. |
Sorry, something went wrong.
It seems that @pablogsal fixed this, at least he handle \n in the latest code: Lines 524 to 539 in 56c88e4 I tried to reproduce, but python doesn't run at all. root@s512:~/sources/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/2222222222222222222-2222222222222222222-2222222222222222222-2222222222222222222-2222222222222222222/33333333333333333333333333333-33333333333333333333333333333-33333333333333333333333333333/cpython# ./python -m test -v test_external_inspection Exception ignored while running getpath: Traceback (most recent call last): File "<frozen getpath>", line 361, in <module> SystemError: failed to join paths Fatal Python error: error evaluating path Python runtime state: core initialized Stack (most recent call first): <no Python frame> |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.